Skip to content
  1. Home
  2. AI agents
  3. Knowledge and retrieval
  4. Knowledge graphs and GraphRAG

Build · Knowledge and retrieval

What is GraphRAG, and when does a knowledge graph help an AI agent?

GraphRAG is retrieval that uses a knowledge graph as well as text search. A model extracts entities and the relationships between them from your documents, and the agent answers by following those relationships or, in Microsoft’s version, by reading summaries of related groups. It helps with questions that span many documents.

In this guide: 83 pages

Key takeaways

  1. Plain retrieval answers questions that a few passages can answer. A graph earns its cost on questions about the whole corpus or about chains of relationships, such as which suppliers share a component with a recalled part.
  2. Indexing is the expensive part: Microsoft’s GraphRAG repository warns that indexing can be an expensive operation. Microsoft Research’s LazyGraphRAG defers that work to query time and puts its indexing cost at 0.1% of full GraphRAG.
  3. Extraction quality sets answer quality. Google’s reference architecture warns that a general-purpose graph builder may not suit niche domains such as healthcare or pharmaceuticals, so plan for prompt tuning and expert review.
  4. AWS offers a managed option, Bedrock Knowledge Bases GraphRAG on Neptune Analytics (GA 7 Mar 2025). Google publishes a reference architecture on Spanner Graph, and on Microsoft GraphRAG is an open-source library.
How GraphRAG indexes documents and how an agent queries the graphIndexing runs before any question: documents are split into text units, a model extracts entities, relationships and claims, the graph is clustered into a hierarchy of communities with the Leiden technique, and a summary is written for each community from the bottom up. At query time the agent uses local search, which starts at an entity and fans out to its neighbours; global search, which combines community summaries for questions about the whole corpus; DRIFT search, which is local search with community context; or basic search, which is plain top-k vector retrieval.Indexing, before anyone asksChunkSplit documents intotext unitsExtractA model pulls outentities, relationshipsand claimsClusterGroup the graph intocommunities (Leiden)SummariseOne summary percommunity, bottom upHow the agent queries itLocal searchStart at an entity, fanout to neighboursGlobal searchCombine summaries forwhole-corpus questionsDRIFT searchLocal search withcommunity contextBasic searchPlain top-k vectorretrievalHow GraphRAG indexes documents and how an agent queries the graphIndexing runs before any question: documents are split into text units, a model extracts entities, relationships and claims, the graph is clustered into a hierarchy of communities with the Leiden technique, and a summary is written for each community from the bottom up. At query time the agent uses local search, which starts at an entity and fans out to its neighbours; global search, which combines community summaries for questions about the whole corpus; DRIFT search, which is local search with community context; or basic search, which is plain top-k vector retrieval.Indexing, before anyone asksChunkSplit documents into text unitsExtractA model pulls out entities, relationships and claimsClusterGroup the graph into communities (Leiden)SummariseOne summary per community, bottom upHow the agent queries itLocal searchStart at an entity, fan out to neighboursGlobal searchCombine summaries for whole-corpus questionsDRIFT searchLocal search with community contextBasic searchPlain top-k vector retrieval
Microsoft’s GraphRAG pipeline. Indexing runs before any question and is where the cost sits; the four query modes underneath decide how the agent reads the graph.

How does GraphRAG work?

GraphRAG builds a graph from your documents before anyone asks a question, then uses the graph at query time. Microsoft’s implementation splits the corpus into text units, has a model extract entities, relationships and claims, clusters the graph into a hierarchy of communities with the Leiden technique, and writes a summary for each community from the bottom up.

Queries use the graph in different ways. Local search starts at the entities in the question and fans out to their neighbours, which suits questions about one supplier, product or person. Global search combines community summaries to answer questions about the whole corpus, such as the recurring causes across a year of incident reports, which plain retrieval handles poorly because no single passage holds the answer. DRIFT search adds community context to local search, and basic search is plain top-k vector retrieval for questions that need no graph.

The approach comes from a Microsoft Research paper by Edge and colleagues (arXiv 2404.16130, April 2024) on answering broad questions about a whole corpus. Microsoft released GraphRAG 1.0 on 16 Dec 2024 as open source under the MIT licence. On 2 Nov 2026 its repository describes the project as largely in maintenance mode, with no new features accepted, which matters if you plan to build on it for years.

Managed products take a lighter route to the same idea. Bedrock Knowledge Bases GraphRAG starts with a vector search, follows graph links from the retrieved chunks to related chunks stored in Amazon Neptune Analytics, and adds them to the context. Google’s reference architecture keeps the graph and the embeddings together in Spanner Graph, combines vector search with a graph query, ranks the results with the Agent Search ranking API and serves the agent from Agent Runtime.

When does a knowledge graph beat plain RAG?

When the answer depends on relationships across documents or on the corpus as a whole. For a question that one or two passages can answer, hybrid search with reranking is cheaper, easier to keep current and easier to secure.

Question types and the retrieval that suits each one.

Question typeExamplePlain RAGGraph approach
Lookup in one placeWhat is our travel policy for contractors?Good: one passage answers itAdds cost for no gain
Multi-hop relationshipWhich suppliers share a component with the part we recalled?Poor fit: the links sit in different documentsGood: local search follows the relationships
Whole-corpus themeWhat are the recurring causes across last year’s incident reports?Weak: no passage holds the answerGood: global search reads community summaries
Exact figuresWhat were March sales by region?Wrong tool: numbers belong in a databaseNeither; use structured retrieval or a semantic model
Fast-changing recordWhat is the status of ticket 4412?Good with a live connectorWeak: the graph reflects its last build

For exact figures, Bedrock Knowledge Bases has generated SQL against structured stores since 4 Dec 2024, and Microsoft’s Fabric IQ models business data as ontologies and semantic models for agents, in preview as a Foundry IQ knowledge source. A graph is one retrieval tool among several, and the agent should be able to choose it per question.

What does GraphRAG cost, and what goes wrong?

The cost sits mostly in indexing, because a model reads every text unit to extract entities and then writes every community summary, and answer quality depends on that extraction. Budget for both before you commit a large corpus.

  • Indexing cost. Microsoft’s repository warns that GraphRAG indexing can be an expensive operation and advises starting small. LazyGraphRAG, announced by Microsoft Research on 25 Nov 2024, needs no prior summarisation; Microsoft reports its indexing cost as identical to vector RAG and 0.1% of full GraphRAG.
  • Extraction errors. Entities and relationships come from a model, so its mistakes become edges the agent trusts. Google’s architecture warns that LangChain’s LLMGraphTransformer may extract entities from generic domains, and Microsoft’s documentation says out-of-the-box results may not be the best possible and points to its prompt tuning guide.
  • Staleness and limits. The graph reflects the corpus at its last build. Bedrock GraphRAG offers no options to customise the graph build, takes Amazon S3 as its only data source, allows 1,000 files per data source by default (up to 10,000 on request), and Neptune Analytics graphs do not autoscale.
  • Permissions. A community summary blends many documents, so it can carry a fact from a document the reader may not open. Build separate graphs per access boundary, or use a graph only for content its whole audience may see.
  • Model retirement and cleanup. AWS notes that the model used for graph construction can reach end of life, so plan to rebuild with a supported one. Deleting a Bedrock knowledge base does not delete its Neptune Analytics graph, which keeps incurring charges until you remove it.

How should you start with a knowledge graph?

Start from the questions people ask. Collect a set of real questions, mark the ones that need relationships or whole-corpus answers, and test a graph only on those, against the retrieval you already run.

  1. Measure today’s retrieval first, with labelled relevance judgments for the retrieval step and groundedness for the answer, so you can see whether a graph changes anything. Foundry’s RAG evaluators and Bedrock’s retrieve-only evaluation jobs both support this.
  2. Pick a bounded corpus where relationships matter, such as supplier contracts, incident reports or a product catalogue, inside one access boundary.
  3. Try the smallest build that answers the question: Bedrock GraphRAG for content already in S3, or Microsoft GraphRAG on a sample, as its documentation advises.
  4. Review the extracted entity types and relationships with a domain expert, tune the extraction prompts, and fix the schema before you scale.
  5. Set the rebuild schedule and the permission model before launch, and give the agent the graph as a separate tool next to plain search.

How do Microsoft, AWS and Google implement it?

GraphRAG building blocks on each cloud, as the vendor pages showed on 2 Nov 2026.

Capability, Microsoft, AWS, Google

CapabilityMicrosoftAWSGoogle
Managed GraphRAGOpen-source Microsoft GraphRAG library (MIT); no managed GraphRAG service in the pages we reviewedBedrock Knowledge Bases GraphRAG on Neptune Analytics, GA 7 Mar 2025, in seven RegionsReference architecture: Spanner Graph for graph and embeddings, agent on Agent Runtime
Graph or semantic layerFabric IQ ontologies, semantic models and graphs, preview as a Foundry IQ knowledge sourceAmazon Neptune AnalyticsSpanner Graph
How retrieval uses the graphGraphRAG local, global, DRIFT and basic searchVector search first, then graph traversal to related chunksVector search combined with a graph query, ranked by the Agent Search ranking API
Building the graphModel-based extraction with prompt tuningA foundation model you choose for graph construction; no build customisationLangChain LLMGraphTransformer, or an existing graph pipeline in place of the ingestion subsystem

Google’s architecture page says it gives no specific guidance for designing GraphRAG applications and treats its components as replaceable, so read it as a starting design rather than a product.

Frequently asked questions

Is GraphRAG better than RAG?

For some questions. On lookups that one passage answers it adds indexing cost without improving the answer. On multi-hop and whole-corpus questions it can answer what plain retrieval cannot, so the fair test is your own question set, run against both.

How is a knowledge graph different from agent memory?

A knowledge graph describes your content: entities and relationships extracted from documents an audience may read. Agent memory describes interactions, such as what one user told the agent. Some memory products use graph stores underneath, Mem0 integrates with Neptune Analytics for example, but the two answer different questions and follow different retention rules.

How often should the graph be rebuilt?

As often as the questions need fresh answers, weighed against the extraction cost of each build. Content that changes daily belongs in plain retrieval with a live connector; a graph suits corpora that change slowly, such as contracts, standards or archived reports.

Does a knowledge graph reduce hallucinations?

It can when the error comes from missing context, because related facts reach the model together, and AWS describes Bedrock GraphRAG in those terms. A wrong relationship in the graph gets repeated with confidence, so groundedness checks on the answers still apply.

More in Knowledge and retrieval

Sources

Each source was read on 2 November 2026. The date shown is the date on the page, or the page’s ms.date for Microsoft Learn; an undated page shows the date it was read.

  1. From Local to Global: A Graph RAG Approach to Query-Focused Summarization arXiv (Edge et al., Microsoft Research), 24 April 2024
  2. GraphRAG project Microsoft Research, undated page, read 2 November 2026
  3. GraphRAG documentation Microsoft (GitHub Pages), undated page, read 2 November 2026
  4. GraphRAG repository Microsoft on GitHub, undated page, read 2 November 2026
  5. LazyGraphRAG: setting a new standard for quality and cost Microsoft Research blog, 25 November 2024
  6. Amazon Bedrock Knowledge Bases GraphRAG is now generally available AWS What’s New, 7 March 2025
  7. Build a knowledge base with Amazon Neptune Analytics graphs AWS documentation, undated page, read 2 November 2026
  8. Amazon Bedrock document history AWS documentation, undated page, read 2 November 2026
  9. Evaluate a knowledge base (RAG evaluation) AWS documentation, undated page, read 2 November 2026
  10. GraphRAG infrastructure for generative AI using Spanner Graph Google Cloud Architecture Center, undated page, read 2 November 2026
  11. What is Foundry IQ? Microsoft Learn, 31 July 2026
  12. Retrieval-augmented generation evaluators Microsoft Learn, undated page, read 2 November 2026
  13. Build persistent memory for agentic AI with Mem0, ElastiCache for Valkey and Neptune Analytics AWS Database Blog, undated page, read 2 November 2026

Planning an AI program?

Talk to the team that builds it and runs it after launch.

  • Built to SOC 2, HIPAA and GDPR standards
  • EU AI Act-aligned delivery
  • Microsoft Solutions Partner