介绍
不同于传统的Native RAG需要向量作为数据承载,GraphRAG需要进行三元组抽取(entity -> relation ->entity)来建立知识图谱,因此整个知识加工也可以看作是知识图谱的构建过程。
适用场景
- 需要利用GraphRAG能力挖掘知识之间关系进行多步推理。
- 弥补Naive RAG在召回上下文信息完整性不足的问题。
如何使用
- 进入AWEL界面并新增工作流
- 导入知识加工模版
- 调整参数并保存
- `文档知识加载算子`: 知识加载工厂,通过加载指定的文档类型,找到对应的文档处理器进行文档内容解析。
- `文档Chunk切片算子`:将加载好的文档内容按照指定的切片参数进行切片处理。
- `知识图谱加工算子`:可以连接不同的知识图谱加工算子,包括原生知识图谱加工算子,社区总结知识图谱加工算子等,同时可以指定不同的图数据库进行存储,目前支持TuGraph数据库。
* <font style="color:#DF2A3F;">注意:</font>需要先安装图数据库环境 参考:[Graph RAG User Manual | DB-GPT](http://docs.dbgpt.cn/docs/cookbook/rag/graph_rag_app_develop)
- 注册发布为http请求
curl --location --request POST 'http://localhost:5670/api/v1/awel/trigger/rag/knowledge/kg/process' \
--header 'Content-Type: application/json' \
--data-raw '{}'
[
{
"content": "\"What is AWEL?\": Agentic Workflow Expression Language(AWEL) is a set of intelligent agent workflow expression language specially designed for large model application\ndevelopment. It provides great functionality and flexibility. Through the AWEL API, you can focus on the development of business logic for LLMs applications\nwithout paying attention to cumbersome model and environment details. \nAWEL adopts a layered API design. AWEL's layered API design architecture is shown in the figure below. \n<p align=\"left\">\n<img src={'/img/awel.png'} width=\"480px\"/>\n</p>",
"metadata": {
"Header1": "What is AWEL?",
"source": "../../docs/docs/awel/awel.md"
},
"chunk_id": "c1ffa671-76d0-4c7a-b2dd-0b08dfd37712",
"chunk_name": "",
"score": 0.0,
"summary": "",
"separator": "\n",
"retriever": null
},...
]