cs.CLOct 26, 2026

From Questions to Queries to Insights: A Schema-Grounded Agentic Workflow for Natural-Language Crash Data Analysis

Authors: Jingwen Zhu, Keshu Wu, Steven T. Parker, Bin Ran, David A. Noyce

Organizations: Department of Civil and Environmental Engineering, University of Wisconsin–Madison, Madison, WI, United States

Abstract

Transportation agencies maintain extensive crash databases to identify safety priorities, evaluate countermeasures, and guide resource allocation. Making these data accessible to practitioners requires flexible ways to translate analytical questions into reliable results. Existing dashboards support predefined analyses, while additional requests often depend on specialists who understand database queries, coded fields, and agency conventions. This study presents CrashDB-QA, a fully local, schema-grounded agentic workflow that enables natural-language analysis of crash databases. Specialized components interpret questions, generate and validate read-only SQL, execute queries, and explain the results. A shared knowledge base grounds query construction in the agency's data dictionary and safety-analysis conventions, while recorded intermediate outputs support inspection and auditing. An optional extension, CrashDB-QA+, checks the alignment among the question, query, and execution result and supplies evidence for iterative repair. We evaluate the workflow on a frozen snapshot of 4.4 million Wisconsin crash records using a new benchmark of 300 questions across ten analytical categories and nine local open-weight models. Domain grounding substantially improves query accuracy, and a code-specialized 7B model provides the best accuracy-latency balance among the tested models. Compositional analyses remain more difficult than routine retrieval, particularly comparisons between groups or periods. Verification improves performance when the Judge uses authoritative field definitions and the Refiner receives execution evidence, whereas additional checking alone offers no consistent benefit. These findings demonstrate the potential of locally deployed, domain-grounded workflows to broaden access to crash analysis and identify the reasoning and verification capabilities needed for reliable use.

Figures & tables

Explore similar work

CardsList
  1. Broadening Access to Transportation Safety Data with Generative AI: A Schema-Grounded Framework for Spatial Natural Language Queries

    May 20, 2026Mahdi Azhdari, Eric J. GonzalesGrounded Text Generation

  2. A Governed Agent Architecture for Natural-Language Dashboard Generation over Enterprise DataBrain

    Oct 2, 2026Yiou Wu, Zezhi Tang, Ningwei Bai +1Data Analysis AgentsLLM Agent Orchestration

  3. An Iterative LangGraph Agent for Text-to-SQL: Natural Language Access to the Chicago Crime Database

    Sep 19, 2026Vigneshwar Ravi Rao, Rupesh Swarnakar, Fayeq Jeelani Syed†Text-to-SQLTool-Using Language Agents