Skip to content
Skip to lesson
Back to Topics
LearnAdvanced Agents & RetrievalGraphRAG & Knowledge Graphs
HardRAG & Retrieval12 min read

GraphRAG & Knowledge Graphs

Top-k vector search answers single-document lookups well, yet misses multi-hop dependencies and corpus-wide themes. Build entity graphs, Leiden communities, and local/global GraphRAG retrieval.

On this page

Imagine an AI systems archive holding 10,000 research notes, model-serving specs, and architecture records. Ask standard vector search, "What block size does PagedAttention use in our serving config?", and top-5 similarity returns the exact paragraph in milliseconds. Now ask, "What are the dominant architectural bottlenecks limiting throughput across our inference stack?" Top-5 similarity pulls five near-duplicate notes on KV-cache fragmentation and misses kernel memory bandwidth, batch scheduling, and quantization trade-offs spread across the corpus.

The previous chapter showed how query rewriting, HyDE, Self-RAG, and CRAG sharpen single-query . upgrades the index itself.[1][2] Alongside chunk , it extracts typed entities and relationships into a property graph, clusters dense subgraphs into hierarchical communities, and summarizes those communities into reports.[3][4] That offline structure unlocks multi-hop traversals across separate documents and corpus-wide thematic synthesis.

Why small top-k vector search hits a ceiling

Vector similarity excels on local lookups whose answer sits in a handful of nearby chunks. It stalls on two other query shapes:

  1. Global sensemaking queries ask about patterns across thousands of documents. Near-duplicate passages crowd the window, while simply raising k inflates prompt tokens and triggers mid-context attention drops ("lost in the middle").[5]
  2. Multi-hop entity queries link separate documents through an intermediate entity the question never named.

GraphRAG shifts clustering and summarization offline during indexing, storing four linked artifacts: source text units, extracted entities, directed relationships, and hierarchical community reports.[1]

Left: Local search ranks mixed graph and text candidates for one entity question and packs a 30-token relationship (score 0.98) and a 55-token text unit (score 0.91) into an 85-of-90-token budget bar while skipping an 80-token community report that overflows the 90-token cap. Right: Global search fans out community reports into parallel batches A (cache, queue) and B (eval, config), maps each batch to rated points, and reduces them into corpus-wide findings.
Local search packs top-scoring graph and text records into a fixed token budget (85 of 90 tokens). Global search maps community report batches in parallel and reduces rated points into a corpus-wide answer.

Multi-hop retrieval and property graphs

Consider three architecture records from a model-serving knowledge base:

  • Record 1842: inference-api depends on Redis Cache for embedding lookups; evictions climbed alongside p95 latency during benchmark 2026.06.14.
  • Record 2031: Redis Cache in us-east-1 still runs Old Maxmemory Policy, whose migration waits on a client compatibility test.
  • Record 3155: inference-api exceeded its latency target twelve minutes after rollout; rolling back restored baseline latency.

Because Record 2031 never mentions inference-api or latency, lexical or narrow top-2 search fetches Records 3155 and 1842 and misses Record 2031. Adding source-cited directed edges (inference-api -[depends_on]-> Redis Cache -[uses_policy]-> Old Maxmemory Policy) lets a two-hop walk pull Record 2031 directly into context.

For the query inference-api latency SLO, lexical top-2 retrieval scores 3 matching terms in Record 3155, 2 in Record 1842, and 0 in Record 2031, selecting 3155 and 1842 for 2/3 recall. On the right, following the directed graph path inference-api to Redis Cache (source 1842) to Old Maxmemory Policy (source 2031) recovers Record 2031 and lifts evidence recall from 2/3 to 3/3.
Lexical top-2 retrieves Records 3155 and 1842 (2/3 recall). Following inference-api -> Redis Cache -> Old Maxmemory Policy recovers Record 2031 (3/3 recall).

A property graph stores triples (Subject) -[Predicate]-> (Object) with typed attributes (type, description, weight, source_chunk_ids). Always identify entities by (canonical_title, canonical_type) within a workspace scope rather than title alone: Compiler:Triton (the GPU kernel DSL) and Server:Triton (the inference runtime) must never merge into one node.

