新特性

1. DB-GPT支持Graph RAG框架, 实现TuGraph上的知识图谱构建与检索

使用步骤:

  • 安装TuGraph
  1. docker pull tugraph/tugraph-runtime-centos7:latest
  2. mkdir -p /tmp/tugraph/data && mkdir -p /tmp/tugraph/log && \
  3. docker run -it -d -p 7001:7001 -p 7070:7070 -p 7687:7687 -p 8000:8000 -p 8888:8888 -p 8889:8889 -p 9090:9090 \
  4. -v /tmp/tugraph/data:/var/lib/lgraph/data -v /tmp/tugraph/log:/var/log/lgraph_log \
  5. --name tugraph_demo tugraph/tugraph-runtime-centos7:latest /bin/bash && \
  6. docker exec -d tugraph_demo bash /setup.sh
  7. pip install "neo4j>=5.20.0"

.env设置TuGraph配置

  1. GRAPH_STORE_TYPE=TuGraph
  2. TUGRAPH_HOST=127.0.0.1
  3. TUGRAPH_PORT=7687
  4. TUGRAPH_USERNAME=admin
  5. TUGRAPH_PASSWORD=xxx
  • 使用知识图谱创建知识空间

v0.5.6 版本更新 - 图1

  • 构建成功后显示知识图谱关系

v0.5.6 版本更新 - 图2

  • 使用知识图谱进行问答

v0.5.6 版本更新 - 图3

更多教程:https://docs.dbgpt.site/docs/latest/cookbook/rag/graph_rag_app_develop

2. DB-GPT 支持 ollama 部署本地模型服务

使用步骤:

  1. 安装ollama https://ollama.com/
  2. 拉取模型
  1. ollama pull qwen:0.5b
  1. 拉取embedding模型
  1. ollama pull nomic-embed-text
  1. 安装python-ollama
  1. pip install ollama
  1. .env配置环境
  1. LLM_MODEL=ollama_proxyllm
  2. PROXY_SERVER_URL=http://127.0.0.1:11434
  3. PROXYLLM_BACKEND="qwen:0.5b"
  4. PROXY_API_KEY=not_used
  5. EMBEDDING_MODEL=proxy_ollama
  6. proxy_ollama_proxy_server_url=http://127.0.0.1:11434
  7. proxy_ollama_proxy_backend="nomic-embed-text:latest"
  1. 启动服务
  1. python dbgpt/app/dbgpt_server.py
  1. Agent模块重构

v0.5.6 版本更新 - 图4

  1. - 更灵活的 `Profile` 模块实现,支持从环境变量、数据库和其他实现创建 agent profiles
  2. - 支持多种memory模式,`sensory memory`, `short-term memory`, `long-term memory` and `hybrid memory`
  • Agent Resource模块重构
    • 将插件模块和资源模块重构为统一的资源模块。
    • Agent中有多种Resource类型,包括database, knowledge, tool, pack等。另外,资源的集合是一种特殊类型的资源,称为Resource Pack
    • 支持从 dbgpts中安装资源,例如使用下面命令安装一个简单计算器工具<font style="color:rgb(31, 35, 40);">dbgpt app install simple-calculator-example -U</font>

参考代码示例: examples/agents

4.**ChatKnowledge**支持**rerank**模型,同时支持将**rerank**模型发布成服务

下载模型并在在.env文件设置模型参数并重启服务

  1. ## Rerank model
  2. RERANK_MODEL=bge-reranker-base
  3. ## If you not set RERANK_MODEL_PATH, DB-GPT will read the model path from EMBEDDING_MODEL_CONFIG based on the RERANK_MODEL.
  4. # RERANK_MODEL_PATH=
  5. ## The number of rerank results to return
  6. RERANK_TOP_K=3

将rerank模型发布成服务

  1. dbgpt start controller --port 8000
  2. dbgpt start worker --worker_type text2vec \
  3. --rerank \
  4. --model_path /app/models/bge-reranker-base \
  5. --model_name bge-reranker-base \
  6. --port 8004 \
  7. --controller_addr http://127.0.0.1:8000

5.支持Qwen110b

6.支持 DeepSeek proxy LLM

使用步骤:

1.修改 .env 模型配置

  1. LLM_MODEL=deepseek_proxyllm
  2. DEEPSEEK_MODEL_VERSION=deepseek-chat
  3. DEEPSEEK_API_BASE=https://api.deepseek.com/v1
  4. DEEPSEEK_API_KEY={your-deepseek-api-key}
  1. 创建 test_proxyllm.py 并使用 DeepseekLLMClient
  1. import asyncio
  2. from dbgpt.core import ModelRequest
  3. from dbgpt.model.proxy import DeepseekLLMClient
  4. # You should set DEEPSEEK_API_KEY to your environment variables
  5. client = DeepseekLLMClient()
  6. print(asyncio.run(client.generate(ModelRequest._build("deepseek-chat", "你是谁?"))))
  1. 运行
  1. DEEPSEEK_API_KEY={your-deepseek-api-key}
  2. python test_proxyllm.py

7.支持 Yi-1.5 LLM

修改 .env 文件

  1. # [Yi-1.5-34B-Chat](https://huggingface.co/01-ai/Yi-1.5-34B-Chat)
  2. LLM_MODEL=yi-1.5-6b-chat
  3. # [Yi-1.5-9B-Chat](https://huggingface.co/01-ai/Yi-1.5-9B-Chat)
  4. LLM_MODEL=yi-1.5-9b-chat
  5. # [Yi-1.5-6B-Chat](https://huggingface.co/01-ai/Yi-1.5-6B-Chat)
  6. LLM_MODEL=yi-1.5-34b-chat

8.重构**Chroma**向量数据库模块

9.支持**Elasticsearch**作为向量数据库

10.**ChatKnowledge** 支持 Excel

🐞 Bug 修复

  1. 修复在 **EmbeddingRetriever** 使用 **CrossEncoderRanker** 问题
  2. 修复 app pydantic error
  3. 支持 milvus autoflush 特性, 替换掉手动flush

✨**官方文档地址**

:::color2 英文

:::

Overview | DB-GPT

:::color2 中文

:::

概览

✨**致谢**

感谢所有贡献者使这次发布成为可能!

@Aries-ckt, @FOkvj, @GITHUBear, @IamWWT, @JamesBonddu, @fangyinc, @fanzhidongyzby, @ivanzhu109, @jsRuner and @yyhhyyyyyy

✨**附录**