一个快速、低成本、高效的Fast GraphRAG

Fast GraphRAG:一个为可解释、高精度、Agent驱动的检索工作流程设计的简化且可提示的快速GraphRAG框架。

图片

Fast GraphRAG 特征:

  • 可解释和可调试的知识:图表提供了可查询、可视化和更新的知识的人类可导航视图。

  • 快速、低成本、高效:设计用于大规模运行而不需要大量资源或成本要求。

  • 动态数据:自动生成和优化图表以最适合您的领域和本体需求。

  • 增量更新:支持数据变化时的实时更新。

  • 智能探索:利用基于 PageRank 的图形探索来提高准确性和可靠性。

  • 异步和类型化:完全异步,并具有完整的类型支持,以实现强大且可预测的工作流程。

Fast GraphRAG 旨在无缝融入你的检索管道,提供高级 RAG 的强大功能,而无需构建和设计Agent工作流程的开销。

开始使用 Fast GraphRAG 的最快、最可靠的方法是使用Circlemind的托管服务。

图片

Fast GraphRAG 使用指南

##设置key

export OPENAI_API_KEY="sk-..."

##数据准备,下载查尔斯·狄更斯的《圣诞颂歌》:

curl https://raw.githubusercontent.com/circlemind-ai/fast-graphrag/refs/heads/main/mock_data.txt > ./book.tx

##使用下面的 Python 代码片段:

from fast_graphrag import GraphRAG
DOMAIN = "Analyze this story and identify the characters. Focus on how they interact with each other, the locations they explore, and their relationships."
EXAMPLE_QUERIES = [    "What is the significance of Christmas Eve in A Christmas Carol?",    "How does the setting of Victorian London contribute to the story's themes?",    "Describe the chain of events that leads to Scrooge's transformation.",    "How does Dickens use the different spirits (Past, Present, and Future) to guide Scrooge?",    "Why does Dickens choose to divide the story into \"staves\" rather than chapters?"]
ENTITY_TYPES = ["Character", "Animal", "Place", "Object", "Activty", "Event"]
grag = GraphRAG(    working_dir="./book_example",    domain=DOMAIN,    example_queries="\n".join(EXAMPLE_QUERIES),    entity_types=ENTITY_TYPES)
with open("./book.txt") as f:    grag.insert(f.read())
print(grag.query("Who is Scrooge?").response)
https://github.com/circlemind-ai/fast-graphrag

来源 | PaperAgent

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值