Keep graph traversal distinct from . Standard GraphRAG walks stored edges and summarizes communities without training a neural graph model. A GNN or learns embeddings by aggregating neighbor vectors across layers to predict node labels or missing links.[6][7] Treat any GNN-predicted edge as a hypothesis until anchored to source text.

Phase 1: Building the GraphRAG index

Microsoft's GraphRAG pipeline turns raw chunks into entities, relationships, hierarchical communities, and community reports.[3][4]

Step 1: Typed entity resolution, lineage, and local context packing

Top: two source records extract separate triples, with Record 1842 linking inference-api to Redis Cache and Record 2031 linking Redis Cache to Old Maxmemory Policy. Middle: entity resolution merges both Redis Cache mentions under one typed node (Redis Cache, Datastore) and unions their source IDs (1842, 2031). Bottom: the resolved directed property graph connects inference-api (Service) via depends_on (source 1842) through Redis Cache (Datastore) via uses_policy (source 2031) to Old Maxmemory Policy (ConfigPolicy).
Entity resolution merges mentions of Redis Cache across Records 1842 and 2031 under one typed node while keeping each edge anchored to its source record.

For each text unit, an LLM using (or an NLP extractor in lighter variants[8]) proposes typed entities and directed edges. merges duplicates sharing (canonical_title, canonical_type) plus curated aliases and unions their source_chunk_ids.[1][9]

At query time, Local Search maps the question to seed entities, expands their kk-hop neighborhood, verifies every hop carries valid source chunks, and packs the highest-scoring entities, edges, reports, and text units into the prompt's .[10] The script below resolves an ML systems graph, rejects an ambiguous untyped Triton edge, expands two hops from vLLM, and packs candidates into a 90-token budget:

typed-entity-graph-and-local-packer.py

def norm(s: str) -> str:
    return " ".join(s.casefold().split())

def build_graph(entities: list[Entity], edges: list[Edge]) -> tuple[dict, dict]:
    nodes: dict[tuple[str, str], Entity] = {}
    by_name: dict[str, list[tuple[str, str]]] = defaultdict(list)
    for e in entities:
        key = (norm(e.name), norm(e.type))
        if key not in nodes:
            nodes[key] = Entity(e.name, e.type, sorted(set(e.sources)))
            by_name[key[0]].append(key)
        else:
            nodes[key].sources = sorted(set(nodes[key].sources + e.sources))

    def resolve(name: str, etype: str) -> tuple[str, str]:
        if etype:
            key = (norm(name), norm(etype))
            if key in nodes:
                return key
            raise ValueError(f"unknown entity: {name!r} ({etype})")
        matches = by_name.get(norm(name), [])
        if len(matches) != 1:
            raise ValueError(f"ambiguous untyped entity: {name!r} -> {matches}")
        return matches[0]

    adj: dict[tuple[str, str], list[tuple[tuple[str, str], str, tuple[str, ...]]]] = defaultdict(list)
    for ed in edges:
        if not ed.sources:
            raise ValueError(f"uncited edge: {ed.src} -[{ed.rel}]-> {ed.dst}")
        adj[resolve(ed.src, ed.src_type)].append((resolve(ed.dst, ed.dst_type), ed.rel, ed.sources))
    return nodes, dict(adj)

def expand_hops(adj: dict, seed: tuple[str, str], hops: int = 2) -> list[tuple[str, str]]:
    visited, frontier = {seed}, {seed}
    for _ in range(hops):
        nxt = {v for u in frontier for v, _, _ in adj.get(u, [])} | {
            u for u, es in adj.items() if any(v in frontier for v, _, _ in es)
        }
        frontier = nxt - visited
        visited |= frontier
    return sorted(visited)

def pack_context(candidates: list[Candidate], budget: int) -> list[Candidate]:
    selected, used = [], 0
    for idx in np.argsort([-c.score for c in candidates]):
        item = candidates[int(idx)]
        if used + item.tokens <= budget:
            selected.append(item)
            used += item.tokens
    return selected
