Cette page est affichée en anglais. Une traduction française est en cours.
CLI ToolsMay 13, 2026·2 min de lecture

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.

Prêt pour agents

Staging sûr pour cet actif

Cet actif est d'abord staged. Le prompt copié demande à l'agent d'inspecter les fichiers staged avant d'activer scripts, config MCP ou config globale.

Stage only · 17/100Policy : staging
Surface agent
Tout agent MCP/CLI
Type
CLI Tool
Installation
Stage only
Confiance
Confiance : Established
Point d'entrée
Asset
Commande de staging sûr
npx -y tokrepo@latest install 975874e7-2a49-55ed-b667-917d8bc9bd50 --target codex

Stage les fichiers d'abord; l'activation exige la revue du README et du plan staged.

Introduction

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

🙏

Source et remerciements

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

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires