基于LangGraph的人工智能代理,连接自定义的MCP服务器以提供自然语言数据库交互。SQL Pilot使用户能够通过对话式AI查询、操作和管理SQLite数据库。
克隆仓库
git clone https://github.com/chandraprvkvsh/SQL-Pilot.git
cd SQL-Pilot
安装依赖项
pip install -r requirements.txt
cd Query-MCP
pip install -r requirements.txt
设置环境变量
export OPENAI_API_KEY="your-openai-api-key"
启动MCP服务器
cd Query-MCP (github.com/chandraprvkvsh/Query-MCP)
python server.py
启动网页界面(在新终端中)
python ui.py
访问界面
http://localhost:7860"显示数据库中的所有表"
"列出所有用户及其电子邮件地址"
"添加一个名为'Alice'且电子邮件为'alice@example.com'的新用户"
"将ID为1的用户更改为'Bob'"
"创建一个名为'products'的新表,包含id、name和price列"
"显示users表的模式"
"我上一次执行的操作是什么?"