Output
HBM sources: ['paper-dao22', 'paper-kwon23']
2-hop vLLM:  ['HBM', 'PagedAttention', 'vLLM']
rejected:    ambiguous untyped entity: 'Triton' -> [('triton', 'compiler'), ('triton', 'server')]
packed:      [('vLLM->PagedAttention', 'paper-kwon23'), ('block-table KV text', 'paper-kwon23')]

Step 2: Community detection with the Leiden algorithm

Single-entity hops cannot summarize an entire corpus. GraphRAG projects the entity graph into an undirected weighted graph and runs hierarchical Leiden clustering.[11][12]

Older Louvain clustering moves individual nodes to maximize modularity, which can detach a bridge node and leave a community internally disconnected. Leiden adds a refinement phase before aggregation so every community remains internally connected.[11] Microsoft's GraphRAG wrapper optimizes Newman modularity QQ (resolution 1.01.0), measuring excess internal edge density over a degree-preserving random null model:[13]

Q=12m∑i,j[Aij−kikj2m]δ(ci,cj)Q = \frac{1}{2m} \sum_{i,j} \left[ A_{ij} - \frac{k_i k_j}{2m} \right] \delta(c_i, c_j)

Here Aij∈{0,1}A_{ij} \in \{0, 1\} is the adjacency matrix, kik_i and kjk_j are node degrees, mm is the undirected edge count, and δ(ci,cj)=1\delta(c_i, c_j) = 1 when nodes ii and jj share a community. Putting all nodes in one community yields Q=0Q = 0; isolating dense clusters raises QQ:

leiden-modularity-and-refinement.py
from collections import defaultdict, deque

def build_adj(nodes: list[str], edges: list[tuple[str, str]]) -> dict[str, set[str]]:
    adj = {n: set() for n in nodes}
    for u, v in edges:
        adj[u].add(v)
        adj[v].add(u)
    return adj

def modularity(nodes: list[str], adj: dict[str, set[str]], m: int, comm: dict[str, str]) -> float:
    two_m = 2 * m
    total = sum(
        (1.0 if j in adj[i] else 0.0) - (len(adj[i]) * len(adj[j])) / two_m
        for i in nodes for j in nodes if comm[i] == comm[j]
    )
    return total / two_m

def refine_connected(adj: dict[str, set[str]], comm: dict[str, str]) -> dict[str, str]:
    """Ensure every community is internally connected (Leiden connectivity invariant)."""
    by_comm: dict[str, set[str]] = defaultdict(set)
    for node, cid in comm.items():
        by_comm[cid].add(node)
    refined: dict[str, str] = {}
    for cid, members in by_comm.items():
        unseen, part = set(members), 0
        while unseen:
            seed = min(unseen)
            unseen.remove(seed)
            q, label = deque([seed]), (f"{cid}_{part}" if part else cid)
            while q:
                cur = q.popleft()
                refined[cur] = label
                for nxt in adj[cur] & unseen:
                    unseen.remove(nxt)
                    q.append(nxt)
            part += 1
    return refined

nodes = ["FlashAttention", "Triton", "SRAM", "vLLM", "PagedAttention", "KV-Cache", "LoRA", "QLoRA", "NF4"]
edges = [
    ("FlashAttention", "Triton"), ("FlashAttention", "SRAM"), ("Triton", "SRAM"),
    ("vLLM", "PagedAttention"), ("vLLM", "KV-Cache"), ("PagedAttention", "KV-Cache"),
    ("LoRA", "QLoRA"), ("QLoRA", "NF4"), ("LoRA", "NF4"),
    ("FlashAttention", "vLLM"),
]
adj = build_adj(nodes, edges)
comm = {n: n for n in nodes}
improved = True
while improved:
    improved, best_q = False, modularity(nodes, adj, len(edges), comm)
    for node in nodes:
        best_c = comm[node]
        for cand in sorted({comm[nbr] for nbr in adj[node]}):
            comm[node] = cand
            q = modularity(nodes, adj, len(edges), comm)
            if q > best_q + 1e-9:
                best_q, best_c, improved = q, cand, True
        comm[node] = best_c

