SQL AI 代理 是 AI Skill Hub 本期精选Agent工作流之一。综合评分 8.0 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
SQL AI 代理 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
SQL AI 代理 是一套完整的 AI Agent 自动化工作流方案。通过可视化的节点编排,将复杂的多步骤任务拆解为清晰的自动化流程,实现全程无人值守的智能处理。支持与数百种外部服务和 API 无缝集成,适合构建数据处理管线、业务自动化和 AI 辅助决策系统。
# 方式一:pip 安装(推荐)
pip install db-agent
# 方式二:虚拟环境安装(推荐生产环境)
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install db-agent
# 方式三:从源码安装(获取最新功能)
git clone https://github.com/db-agent/db-agent
cd db-agent
pip install -e .
# 验证安装
python -c "import db_agent; print('安装成功')"
# 命令行使用
db-agent --help
# 基本用法
db-agent input_file -o output_file
# Python 代码中调用
import db_agent
# 示例
result = db_agent.process("input")
print(result)
# db-agent 配置文件示例(config.yml) app: name: "db-agent" debug: false log_level: "INFO" # 运行时指定配置文件 db-agent --config config.yml # 或通过环境变量配置 export DB_AGENT_API_KEY="your-key" export DB_AGENT_OUTPUT_DIR="./output"
An open-source text-to-SQL AI agent that converts natural language into safe SQL, with production deployment patterns for Databricks, Snowflake, and AWS Lambda. Schema-aware prompt engineering, SQL safety guardrails (SELECT-only validation), and three reference implementations you can deploy at work.
---
---
Featured In
---
---
This repo contains two independent, fully working versions of DB Agent — same agentic pipeline, different deployment targets.
| [Streamlit App](./streamlit_app/) | [Databricks App](./databricks_app/) | |
|---|---|---|
| **Stack** | Python + Streamlit | Python + Streamlit (native Databricks App) |
| **Best for** | Rapid prototyping, data teams, K8s demos | Enterprise Databricks deployments |
| **Auth** | .env + API keys | Databricks OAuth service principal |
| **SQL target** | SQLite / Postgres / MySQL | Unity Catalog Delta tables |
| **Deploy on** | Docker, K8s (DO / AWS EKS) | databricks apps deploy |
See each folder's README for setup and deployment instructions.
---
New to AI agents? Work through the modules in order — each one builds on the last:
| Module | Concept | What you build |
|---|---|---|
| [01 — LLM Basics](./modules/01_llm_basics/) | What is an LLM API call? | Notebook: raw API call, messages, temperature |
| [02 — Structured Output](./modules/02_structured_output/) | How to get reliable JSON from an LLM | Notebook: JSON mode + Pydantic validation |
| [03 — Tool Use](./modules/03_tool_use/) | LLM calls functions instead of generating text | Agent that decides when to query the DB |
| [04 — Agentic Loop](./modules/04_agentic_loop/) | Retry, reflect, recover from errors | Agent with max-steps guard and error recovery |
| [05 — MCP Server](./modules/05_mcp_server/) | Expose tools via a standard protocol | MCP server connectable to Claude Desktop |
---
高质量的开源AI工作流,易于使用
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,SQL AI 代理 在Agent工作流赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | db-agent |
| 原始描述 | 开源AI工作流:SQL AI Agent - Talk to your DB in Natural Language。⭐21 · Python |
| Topics | ai-agentdatabase-managementlarge-language-models |
| GitHub | https://github.com/db-agent/db-agent |
| License | Apache-2.0 |
| 语言 | Python |
收录时间:2026-06-13 · 更新时间:2026-06-13 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端