暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

值得期待!DB-GPT v0.5.6 版本发布

EosphorosAI 2024-05-17
202
 
亲爱的 DB-GPT 社区伙伴们,DB-GPT v0.5.6 版本发布啦,接下来我们一起看看这个让人激动人心的版本带来哪些变化吧:


 新特性 



🌟  DB-GPT 支持 Graph RAG 框架, 实现 TuGraph 上的知识图谱构建与检索
使用步骤:
  • 安装 TuGraph
    docker pull tugraph/tugraph-runtime-centos7:latest


    mkdir -p tmp/tugraph/data && mkdir -p tmp/tugraph/log && \
    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 \
    -v tmp/tugraph/data:/var/lib/lgraph/data -v tmp/tugraph/log:/var/log/lgraph_log \
    --name tugraph_demo tugraph/tugraph-runtime-centos7:latest bin/bash && \
    docker exec -d tugraph_demo bash setup.sh


    pip install "neo4j>=5.20.0"
    在 .env
    设置 TuGraph
    配置
      GRAPH_STORE_TYPE=TuGraph
      TUGRAPH_HOST=127.0.0.1
      TUGRAPH_PORT=7687
      TUGRAPH_USERNAME=admin
      TUGRAPH_PASSWORD=xxx
      • 使用知识图谱创建知识空间
      • 构建成功后显示知识图谱关系
      • 使用知识图谱进行问答
      更多教程:https://docs.dbgpt.site/docs/latest/cookbook/rag/graph_rag_app_develop

      🌟 DB-GPT  支持 ollama 部署本地模型服务
      使用步骤:
      1. 安装 ollama https://ollama.com/
      2. 拉取模型
        ollama pull qwen:0.5b
        3. 拉取 embedding 模型
          ollama pull nomic-embed-text
          4. 安装 python-ollama
            pip install ollama
            5. 在 .env 
            配置环境
              LLM_MODEL=ollama_proxyllm
              PROXY_SERVER_URL=http://127.0.0.1:11434
              PROXYLLM_BACKEND="qwen:0.5b"
              PROXY_API_KEY=not_used
              EMBEDDING_MODEL=proxy_ollama
              proxy_ollama_proxy_server_url=http://127.0.0.1:11434
              proxy_ollama_proxy_backend="nomic-embed-text:latest"
              6. 启动服务
                python dbgpt/app/dbgpt_server.py

                🌟 Agent 模块重构
                • Agent 核心模块重构
                  • 根据论文 《A survey on large language model based autonomous agents》 [1] 将 Agent 模块代码重构为四个核心模块



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

                🌟 ChatKnowledge
                支持 rerank
                模型,同时支持将 rerank
                模型发布成服务

                下载模型并在在.env
                文件设置模型参数并重启服务
                  ## Rerank model
                  RERANK_MODEL=bge-reranker-base
                  ## If you not set RERANK_MODEL_PATH, DB-GPT will read the model path from EMBEDDING_MODEL_CONFIG based on the RERANK_MODEL.
                  # RERANK_MODEL_PATH=
                  ## The number of rerank results to return
                  RERANK_TOP_K=3
                  将 rerank 模型发布成服务
                    dbgpt start controller --port 8000


                    dbgpt start worker --worker_type text2vec \
                    --rerank \
                    --model_path app/models/bge-reranker-base \
                    --model_name bge-reranker-base \
                    --port 8004 \
                    --controller_addr http://127.0.0.1:8000

                    🌟 支持 Qwen110b

                    🌟  支持 DeepSeek proxy LLM
                    使用步骤:
                    1.修改.env
                    模型配置
                      LLM_MODEL=deepseek_proxyllm
                      DEEPSEEK_MODEL_VERSION=deepseek-chat
                      DEEPSEEK_API_BASE=https://api.deepseek.com/v1
                      DEEPSEEK_API_KEY={your-deepseek-api-key}
                      2. 创建test_proxyllm.py
                      并使用DeepseekLLMClient
                        import asyncio
                        from dbgpt.core import ModelRequest
                        from dbgpt.model.proxy import DeepseekLLMClient
                        # You should set DEEPSEEK_API_KEY to your environment variables
                        client = DeepseekLLMClient()
                        print(asyncio.run(client.generate(ModelRequest._build("deepseek-chat", "你是谁?"))))
                        3. 运行
                          DEEPSEEK_API_KEY={your-deepseek-api-key} 
                          python test_proxyllm.py


                          🌟  支持 Yi-1.5 LLM
                          修改.env
                          文件
                            # [Yi-1.5-34B-Chat](https://huggingface.co/01-ai/Yi-1.5-34B-Chat)
                            LLM_MODEL=yi-1.5-6b-chat
                            # [Yi-1.5-9B-Chat](https://huggingface.co/01-ai/Yi-1.5-9B-Chat)
                            LLM_MODEL=yi-1.5-9b-chat
                            # [Yi-1.5-6B-Chat](https://huggingface.co/01-ai/Yi-1.5-6B-Chat)
                            LLM_MODEL=yi-1.5-34b-chat

                            🌟 重构Chroma
                            向量数据库模块
                            🌟 支持Elasticsearch
                            作为向量数据库
                            🌟  ChatKnowledge
                            支持 Excel



                             Bug 修复 



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



                             致谢 



                            感谢所有贡献者使这次发布成为可能! 
                            @Aries-ckt, @FOkvj, @GITHUBear, @IamWWT, @JamesBonddu, @fangyinc, @fanzhidongyzby, @ivanzhu109, @jsRuner and @yyhhyyyyyy

                            引用链接

                            [1]
                             《A survey on large language model based autonomous agents》 : https://link.springer.com/article/10.1007/s11704-024-40231-1



                            附录
                            01
                             DB-GPT 框架
                            https://github.com/eosphoros-ai/DB-GPT
                            02
                            Text2SQL 微调
                            https://github.com/eosphoros-ai/DB-GPT-Hub
                            03
                             DB-GPT 前端可视化项目
                            https://github.com/eosphoros-ai/DB-GPT-Web
                            04
                             DB-GPT 插件仓库
                            https://github.com/eosphoros-ai/DB-GPT-Plugins
                            05
                             Text2SQL学习资料和前沿跟踪
                            https://github.com/eosphoros-ai/Awesome-Text2SQL
                            06
                             中文官方文档
                            https://www.yuque.com/eosphoros/dbgpt-docs/bex30nsv60ru0fmx
                            07
                             英文官方文档
                            http://docs.dbgpt.site/docs/overview

                            文章转载自EosphorosAI,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

                            评论