refined = refine_connected(adj, comm)
groups: dict[str, list[str]] = defaultdict(list)
for node, cid in refined.items():
    groups[cid].append(node)

print("all-in-one Q:", round(modularity(nodes, adj, len(edges), {n: "all" for n in nodes}), 3))
print("optimized Q: ", round(modularity(nodes, adj, len(edges), refined), 3))
for cid, members in sorted(groups.items()):
    print(f"community {cid}: {sorted(members)}")
Output
all-in-one Q: -0.0
optimized Q:  0.565
community KV-Cache: ['KV-Cache', 'PagedAttention', 'vLLM']
community NF4: ['LoRA', 'NF4', 'QLoRA']
community SRAM: ['FlashAttention', 'SRAM', 'Triton']

Hierarchical Leiden subdivides large communities recursively into a forest of nested themes (Level 0 holds broad communities; deeper levels hold finer sub-communities; Edge et al. report 34 Level-0 communities on their podcast corpus and 55 on their news corpus).[1][4]

Top: dynamic community selection scores Level-0 roots against a 0.5 relevance threshold. Serving scores 0.9 and opens its children Cache (0.8) and Queue (0.7), both passing. Eval scores 0.1 and prunes its branch, leaving Judges and Metrics unrated. Bottom: in a counterfactual where Serving scores 0.2 (below 0.5), its branch is pruned and Cache (0.8) stays hidden and unrated.
Dynamic community selection scores roots first. Serving (0.9) passes 0.5 and opens Cache and Queue; Eval (0.1) prunes its branch. A false negative on Serving (0.2) hides Cache (0.8) below it.

Step 3: Community reports and authorization continuity

For every community, an LLM writes a structured Community Report (title, executive summary, key findings citing entity/edge IDs, and a 0-10 impact rating).[14]

Compressing dozens of chunks into one report introduces an indirect leakage hazard whenever documents carry . If one community report summarizes two all-staff notes alongside one security-only note, showing that report to a regular reader exposes the restricted fact even when chunk-level vector search filtered out the restricted chunk.

Three production patterns enforce ACL continuity: equivalence-class partitioning (separate graphs per homogeneous permission scope), query-time dynamic summarization over authorized chunks (as in LazyGraphRAG), or drop with local fallback (exclude mixed unauthorized reports and fall back to authorized local entity search). See RAG Security & Access Control for full multi-tenant ACL design.

Phase 2: Global search, dynamic selection, and DRIFT

Global search answers corpus-wide questions via map-reduce over community reports at a chosen level:[1][15][16]

  1. Map: Pack community reports into token-budgeted batches and score each report's relevance to the question in parallel.
  2. Reduce: Sort rated points across all batches, drop zero-relevance items, and synthesize the highest-ranked findings.

The code below builds real TF-IDF vectors over ML-systems community reports, packs token-bounded batches, scores cosine similarity weighted by community size, and reduces the top themes:

global-search-tfidf-map-reduce.py
@dataclass(frozen=True)
class Report:
    id: str
    title: str
    summary: str
    entities: int
    tokens: int

def tokenize(text: str) -> list[str]:
    return re.findall(r"[a-z0-9]+", text.lower())

def tfidf(docs: list[str]) -> tuple[np.ndarray, dict[str, int], np.ndarray]:
    toks = [tokenize(d) for d in docs]
    vocab = {t: i for i, t in enumerate(sorted({w for d in toks for w in d}))}
    df = np.zeros(len(vocab))
    for d in toks:
        for t in set(d):
            df[vocab[t]] += 1.0
    idf = np.log((1.0 + len(docs)) / (1.0 + df)) + 1.0
    mat = np.zeros((len(docs), len(vocab)))
    for r, d in enumerate(toks):
        for t in d:
            mat[r, vocab[t]] += 1.0
        if d:
            mat[r] = (mat[r] / len(d)) * idf
            norm = float(np.linalg.norm(mat[r]))
            if norm > 0:
                mat[r] /= norm
    return mat, vocab, idf

