- Home
- AI agents
- Knowledge and retrieval
- 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
- 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.
- 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.
- 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.
- 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 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 type | Example | Plain RAG | Graph approach |
|---|---|---|---|
| Lookup in one place | What is our travel policy for contractors? | Good: one passage answers it | Adds cost for no gain |
| Multi-hop relationship | Which suppliers share a component with the part we recalled? | Poor fit: the links sit in different documents | Good: local search follows the relationships |
| Whole-corpus theme | What are the recurring causes across last year’s incident reports? | Weak: no passage holds the answer | Good: global search reads community summaries |
| Exact figures | What were March sales by region? | Wrong tool: numbers belong in a database | Neither; use structured retrieval or a semantic model |
| Fast-changing record | What is the status of ticket 4412? | Good with a live connector | Weak: 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.
- 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.
- Pick a bounded corpus where relationships matter, such as supplier contracts, incident reports or a product catalogue, inside one access boundary.
- 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.
- Review the extracted entity types and relationships with a domain expert, tune the extraction prompts, and fix the schema before you scale.
- 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
| Capability | Microsoft | AWS | |
|---|---|---|---|
| Managed GraphRAG | Open-source Microsoft GraphRAG library (MIT); no managed GraphRAG service in the pages we reviewed | Bedrock Knowledge Bases GraphRAG on Neptune Analytics, GA 7 Mar 2025, in seven Regions | Reference architecture: Spanner Graph for graph and embeddings, agent on Agent Runtime |
| Graph or semantic layer | Fabric IQ ontologies, semantic models and graphs, preview as a Foundry IQ knowledge source | Amazon Neptune Analytics | Spanner Graph |
| How retrieval uses the graph | GraphRAG local, global, DRIFT and basic search | Vector search first, then graph traversal to related chunks | Vector search combined with a graph query, ranked by the Agent Search ranking API |
| Building the graph | Model-based extraction with prompt tuning | A foundation model you choose for graph construction; no build customisation | LangChain 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.
- From Local to Global: A Graph RAG Approach to Query-Focused Summarization
- GraphRAG project
- GraphRAG documentation
- GraphRAG repository
- LazyGraphRAG: setting a new standard for quality and cost
- Amazon Bedrock Knowledge Bases GraphRAG is now generally available
- Build a knowledge base with Amazon Neptune Analytics graphs
- Amazon Bedrock document history
- Evaluate a knowledge base (RAG evaluation)
- GraphRAG infrastructure for generative AI using Spanner Graph
- What is Foundry IQ?
- Retrieval-augmented generation evaluators
- Build persistent memory for agentic AI with Mem0, ElastiCache for Valkey and Neptune Analytics
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