集成 LLM 的数据库工具,支持自然语言操作数据库。对需要与 DB 频繁交互的开发者有实用价值,但成熟度待评估。
一款开源的 AI 数据助手,连接数据源、自动生成 SQL 和代码、在沙箱环境中运行任务、生成报告和洞察。
DB-GPT 是新一代 AI + Data 产品的开源 agentic AI 数据助手。
它帮助用户和团队:
连接数据库、CSV / Excel 文件、数据仓库和知识库
用自然语言提问,让 AI 自动生成 SQL
运行 Python 驱动的分析工作流
加载和执行领域特定任务的可复用 skills
生成图表、仪表板、HTML 报告和分析总结
在沙箱环境中安全执行任务
DB-GPT 同时也是一个平台,用于使用 agents、AWEL、RAG 和多模型支持构建 AI 原生数据 agents、工作流和应用。
规划任务、分解工作步骤、调用工具,端到端完成分析工作流。
生成 SQL 和代码来查询数据、清理数据集、计算指标并产出结果。
跨越结构化和非结构化数据源工作,包括数据库、电子表格、文档和知识库。
将领域知识、分析方法和执行工作流打包成可复用的 skills。
在隔离环境中运行代码和工具,实现更安全、更可靠的分析。
分析 CSV / Excel 文件并生成可视化报告
连接数据库并生成数据分析报告
用自然语言提问,让 AI 自动生成 SQL
通过代码、图表和叙述性总结执行财务报告分析
创建和复用 SQL 分析 skills 和领域工作流
在单个 agentic 工作流中组合代码、SQL、检索和工具
为你的团队或产品构建下一代 AI + Data 助手
连接文件、数据库和知识库到一个工作空间。让 AI 推理任务、生成 SQL 和代码,逐步执行。加载可复用的 skills 来执行可重复的业务分析工作流。生成图表、仪表板、HTML 报告和易于决策的输出。
用一行安装程序在几分钟内启动 DB-GPT(macOS & Linux):
curl -fsSL https://raw.githubusercontent.com/eosphoros-ai/DB-GPT/main/scripts/install/install.sh | bash
或直接指定 profile 和 API key:
curl -fsSL https://raw.githubusercontent.com/eosphoros-ai/DB-GPT/main/scripts/install/install.sh \
| OPENAI_API_KEY=sk-xxx bash -s -- --profile openai
对于通过 Moonshot API 的 Kimi 2.5:
curl -fsSL https://raw.githubusercontent.com/eosphoros-ai/DB-GPT/main/scripts/install/install.sh \
| MOONSHOT_API_KEY=sk-xxx bash -s -- --profile kimi
对于通过 OpenAI 兼容 API 的 MiniMax:
curl -fsSL https://raw.githubusercontent.com/eosphoros-ai/DB-GPT/main/scripts/install/install.sh \
| MINIMAX_API_KEY=sk-xxx bash -s -- --profile minimax
已经有本地 DB-GPT checkout?复用它而不是克隆到 ~/.dbgpt/DB-GPT:
OPENAI_API_KEY=sk-xxx \
bash scripts/install/install.sh --profile openai --repo-dir "$(pwd)" --yes
或复用本地仓库使用 Kimi 2.5:
MOONSHOT_API_KEY=sk-xxx \
bash scripts/install/install.sh --profile kimi --repo-dir "$(pwd)" --yes
或复用本地仓库使用 MiniMax:
MINIMAX_API_KEY=sk-xxx \
bash scripts/install/install.sh --profile minimax --repo-dir "$(pwd)" --yes
安装完毕后,使用生成的 profile 配置启动服务器:
cd ~/.dbgpt/DB-GPT && uv run dbgpt start webserver --profile <profile>
然后打开 http://localhost:5670。
想先查看脚本?
curl -fsSL https://raw.githubusercontent.com/eosphoros-ai/DB-GPT/main/scripts/install/install.sh -o install.sh
less install.sh
bash install.sh --profile openai
从 PyPI 安装 DB-GPT 并用一个命令启动——无需源代码 checkout。
前置条件:Python 3.10+ 和 uv(推荐)或 pip。
# 推荐:使用 uv
uv pip install dbgpt-app
# 或使用 pip
pip install dbgpt-app
默认安装包含核心框架(CLI、FastAPI、Agent)、OpenAI 兼容 LLM 支持、DashScope / Tongyi 支持、RAG 文档解析和 ChromaDB 向量存储。
dbgpt start
首次运行时,交互式设置向导将引导你选择 LLM 提供者并输入 API key。完成后,Web 服务器自动启动。
访问 http://localhost:5670——一切就绪!🎉
关于 Docker、本地 GPU 模型(vLLM、llama.cpp)或手动源代码设置,请参考完整文档:
逐步执行
自然语言到 SQL、Python 驱动的分析和转换、多源数据访问、混合源工作流、可定制的执行流
报告和决策支持
数据库 profiling 报告、财务分析报告、可视化报告和仪表板、总结和商业洞察
安全和可靠性
沙箱代码执行、可复现的输出和工件
关于 Text2SQL 微调的更多信息
我们通过私有模型部署、代理脱敏和沙箱执行机制保护数据隐私和执行安全。
我们相信数据产品的未来超越仪表板。
下一代 AI + Data 产品将能够:
编写 SQL 和代码
把分析转化为报告、决策和行动
DB-GPT 致力于帮助开发者和企业构建这个未来。
如需了解贡献的详细指南,请参考贡献指南。
MIT 许可证(MIT)
如需了解 DB-GPT 的整体架构,请引用论文和论文。
如需了解如何使用 DB-GPT 进行 Agent 开发,请引用论文。
@article{xue2023dbgpt,
title={DB-GPT: Empowering Database Interactions with Private Large Language Models},
author={Siqiao Xue and Caigao Jiang and Wenhui Shi and Fangyin Cheng and Keting Chen and Hongjun Yang and Zhiping Zhang and Jianshan He and Hongyang Zhang and Ganglin Wei and Wang Zhao and Fan Zhou and Danrui Qi and Hong Yi and Shaodong Liu and Faqiang Chen},
year={2023},
journal={arXiv preprint arXiv:2312.17449},
url={https://arxiv.org/abs/2312.17449}
}
@misc{huang2024romasrolebasedmultiagentdatabase,
title={ROMAS: A Role-Based Multi-Agent System for Database monitoring and Planning},
author={Yi Huang and Fangyin Cheng and Fan Zhou and Jiahui Li and Jian Gong and Hongjun Yang and Zhidong Fan and Caigao Jiang and Siqiao Xue and Faqiang Chen},
year={2024},
eprint={2412.13520},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2412.13520},
}
@inproceedings{xue2024demonstration,
title={Demonstration of DB-GPT: Next Generation Data Interaction System Empowered by Large Language Models},
author={Siqiao Xue and Danrui Qi and Caigao Jiang and Wenhui Shi and Fangyin Cheng and Keting Chen and Hongjun Yang and Zhiping Zhang and Jianshan He and Hongyang Zhang and Ganglin Wei and Wang Zhao and Fan Zhou and Hong Yi and Shaodong Liu and Hongjun Yang and Faqiang Chen},
year={2024},
booktitle = "Proceedings of the VLDB Endowment",
url={https://arxiv.org/abs/2404.10209}
}
感谢所有为 DB-GPT 做出贡献的人!你的想法、代码、评论,甚至在活动和社交平台上分享,都能让 DB-GPT 更好。我们正在建设社区,如果你有任何关于社区建设的想法,欢迎联系我们。
Github Issues ⭐️:关于 DB-GPT 的使用问题,请参见贡献指南。
Github Discussions ⭐️:分享你的体验或独特应用。
Twitter ⭐️:欢迎和我们交流。