def global_map_reduce(query: str, reports: list[Report], batch_tokens: int = 80, top_k: int = 3) -> list[tuple[float, Report]]:
    mat, vocab, idf = tfidf([f"{r.title} {r.summary}" for r in reports])
    q_vec = np.zeros(len(vocab))
    q_toks = tokenize(query)
    for t in q_toks:
        if t in vocab:
            q_vec[vocab[t]] += 1.0
    if q_toks and np.linalg.norm(q_vec) > 0:
        q_vec = (q_vec / len(q_toks)) * idf
        q_vec /= float(np.linalg.norm(q_vec))

    # Pack into token-bounded batches, map similarity + log community size, then reduce.
    batches, cur, used = [], [], 0
    for idx, rep in enumerate(reports):
        if cur and used + rep.tokens > batch_tokens:
            batches.append(cur)
            cur, used = [], 0
        cur.append((idx, rep))
        used += rep.tokens
    if cur:
        batches.append(cur)

    mapped = []
    for batch in batches:
        for idx, rep in batch:
            sim = float(np.dot(mat[idx], q_vec))
            if sim > 0.0:
                mapped.append((sim * (1.0 + 0.15 * math.log1p(rep.entities)), rep))
    return sorted(mapped, key=lambda pair: pair[0], reverse=True)[:top_k]

reports = [
    Report("c-kernels", "Attention Kernels", "FlashAttention tiles softmax in SRAM to cut GPU HBM memory bandwidth traffic.", 14, 38),
    Report("c-serving", "Serving Engines", "vLLM uses PagedAttention block tables to eliminate KV cache memory fragmentation and raise throughput.", 19, 42),
    Report("c-quant", "Weight Quantization", "AWQ and FP8 compress weights to reduce GPU memory footprint and speed up decode throughput.", 12, 36),
    Report("c-align", "Preference Alignment", "DPO and RLHF optimize helpfulness and refusal boundaries using human preference pairs.", 16, 35),
]
query = "How do serving engines and kernels cut GPU memory bottlenecks to improve throughput?"
for score, rep in global_map_reduce(query, reports):
    print(f"[{rep.id}] score={score:.3f} | {rep.title}: {rep.summary}")
Output
[c-serving] score=0.589 | Serving Engines: vLLM uses PagedAttention block tables to eliminate KV cache memory fragmentation and raise throughput.
[c-kernels] score=0.539 | Attention Kernels: FlashAttention tiles softmax in SRAM to cut GPU HBM memory bandwidth traffic.
[c-quant] score=0.408 | Weight Quantization: AWQ and FP8 compress weights to reduce GPU memory footprint and speed up decode throughput.

Mapping every Level-1 or Level-2 report gets pricey on large graphs. Dynamic community selection rates Level-0 roots first and expands only branches clearing a relevance cutoff (cutting AP News token cost by 77% vs. static Level-1 at comparable judge ratings, while descending to Level 3 on deeper queries added 34% cost for a 58.8% comprehensiveness win rate).[17][18] Its risk is a parent false negative, where a low root score hides a relevant child:

dynamic-community-pruning.py
children = {"serving": ["cache", "queue"], "eval": ["judges", "metrics"]}

def select_leaves(scores: dict[str, float], cutoff: float = 0.5) -> tuple[list[str], list[str]]:
    visited, selected = [], []

    def visit(node: str) -> None:
        visited.append(node)
        if scores[node] < cutoff:
            return
        kids = children.get(node, [])
        if not kids:
            selected.append(node)
        for c in kids:
            visit(c)

    for root in ("serving", "eval"):
        visit(root)
    return visited, selected

scores = {"serving": 0.9, "eval": 0.1, "cache": 0.8, "queue": 0.7}
print("normal pass:          ", select_leaves(scores))
print("parent false negative:", select_leaves({**scores, "serving": 0.2}))
Output
normal pass:           (['serving', 'cache', 'queue', 'eval'], ['cache', 'queue'])
parent false negative: (['serving', 'eval'], [])

