From Queries to Insights: Agentic LLM Pipelines for Spatio-Temporal Text-to-SQL Conference: The 1st ACM SIGSPATIAL International Workshop on Generative and Agentic AI for Multi-Modality Space-Time Intelligence; November 3–6, 2025; Minneapolis, MN, USA The 1st ACM SIGSPATIAL International Workshop on
Manu Redd, Tao Zhe, Dongjie Wang · 2025
Read From Queries to Insights: Agentic LLM Pipelines for Spatio-Temporal Text-to-SQL Conference: The 1st ACM SIGSPATIAL International Workshop on Generative and Agentic AI for Multi-Modality Space-Time Intelligence; November 3–6, 2025; Minneapolis, MN, USA The 1st ACM SIGSPATIAL International Workshop on by Manu Redd, Tao Zhe, Dongjie Wang (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2510-25997.txt.
Introduction
Manu Redd, Tao Zhe, and Dongjie Wang build an agent based pipeline that turns plain questions about place and time into database queries and clear answers. Text to SQL systems promise access for users who do not know SQL, but real spatial and temporal questions are hard, since vague phrasing must match exact schema terms and time logic. Their agent wraps a base SQL generator model with planning and tools.
The agent inspects the schema, writes and runs SQL, and can show maps and plots with plain summaries. On thirty five questions over New York and Tokyo check in data, it reached far higher accuracy than the naive baseline in their test. The authors conclude that orchestration, not a stronger generator alone, drove the gain.
Catalog record
| CREATOR | Manu Redd, Tao Zhe, Dongjie Wang |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 37 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2510-25997
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
From Queries to Insights: Agentic LLM Pipelines for Spatio-Temporal Text-to-SQL Conference: The 1st ACM SIGSPATIAL International Workshop on Generative and Agentic AI for Multi-Modality Space-Time Intelligence; November 3–6, 2025; Minneapolis, MN, USA The 1st ACM SIGSPATIAL International Workshop on Generative and Agentic AI for Multi-Modality Space-Time Intelligence (GeoGenAgent ’25), November 3–6, 2025, Minneapolis, MN, USA DOI: 10.1145/3764915.3770724 ISBN: /2025/11 CCS: Computing methodologies Natural language processing CCS: Information systems Structured Query Language CCS: Human-centered computing Visualization CCS: Information systems Geographic information systems CCS: Computing methodologies Multi-agent planning Manu Redd, Tao Zhe, Dongjie Wang Abstract . Natural-language-to-SQL (NL-to-SQL) systems hold promise for democratizing access to structured data, allowing users to query databases without learning SQL. Yet existing systems struggle with realistic spatio-temporal queries, where success requires aligning vague user phrasing with schema-specific categories, handling temporal reasoning, and choosing appropriate outputs. We present an agentic pipeline that extends a naive text-to-SQL baseline (defog/llama-3-sqlcoder-8b) with orchestration by a Mistral-based ReAct agent. The agent can plan, decompose, and adapt queries through schema inspection, SQL generation, execution, and visualization tools. We evaluate on 35 natural-language queries over the NYC and Tokyo check-in dataset, covering spatial, temporal, and multi-dataset reasoning. The agent achieves substantially higher accuracy than the naive baseline ( 91.4% vs. 28.6% ) and enhances usability through maps, plots, and structured natural-language summaries. Crucially, our design enables more natural human–database interaction, supporting users who lack SQL expertise, detailed schema knowledge, or prompting skill. We conclude that agentic orchestration, rather than stronger SQL generators alone, is a promising foundation for interactive geospatial assistants. † † cc-license: by 1. Introduction Natural-language interfaces (NLIs) to databases promise to make structured data accessible to a far broader range of users by allowing questions to be posed in everyday language rather than Structured Query Language (SQL). This paradigm is especially compelling in domains involving spatio-temporal data, such as location-based social networks (LBSNs), where analysts may wish to investigate mobility trends, venue popularity, or neighborhood-level activity patterns. Despite rapid progress in large language model (LLM)-driven text-to-SQL (NL-to-SQL) systems, current approaches remain fragile when faced with the complexities of real-world geospatial datasets. Three recurring challenges illustrate the limitations of existing systems. First, semantic mismatch. User queries are rarely aligned with database schema terms: people ask for "laundromats," while the schema may contain "Laundry Service"; they inquire about "nightlife," while the database encodes categories such as "Bar", "Nightclub", or "Music Venue". Without mechanisms for adaptation, naive NL-to-SQL systems fail to reconcile intent with schema. Second, temporal reasoning. LBSN queries often involve nontrivial temporal structure—hour-of-day trends, weekday/weekend splits, or seasonal windows. These require careful handling of edge cases, such as ranges that cross midnight or holiday-specific comparisons, which most NL-to-SQL systems are not designed to support. Third, spatial semantics. Analysts frequently reference neighborhoods, boroughs, or landmarks, none of which are directly encoded in database columns. Accurate analysis requires either injecting external knowledge (e.g., geographic bounding boxes, landmark coordinates) or decomposing queries into subproblems that align with available schema. Beyond correctness, usability remains a fundamental gap . Naive text-to-SQL systems generally return raw tabular results, leaving interpretation to the user. For non-experts unfamiliar with the schema, SQL, or visualization libraries, this limits practical value: an analyst may know what they want to ask but lack the expertise to determine which table to query , how to phrase filters, or how best to interpret results. An effective system must therefore mediate between underspecified natural-language intent and concrete database operations, while delivering outputs in forms that aid sensemaking—plots, maps, and concise textual summaries. Positioning. Our work situates itself at the intersection of text-to-SQL with LLMs (e.g., SQLCoder ( Defog AI 2024 ) ), tool-augmented reasoning frameworks (ReAct ( Yao et al. 2023 ) , LangChain ( Chase and contributors 2022 ) , LangGraph ( LangChain 2024 ) ), and geospatial analytics on LBSN datasets (e.g., NYC and Tokyo check-ins ( Yang et al. 2015 ) ). While each line of work has matured independently, prior research rarely evaluates an agentic pipeline tailored for spatio-temporal analysis—one that integrates schema discovery, multi-step planning, external knowledge injection, and task-appropriate visualization into an interactive loop. Our approach. We present an agentic NL-to-SQL pipeline that embeds a naive SQL generator as a tool inside a Mistral-based ReAct agent. This agent operates in a plan–act–observe loop, dynamically retrieving schema, generating and refining SQL, executing queries, and producing visualizations and summaries. In doing so, it extends the naive pipeline—which simply maps a query to a single SQL statement—by providing error recovery, multi-step decomposition, and interpretability. The result is a system that not only achieves higher accuracy but also supports more natural human–database interaction for users who lack SQL expertise or detailed schema knowledge. Contributions. This paper makes three contributions: (1) We design an agentic NL-to-SQL pipeline for spatio-temporal queries over the NYC and Tokyo check-in dataset, extending a naive baseline with schema grounding, multi-step reasoning, and visualization support. (2) We provide a head-to-head evaluation against the naive baseline, showing large gains in accuracy ( 91.4% vs. 28.6% ) despite both relying on the same underlying SQL generator. (3) We analyze failure modes, usability benefits, and trade-offs, distilling practical guidelines for building agentic NL-to-SQL systems that improve both correctness and human–database interaction. 2. Related Work Text-to-SQL. Recent progress in natural-language interfaces to databases has been driven by large language models and specialized systems such as SQLCoder ( Defog AI 2024 ) . These approaches achieve strong results on benchmarks like Spider ( Yu et al. 2018 ) but often fail on spatio-temporal queries involving compositional reasoning, schema mismatch, or vague domain-specific phrasing. Outputs are typically returned as raw tables, leaving interpretation and visualization to the user. Gap: Few works study how to transform underspecified geospatial questions into multi-step analyses with schema grounding, error recovery, and user-ready outputs. Agentic AI. Tool-augmented frameworks such as ReAct ( Yao et al. 2023 ) , LangChain ( Chase and contributors 2022 ) , and LangGraph ( LangChain 2024 ) allow LLMs to plan, call tools, and adaptively refine their reasoning. These have shown benefits in tasks requiring decomposition, retrieval, and verification. However, evaluations typically focus on generic QA or knowledge tasks. Gap: There is limited evidence on how agentic orchestration improves correctness and usability in NL-to-SQL for spatio-temporal data, or on the marginal impact of specific tools such as schema inspection, SQL execution, or visualization. Geospatial AI and LBSNs. Studies of location-based social network (LBSN) data (e.g., NYC check-ins ( Yang et al. 2015 ) ) have revealed spatial-temporal regularities in human mobility and activity. Most of this work assumes expert-driven pipelines with handcrafted queries and visualizations. Interactive assistants that accept free-form natural language, resolve schema mismatches, and return geovisualizations remain underexplored. Gap: Prior studies have not systematically evaluated agentic NL-to-SQL pipelines on spatio-temporal LBSN data, especially with per-question correctness and user-facing usability analysis. Our contribution is to fill these gaps by (i) instantiating a geospatially-aware ReAct agent that embeds a naive NL-to-SQL model as a tool, and (ii) evaluating it head-to-head against the baseline on 35 spatio-temporal queries, reporting both accuracy and usability improvements. 3. Dataset We evaluate on the public NYC and Tokyo LBSN Check-in Dataset of Yang et al. ( Yang et al. 2015 ) ,