AIResearch AIResearch
Back to articles
AI

AI Agent Transforms Data Queries Into Insights

A new artificial intelligence system can translate everyday questions into complex database queries while automatically generating maps and charts, making data analysis accessible to non-experts. Rese…

AI Research
November 14, 2025
3 min read
AI Agent Transforms Data Queries Into Insights

A new artificial intelligence system can translate everyday questions into complex database queries while automatically generating maps and charts, making data analysis accessible to non-experts. Researchers from the University of Kansas developed an AI agent that achieved 91.4% accuracy on realistic data questions, dramatically outperforming conventional systems that scored only 28.6% on the same tasks.

The key finding demonstrates that intelligent orchestration—rather than simply using more powerful AI models—enables robust performance in translating natural language to database queries. The system successfully handles the three major challenges that typically break existing approaches: semantic mismatches between how people phrase questions and how databases store information, complex temporal reasoning involving time patterns and date ranges, and spatial semantics that require understanding of neighborhoods and landmarks not explicitly encoded in the database.

The methodology employs a ReAct-style agent built around Mistral AI that operates through a plan-act-observe loop. The system uses six specialized tools: database schema retrieval, SQL query generation, database execution, file reading, plotting, and mapping. Unlike conventional systems that simply convert questions to SQL and return raw tables, this agent can decompose complex questions into sub-problems, adapt phrasing to match database terminology, recover from errors, and automatically select appropriate visualizations.

Results from testing on 35 realistic queries covering the Tokyo check-in dataset show dramatic improvements across all question types. The agent achieved 100% accuracy on multi-step reasoning questions, 96.2% on aggregation and ranking tasks, 94.7% on temporal reasoning, 85.7% on spatial queries, 83.3% on questions requiring external knowledge, and 80% on multi-dataset comparisons. In contrast, the baseline system failed completely on external knowledge and multi-dataset questions, scoring 0% in these categories.

The system's practical significance lies in its ability to bridge the gap between human intuition and database structure. For example, when asked about "nightlife" activity, the agent automatically maps this to relevant database categories like "Bar," "Nightclub," and "Music Venue." When questioned about laundromat locations where the database contains only "Laundry Service" labels, the system successfully identifies and maps the relevant entries. This capability makes data analysis accessible to users who lack SQL expertise, domain knowledge, or advanced prompting skills.

Limitations identified in the research include the system's occasional tendency to generate unsupported geographic functions, over-literal matching of category names, and instability in complex multi-dataset comparisons. The agent failed on three specific queries: one involving JFK Airport location filtering, another about "Pizza Joints" where it didn't generalize to similar labels, and a complex weekend comparison between New York and Tokyo datasets.

The research demonstrates that AI orchestration—combining planning, error recovery, and visualization—represents a practical path forward for making complex data analysis accessible to broader audiences. While the approach increases computational costs by approximately 50% compared to conventional systems, the dramatic improvement in accuracy and usability suggests this trade-off may be worthwhile for many real-world applications.

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