DRIFT (Dynamic Reasoning and Inference with Flexible Traversal) combines both modes: it primes context with matched community reports, asks follow-up questions to close entity gaps, runs local searches for those follow-ups, and synthesizes the resulting tree.[19]

Hybrid routing, lighter variants, and failure modes

LLM extraction and report generation drive roughly 75% of standard GraphRAG indexing cost.[8][20] Keep hybrid vector/BM25 for direct lookups and choose the lightest graph variant that fits your query rate and corpus churn:

ArchitectureIndexing workQuery-time evidenceBest fit
Vector RAGEmbeddings (+ BM25)Top-k chunksFast fact lookups, high-churn corpora
GraphRAGLLM extraction + Leiden + reportsBasic, Local, Global, DRIFTHigh-volume themes on a stable corpus
FastGraphRAGNLP noun-phrase graph + LLM reports[8]Community reports + graphGlobal synthesis on a tighter budget
LazyGraphRAGNLP concept graph (~0.1% cost)[21]Budgeted relevance testsInfrequent global queries, high churn
LightRAGLLM entity/edge profiles[22]Entity + relationship searchIncremental updates without report rebuilds

On AP News (100 queries, 5,590 articles), low-budget LazyGraphRAG matched Global Search quality at >700x lower query cost, while a higher budget (~4% of Level-2 Global cost) beat baselines on both local and global criteria.[21] Start with Parquet tables rather than a dedicated graph database, adding Neo4j or Neptune only for live cross-service traversals.[9] Incremental updates merge new nodes cleanly, whereas deletions must remove edges supported solely by the removed document and rebuild affected reports.[23]

Watch six failure modes: stuffing 100K- prompts (mid-context attention drops[5]); routing direct lookups to GraphRAG instead of vector/BM25; skipping typed entity resolution (FlashAttention vs. flash-attn); unconstrained noun extraction creating generic super-hubs; unbudgeted full-corpus builds (benchmark on a 1% sample first); and stale report lineage failing to invalidate summaries after edits or ACL revocations.

Check your understanding

Mastery Check

Check each question as you go, or answer all of them and check together. Score 75% or higher to complete this lesson.

0 of 5 answered
1.Top-k vector search returns six near-duplicate passages on KV-cache fragmentation and misses kernel bandwidth and quantization. How should an analyst summarize corpus-wide themes and find which bottleneck appears in the most documents?
2.Two disconnected triangles form a simple undirected graph with m = 6 edges. Each triangle is one community with e = 3 internal edges and degree sum K = 6. What is the modularity Q = sum[e/m - (K/(2m))^2]?
3.A local search has 96 tokens for context. Ordered highest score to lowest, four items cost 54, 60, 28, and 20 tokens. Which items does a greedy packer select, and how many tokens remain?
4.A dynamic community selector expands a parent only when relevance >= 0.6. Root A scores 0.4 (child C is 0.9); Root B scores 0.7 (leaf D is 0.8). Which leaves are selected?
5.A caller may read P1 and P2 but not restricted source R7. Report 1 summarizes P1, P2, and R7; Report 2 summarizes only P1 and P2. What may enter global map-reduce?

5 questions remaining.

References

From Local to Global: A Graph RAG Approach to Query-Focused Summarization.

Edge, D., et al. · 2024 · arXiv preprint

https://arxiv.org/abs/2404.16130

Unifying Large Language Models and Knowledge Graphs: A Roadmap.

Pan, S., et al. · 2024 · arXiv preprint

https://arxiv.org/abs/2306.08302

GraphRAG Indexing Overview

Microsoft GraphRAG Documentation · 2025

https://microsoft.github.io/graphrag/index/overview/

GraphRAG Default Dataflow

Microsoft GraphRAG Documentation · 2025

https://microsoft.github.io/graphrag/index/default_dataflow/

