Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Graph RAG 📊

Graph RAG uses knowledge graphs together with large language models (LLMs) to improve how information is retrieved and generated. It overcomes the limits of traditional search methods by using knowledge graphs, which organize data as connected entities and relationships.

One of the main benefits of Graph RAG is its ability to capture and represent complex relationships between entities, something that traditional text-based retrieval systems struggle with. By using this structured knowledge, LLMs can better grasp the context and details of a query, resulting in more accurate and insightful answers.

Official Paper

Official Implementation

Microsoft Research Blog

Default VectorDB

Graph RAG uses LanceDB as the default vector database for performing vector search to retrieve relevant entities.

Working with Graph RAG is quite straightforward

  • Installation and API KEY as env variable

SetOPENAI_API_KEY asGRAPHRAG_API_KEY

pipinstallgraphragexportGRAPHRAG_API_KEY="sk-..."
  • Initial structure for indexing dataset
python3-mgraphrag.index--init--rootdataset-dir
  • Index Dataset
python3-mgraphrag.index--rootdataset-dir
  • Execute Query

Global Query Execution gives a broad overview of dataset:

python3-mgraphrag.query--rootdataset-dir--methodglobal"query-question"

Local Query Execution gives a detailed and specific answers based on the context of the entities:

python3-mgraphrag.query--rootdataset-dir--methodlocal"query-question"

Open In Colab


[8]ページ先頭

©2009-2025 Movatter.jp