explaingit

microsoft/graphrag

📈 Trending33,075PythonAudience · developerComplexity · 4/5ActiveLicenseSetup · moderate

TLDR

Python framework that builds knowledge graphs from documents to answer questions that require understanding how information relates across a large corpus, rather than just finding similar text chunks.

Mindmap

mindmap
  root((GraphRAG))
    What it does
      Builds knowledge graphs
      Extracts entities and relationships
      Organizes into communities
    Query modes
      Local search
      Global search
    Use cases
      Legal documents
      Research papers
      Internal knowledge bases
    Tech stack
      Python
      Azure OpenAI
      LLM providers
    When to use
      Complex relational data
      Multi-document questions
      Large private corpora

Things people build with this

USE CASE 1

Query large legal document collections to find answers that span multiple contracts or regulations.

USE CASE 2

Search research paper repositories to understand how concepts and findings relate across studies.

USE CASE 3

Build internal knowledge bases where questions require connecting information from multiple departments or documents.

Tech stack

PythonAzure OpenAILanguage Models

Getting it running

Difficulty · moderate Time to first run · 30min

Requires Azure OpenAI API key and credentials to be configured before running examples.

Use freely for any purpose including commercial, as long as you keep the copyright notice.

In plain English

GraphRAG is a Python framework from Microsoft Research that uses knowledge graphs to improve retrieval-augmented generation (RAG) systems. Traditional RAG pipelines retrieve relevant text chunks from a document corpus based on similarity to a query and pass them to a language model. GraphRAG extends this by first building a knowledge graph from the source documents, extracting entities, relationships, and hierarchical community summaries, and then using that structured graph to retrieve information at query time. The key advantage is in handling questions that require understanding how different pieces of information relate to each other across a large corpus, rather than just finding the single most similar passage. Because the graph captures entity relationships and organizes content into communities at multiple levels of granularity, it can answer global questions about the dataset that simple vector search would struggle with. The framework supports two query modes: local search, which finds precise answers about specific entities, and global search, which reasons across the full dataset using the hierarchical community summaries built during indexing. The indexing pipeline processes documents through an extraction stage that identifies entities and relationships using a language model, then organizes these into a community hierarchy. At query time, the system uses this pre-built structure rather than raw text alone. When to use it: GraphRAG is suited for organizations that need to query large private document collections where questions often span multiple documents or require understanding how topics connect. It is most powerful when the corpus has complex relational structure, legal documents, research papers, internal knowledge bases, and simple keyword or embedding search produces incomplete answers. The stack is Python, with integration into Azure OpenAI and other LLM providers.

Copy-paste prompts

Prompt 1
How do I set up GraphRAG to index my document collection and start running queries against it?
Prompt 2
Show me how to use local search mode to find specific information about an entity in my knowledge graph.
Prompt 3
How does GraphRAG's global search mode work differently from local search, and when should I use each one?
Prompt 4
What's the process for extracting entities and relationships from my documents using GraphRAG's indexing pipeline?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.