Lost in the Middle: How Language Models Use Long Contexts

Liu, N.F., et al. · 2024 · TACL 2024

https://aclanthology.org/2024.tacl-1.9/

Semi-Supervised Classification with Graph Convolutional Networks

Kipf, T. N. & Welling, M. · 2016 · ICLR 2017

https://arxiv.org/abs/1609.02907

Neural Message Passing for Quantum Chemistry

Gilmer, J., Schoenholz, S. S., Riley, P. F., Vinyals, O., & Dahl, G. E. · 2017 · ICML 2017

https://arxiv.org/abs/1704.01212

GraphRAG Indexing Methods

Microsoft GraphRAG Documentation · 2025

https://microsoft.github.io/graphrag/index/methods/

GraphRAG Outputs

Microsoft GraphRAG Documentation · 2025

https://microsoft.github.io/graphrag/index/outputs/

GraphRAG Local Search

Microsoft GraphRAG Documentation · 2025

https://microsoft.github.io/graphrag/query/local_search/

From Louvain to Leiden: guaranteeing well-connected communities.

Traag, V.A., Waltman, L., & van Eck, N.J. · 2019 · Scientific Reports

https://arxiv.org/abs/1810.08473

GraphRAG: Undirected Weighted Clustering Input

Microsoft GraphRAG Contributors · 2026

https://github.com/microsoft/graphrag/blob/82b87bf0434fc69f857663280e2c36a1c48e52fe/packages/graphrag/graphrag/index/operations/cluster_graph.py

GraphRAG: Hierarchical Leiden Objective Configuration

Microsoft GraphRAG Contributors · 2026

https://github.com/microsoft/graphrag/blob/82b87bf0434fc69f857663280e2c36a1c48e52fe/packages/graphrag/graphrag/graphs/hierarchical_leiden.py

GraphRAG: Default Community Report Prompt

Microsoft GraphRAG Contributors · 2026

https://github.com/microsoft/graphrag/blob/82b87bf0434fc69f857663280e2c36a1c48e52fe/packages/graphrag/graphrag/prompts/index/community_report.py

GraphRAG Global Search

Microsoft GraphRAG Documentation · 2025

https://microsoft.github.io/graphrag/query/global_search/

GraphRAG: Global Search Report Context Builder

Microsoft GraphRAG Contributors · 2026

https://github.com/microsoft/graphrag/blob/82b87bf0434fc69f857663280e2c36a1c48e52fe/packages/graphrag/graphrag/query/structured_search/global_search/community_context.py

GraphRAG: Improving global search via dynamic community selection.

Li, B., Trinh, H., Edge, D., & Larson, J. · 2024 · Microsoft Research Blog

https://www.microsoft.com/en-us/research/blog/graphrag-improving-global-search-via-dynamic-community-selection/

GraphRAG: Dynamic Community Selection

Microsoft GraphRAG Contributors · 2026

https://github.com/microsoft/graphrag/blob/82b87bf0434fc69f857663280e2c36a1c48e52fe/packages/graphrag/graphrag/query/context_builder/dynamic_community_selection.py

GraphRAG DRIFT Search

Microsoft GraphRAG Documentation · 2025

https://microsoft.github.io/graphrag/query/drift_search/

GraphRAG Getting Started

Microsoft GraphRAG Documentation · 2025

https://microsoft.github.io/graphrag/get_started/

LazyGraphRAG: Setting a New Standard for Quality and Cost

Larson, J. & Truitt, S. (Microsoft Research) · 2024

https://www.microsoft.com/en-us/research/blog/lazygraphrag-setting-a-new-standard-for-quality-and-cost/

LightRAG: Simple and Fast Retrieval-Augmented Generation

Guo, Z., Xia, L., Yu, Y., Ao, T., & Huang, C. · 2024

https://arxiv.org/abs/2410.05779

GraphRAG CLI Reference

Microsoft GraphRAG Documentation · 2025

https://microsoft.github.io/graphrag/cli/

Discussion

Questions and insights from fellow learners.

Discussion loads when you reach this section.