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 Apps, Postgres/MySQL, and cross-agent memory on AWS S3 Vectors. Schema-aware prompt engineering, SQL safety guardrails (SELECT-only validation), knowledge files, and result-set benchmarks you can deploy at work.
---
---
Featured In
---
- Text-to-SQL — natural language to SELECT queries via any LLM - Safety layer — blocks all write/admin SQL before it reaches the database - Explainability — schema context, generated SQL, and validation all visible - Any OpenAI-compatible LLM — Databricks Model Serving, OpenAI, Groq, Ollama, LM Studio - SQL backends — SQLite out of the box in the Node app; PostgreSQL, MySQL, Lakebase, and Unity Catalog via the legacy app's SQLAlchemy/Databricks SQL backends - Agentic Memory — redacted, cross-agent memory over a shared store (local JSONL or AWS S3 Vectors), so an OLTP-facing agent and an OLAP-facing agent can share context without sharing data - Knowledge file — per-deployment descriptions, synonyms, example queries, and instructions injected into the prompt - Benchmarks — question + ground-truth SQL pairs scored on result sets, with UI and CI integration ---
Local ([app/](./app)) | Databricks Apps ([app/](./app)) | |
|---|---|---|
| **Stack** | Node.js + Express + React | Node.js + Express + React (native Databricks App) |
| **Best for** | Trying it in one command, local dev | Enterprise Databricks deployments |
| **Auth** | .env | Databricks Apps runtime + secrets |
| **SQL target** | SQLite (bundled demo DB) | SQLite app DB; Unity Catalog via Lakehouse patterns |
| **LLM endpoint** | Ollama or any OpenAI-compatible | Databricks Model Serving or any OpenAI-compatible |
| **Memory backend** | Local JSONL or AWS S3 Vectors | Lakebase pgvector |
Run it locally (SQLite + local Ollama, no API key needed):
cd app
ollama pull qwen2.5-coder:7b
./run_local.sh
Open http://localhost:3001. Any OpenAI-compatible endpoint works instead of Ollama — see app/.env.example for OpenAI, Groq, and Databricks Model Serving.
Deploy to Databricks Apps:
cd app
databricks apps create db-agent-node --description "DB Agent"
databricks sync . /Workspace/Users/<you>/db-agent-node \
--exclude "node_modules/**" --exclude "web/node_modules/**" --exclude "web/dist/**"
databricks apps deploy db-agent-node --source-code-path /Workspace/Users/<you>/db-agent-node
Databricks installs dependencies and builds the frontend automatically. See app/README.md for app.yaml configuration (LLM endpoint, secrets, embeddings model for the memory feature).
Running multiple instances (for cross-agent memory — see Agentic Memory above): each running instance is tagged via DBAGENT_ID, so you can spin up as many as you like, locally or on Databricks, and they'll share suggestions with each other through a common memory store.
```bash
高质量的开源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 类型,复制安装指令后粘贴到对应客户端