AIResearch AIResearch
Back to articles
Data

AI Agent Masters Database Tasks Without SQL Expertise

A new AI system can handle complex data analysis and administrative tasks through simple conversation, achieving high accuracy while reducing user effort and cost.

AI Research
March 27, 2026
4 min read
AI Agent Masters Database Tasks Without SQL Expertise

A new AI agent called AskDB is transforming how people interact with relational databases, allowing users to perform complex data analysis and administrative tasks through natural language without needing to know SQL. Developed by researchers from Mantu Group and Vietnamese-German University, AskDB addresses a long-standing : the difficulty non-technical users face in querying databases and the burden on database administrators with repetitive tasks. By leveraging large language models, AskDB serves as a unified co-pilot that bridges this gap, offering an intuitive interface that could make data more accessible and operations more efficient across organizations. This advancement highlights the potential of AI to democratize data access and streamline backend management, moving beyond isolated tools to a holistic solution.

The key finding from the research is that AskDB achieves strong performance in both analytical and administrative scenarios, with an execution accuracy of 89.8% on a subset of the Spider 1.0 benchmark for text-to-SQL tasks. This means the agent can correctly generate and execute SQL queries from natural language questions most of the time, even without prior schema knowledge beyond table names. On the more challenging Spider 2.0 benchmark, which reflects real-world enterprise workflows, AskDB achieved 36.31% accuracy, demonstrating its ability to handle complex queries while maintaining cost-efficiency. The agent also showed high interaction efficiency, requiring minimal conversational turns to resolve queries, as indicated by an average retrieval value of 1.45 on Spider 1.0, reducing user effort and enhancing autonomy.

Ology behind AskDB is built on a ReAct-based operational framework, which stands for Reasoning, Acting, and Observing, enabling the agent to handle multi-step tasks autonomously. This framework allows AskDB to iteratively analyze user requests, execute actions using tools like query execution and schema exploration, and learn from observations to refine its responses. A core innovation is the dynamic schema-aware prompting mechanism, which uses semantic search to identify relevant database tables and inject only their structured schema information into prompts, similar to retrieval-augmented generation. This approach grounds the AI in the specific database context without overwhelming it with irrelevant data, improving accuracy for large schemas.

From the evaluation, as detailed in the paper, show that AskDB performs competitively against other LLM-based agents, with its 89.8% accuracy on Spider 1.0 surpassing several benchmarks, including models like C3 and DIN-SQL. The agent's cost-efficiency is notable, utilizing lightweight Gemini 2.0 Flash and Gemini 2.5 Flash models, which offer free tiers and lower pricing compared to more expensive options like GPT-4. On Spider 2.0, AskDB's 36.31% accuracy, achieved with an average of 1.34 inquiries per question, indicates strong generalization capabilities, though it highlights areas for improvement in handling deeply nested queries. The system also includes a multi-layered safety protocol with risk classification and automated guardrails, such as PII detection and performance checks, to ensure secure and reliable operations.

Of this research are significant for real-world applications, as AskDB can simplify database interaction for a wide range of users, from business analysts to administrators, potentially increasing data utilization and reducing operational inefficiencies. By providing a conversational interface, it lowers the barrier to data analysis and allows administrators to focus on strategic tasks rather than routine chores. The agent's ability to autonomously debug SQL errors and plan multi-step actions, as illustrated in Figure 4 for performance diagnostics, showcases its problem-solving potential beyond simple query generation. This could lead to more intuitive data tools in enterprises, enhancing productivity and making database management more accessible to non-experts.

However, the paper acknowledges limitations, including AskDB's current weakness in handling deeply nested queries and complex semantic logic, as evidenced by the lower accuracy on Spider 2.0. The system's dependency on Google's Gemini models and evaluation on benchmark subsets rather than full datasets also restricts its generalizability. Future work aims to enhance reasoning capabilities, expand experimental scope, and develop a provider-agnostic architecture for greater flexibility. These steps are crucial for advancing AskDB into a versatile co-pilot that can adapt to diverse database environments and user needs, ensuring it remains practical and effective in real-world deployments.

Original Source

Read the complete research paper

View on arXiv

About the Author

Guilherme A.

Guilherme A.

Former dentist (MD) from Brazil, 41 years old, husband, and AI enthusiast. In 2020, he transitioned from a decade-long career in dentistry to pursue his passion for technology, entrepreneurship, and helping others grow.

Connect on LinkedIn