Build an AI Data Analyst that Queries Databases
Create an intelligent data analyst agent that connects to databases, writes and executes SQL queries from natural language questions, and returns structured insights with visualizations.
AI Agent Framework
Core agent framework that orchestrates natural language understanding, query planning, and result synthesis
Graph-based agent architecture lets you build a multi-step query pipeline: parse question → generate SQL → execute → analyze results → respond, with conditional branching for error recovery and query refinement
Lightweight Python-native agent framework with strong type validation, ideal for structured SQL output and ensuring query results conform to expected schemas
Role-based multi-agent setup allows dedicated agents for query generation, data validation, and insight summarization working in concert
Text-to-SQL & Database Interface
Converts natural language questions into SQL queries and manages database connections with schema awareness
Purpose-built for AI-database interaction with native text-to-SQL capabilities, multi-database support, and schema-aware query generation out of the box
NLSQLTableQueryEngine and SQLDatabase abstractions provide structured text-to-SQL with automatic schema introspection and query validation
Generative BI engine specifically designed for natural language database queries, with semantic modeling layer that understands business context
Code Execution Sandbox
Safely executes generated SQL queries and Python analysis scripts in an isolated environment to prevent destructive operations
Secure sandboxed environments for running AI-generated SQL and Python analysis code, preventing accidental data mutation while allowing full pandas/matplotlib workflows
SDK for running AI-generated code with built-in support for data analysis libraries, suitable for post-query data transformation and chart generation
LLM Gateway & Observability
Routes LLM calls for query generation and insight synthesis, with cost tracking and prompt debugging for production reliability
Unified API across 100+ LLM providers lets you use cheaper models for simple queries and powerful models for complex analytical reasoning, with spend tracking per query
Traces the full pipeline from user question through SQL generation to final answer, enabling debugging of bad queries and optimizing prompt templates over time