GraphRAG

Active
GitHub Python MIT

Description

A modular graph-based Retrieval-Augmented Generation system by Microsoft that uses LLMs to extract structured knowledge graphs from text, enabling global and local community summarization queries.

Key Features

  • Knowledge Graph Construction — Auto-extract entities and relations from unstructured text using LLMs
  • Community Detection & Summarization — Leiden algorithm-based graph community detection with hierarchical summaries
  • Global Queries — Answer cross-document reasoning questions via community summaries
  • Local Queries — Graph-structure retrieval for entity-specific questions with related context
  • Tunable Prompts — Prompt tuning guide for optimizing extraction and query quality on custom datasets
  • Modular Pipeline — Separated indexing, community detection, and query engines for independent scaling

Use Cases

💡 Private Document Q&A — Global reasoning across enterprise contracts, reports, and emails
💡 Research Report Analysis — Extract relationship networks from academic papers, answer cross-literature questions
💡 Legal Compliance Review — Build knowledge graphs from regulations for cross-reference compliance queries
💡 Medical Literature Mining — Extract disease-drug-gene relations from clinical research for drug discovery
💡 Competitive Intelligence — Extract company relationship networks from news and reports

Categories

Quick Start

pip install graphrag
graphrag init --root ./my-project
graphrag index --root ./my-project
graphrag query --root ./my-project --method global --query "What are the main themes?"

Related Projects

Related Articles