Esta página se muestra en inglés. Una traducción al español está en curso.
CLI ToolsMay 13, 2026·2 min de lectura

langchain_data_agent — NL2SQL Data Agent CLI

NL2SQL data agent with a CLI (`data-agent`) built on LangGraph/LangChain. Ask questions in English to get SQL + results, with per-source configs.

Listo para agents

Staging seguro para este activo

Este activo primero queda en staging. El prompt copiado pide inspeccionar los archivos staged antes de activar scripts, config MCP o config global.

Stage only · 17/100Política: staging
Superficie agent
Cualquier agent MCP/CLI
Tipo
CLI Tool
Instalación
Stage only
Confianza
Confianza: Established
Entrada
Asset
Comando de staging seguro
npx -y tokrepo@latest install 975874e7-2a49-55ed-b667-917d8bc9bd50 --target codex

Primero deja archivos en staging; la activación requiere revisar el README y el plan staged.

Introducción

langchain_data_agent turns natural-language questions into SQL with a CLI front-end, routing queries to specialized agents per config—useful for repeatable data Q&A workflows.

Best for: Data teams prototyping NL2SQL assistants with repeatable configs and CLI workflows

Works with: Python 3.12+ + uv; uses .env for credentials (per README prerequisites)

Setup time: 20–45 minutes

Key facts (verified)

  • README lists CLI commands (query, chat, configs, validate) and config routing behavior.
  • Quick start uses uv sync --all-extras and copies .env.example (README).
  • GitHub: 231 stars · 33 forks; pushed 2026-01-14 (GitHub API verified).

Main

Practical guardrails for NL2SQL agents

Use read-only credentials until you have eval coverage, and log generated SQL + result shape for audits.

README excerpt (verbatim)

+  ╔╦╗╔═╗╔╦╗╔═╗  ╔═╗╔═╗╔═╗╔╗╔╔╦╗
+   ║║╠═╣ ║ ╠═╣  ╠═╣║ ╦║╣ ║║║ ║
+  ═╩╝╩ ╩ ╩ ╩ ╩  ╩ ╩╚═╝╚═╝╝╚╝ ╩

[ Natural Language → SQL Query Agent ]

Python 3.12+ License: MIT


A natural language to SQL (NL2SQL) platform built on LangGraph and Azure OpenAI. This multi-agent system automatically routes user questions to the appropriate database backend and generates optimized SQL queries and results.

Built on top of LangChain's SQLDatabase with extended support for Azure AD authentication, Cosmos DB, and built-in dialect validation.

Features

  • Multi-Database Support: PostgreSQL, Azure SQL, Azure Synapse, Azure Cosmos DB, Databricks SQL, and Google BigQuery
  • Intent Detection: Automatically routes queries to the correct data agent based on question context
  • Multi-Turn Conversations: Follow-up questions with context awareness (e.g., "What's the average?" after a query)
  • SQL Validation: Safe query execution with sqlglot-based validation across all dialects
  • Data Visualization: Generate charts and graphs from query results using natural language (e.g., "show me a bar chart")
  • Configurable Agents: YAML-based configuration for adding new data sources
  • A2A Protocol: Agent-to-Agent interoperability for integration with other A2A-compliant systems

Architecture

Intent Detection Flow

Routes user questions to the appropriate data agent based on context.

Intent Detection Flow

Data Agent Flow

Generates, validates, and executes SQL queries with retry logic.

Data Agent Flow

Documentation

🙏

Fuente y agradecimientos

Source: https://github.com/eosho/langchain_data_agent > License: MIT > GitHub stars: 231 · forks: 33

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados