Build · Retrieval systems · checked 28 July 2026

What Is RAG? A Practical Guide to RAG, GraphRAG and Hybrid Retrieval

Start with a small, cited retrieval baseline. Add graph structure only when the questions genuinely depend on entities, connections or whole-corpus themes—and keep both indexes rebuildable from governed source data.

3retrieval routesVECTOR · GRAPH · HYBRID
2systems to test separatelyRETRIEVER + GENERATOR
1governed source of truthINDEXES ARE REBUILDABLE
01 · Mental model

How does retrieval-augmented generation work?

Retrieval-Augmented Generation joins a generator to external, non-parametric memory. The documents remain outside the model weights.

Prepare

Parse governed sources, preserve document and section identity, split them into useful retrieval units and create searchable representations.

Retrieve

Use the question to select candidate passages, records or graph neighborhoods, then filter and rerank within the user's access boundary.

Generate

Give the model the selected evidence, require an answer bounded by it and return citations that resolve to the original source—not merely to an index row.

Evidence boundary: the original RAG paper established generation with parametric and retrieved non-parametric memory on specific knowledge-intensive tasks. It did not establish that every modern document-chat system is accurate, secure or citation-faithful.

02 · Architecture decision

Use the lightest route that can pass the real questions.

GraphRAG is an additional data product and query path, not an automatic upgrade.

Vector RAG

Start here when answers usually live in one or a few text passages: policies, manuals, case notes, contracts or knowledge-base articles.

Search + rerank

Add keyword retrieval, metadata filters or a reranker when dense similarity misses exact terms, identifiers or authoritative sources.

GraphRAG

Test graph retrieval when questions depend on connected entities, multi-document paths, controlled relationship types or themes across a corpus.

Hybrid

Combine text and graph context only when the evaluation set shows complementary failures and the improvement justifies two synchronized indexes.

RouteBest first testWhat it preservesPrimary failureOperating burden
Vector RAG“What does this document say?”Semantic similarity and source chunksRelated wording can outrank the needed fact; evidence may be split across chunksLowest of the three; still requires parsing, updates, ACLs and evaluation
GraphRAG“How are these people, events or systems connected?”Entities, typed relationships, neighborhoods and graph communitiesExtraction and entity-resolution errors create missing or false pathsHigher; graph construction, resolution, provenance and query tuning
Hybrid RAGA query needing both an exact source passage and a cross-source relationshipBroad textual evidence plus explicit structureMore context can add noise; ranking and synchronization become harderHighest; two retrieval paths, merging, budgets and regression tests

Research context: a 2025 systematic evaluation reports distinct strengths for RAG and GraphRAG across question answering and query-focused summarization; HybridRAG reports gains from combined vector and graph retrieval on a financial-transcript experiment. These results motivate testing routes—they are not universal production guarantees.

03 · Reference architecture

See exactly what the graph changes.

Both systems retrieve evidence for a generator. Conventional RAG retrieves passages; GraphRAG first builds explicit entities, relationships and corpus-level structure.

Conventional RAGRetrieve the best passages.Lowest useful complexity for document-grounded answers
Index time
Governed sourceDocuments + recordsVersion · ACL · owner
PrepareParse + chunkPage and heading IDs survive
Derived memoryText + vector indexKeywords · embeddings · metadata
Question time
InputUser questionIdentity + allowed scope
RetrieveSearch + filter + rerankSelect top-k passages
ContextSource chunksPassages + resolvable citations
GenerateLLM answerAnswer · abstention · citations
Best fitPolicies, manuals, contracts, case notes and answers that live in a few passages.
GraphRAGRetrieve connected evidence.Additional structure for relational and whole-corpus questions
Index time
Governed sourceDocuments + recordsVersion · ACL · owner
Extract + resolveEntities + relationsAliases · claims · timestamps
Derived memoryKnowledge graphEdges · communities · source links
Question time
InputUser questionEntities + question class
Route + traverseLocal, global or DRIFTNeighborhood · paths · communities
ContextSubgraph + source chunksNodes · edges · supporting text
GenerateLLM answerAnswer · path · citations
Best fitDependencies, ownership, lineage, investigations, multi-document paths and corpus-wide themes.

The architectural difference is upstream of the model. GraphRAG adds extraction, entity resolution, graph maintenance and graph-aware retrieval. A hybrid system keeps the passage path and adds the graph path only where the evaluation set proves it helps.

01Govern sourcesRights, classification, owner, version, retention and access policy.
02Parse + identifyDocument, page, heading, record and stable source identifiers.
03Build indexesText chunks and embeddings; optional entities, edges and community summaries.
04Route + retrieveMetadata filters, vector or keyword candidates and bounded graph traversal.
05Merge + answerRerank, enforce a context budget and cite the original evidence.
06Measure + refreshLog versions, misses, path validity, latency, cost and user corrections.

GraphRAG is more than a graph database. Microsoft's current implementation extracts entities, relationships and claims, detects communities, produces summaries and embeds text. Its query engine separates entity-focused local search, whole-dataset global search, DRIFT and basic vector search. See the official indexing overview and query overview.

04 · Graph gate

Earn the graph with questions that require one.

A graph pays for itself only when explicit structure improves an outcome that simpler retrieval cannot reach reliably.

Strong signal

Relationships are the answer.

Ownership, dependency, lineage, supply chains, citations, organizational paths or event sequences must be traversed and explained.

Strong signal

Questions span the corpus.

Readers need themes, clusters or connected evidence across many documents rather than the nearest matching passage.

Conditional

A useful schema exists.

Stable identifiers, entity types and relationship rules already exist—or the workflow value can fund their creation and maintenance.

Weak signal

“Graphs sound smarter.”

A product label, demo or vendor benchmark does not justify graph extraction when ordinary search already passes the acceptance set.

A GraphRAG index is a governed data pipeline, not an LLM side effect.

Every stage creates an artifact that can be inspected independently. If the final answer is wrong, the trace should reveal whether the source was missing, the entity was split, the relationship was invented, the wrong neighborhood was traversed or the generator ignored valid context.

01 · SegmentText unitsPreserve document, page, heading, version and ACL on every unit.
02 · ExtractEntities + claimsFind people, systems, events, concepts and candidate relationships.
03 · ResolveCanonical identityMerge aliases; keep homonyms, subsidiaries and versions separate.
04 · RelateTyped edgesDirection, predicate, validity time, confidence and supporting source.
05 · OrganizeCommunities + summariesCluster the graph for broader questions without discarding raw evidence.
06 · PublishQueryable indexVersion the graph, embeddings, prompts and extraction configuration together.

Choose the query mode by the shape of the question.

Query modeQuestion shapeContext assembledWhat to testCost / failure boundary
Basic text / vector“What does policy 7.2 say about retention?”Top matching passagesExact source appears in top-k; citation resolvesCheapest baseline; can miss distributed or relational evidence
Local graph search“Who owns service A, and which incidents involved it?”Seed entities, neighbors, relationships, community context and linked textEntity mapping, edge direction, path validity and source supportSensitive to duplicate entities and missing edges
Global graph search“What recurring risks appear across the full incident archive?”Community reports evaluated and reduced across the corpusTheme coverage, minority evidence, aggregation bias and token budgetResource-intensive; summaries can flatten exceptions
DRIFT / exploratory“How might these local failures connect to broader operating patterns?”Community-informed starting point plus detailed follow-up retrievalBreadth gained, irrelevant branches, reproducibility and stop conditionsBroader search can add latency and plausible noise
Explicit graph query“List approved suppliers two hops from programme X as of 30 June.”Schema-bound traversal with filters and validity timeExact path, filter semantics, authorization and empty-result behaviorPrecise only when schema and graph data are precise

Graph quality is won or lost at four seams.

Identity

“ACME,” “ACME Ltd” and a product called “Acme” cannot be merged because an embedding says they look alike. Use stable keys where available, alias rules where necessary and a review queue for uncertain merges.

Relationship

“Uses,” “owns,” “approved by” and “mentioned with” are not interchangeable. Define direction and allowed entity types; reject an edge that cannot name its predicate and source.

Time

A graph without valid-from, valid-to and observed-at fields can answer with a relationship that was once true. Preserve event time separately from ingestion time and expose staleness.

Provenance

An extracted edge is navigation, not proof. Store the document and text-unit IDs behind it, and make every answer path resolve to original evidence a reviewer can inspect.

Trace one relational question end to end.

QuestionWhich change caused the outage, and who approved it?Requires an event, deployment, service, incident and person to connect.
SeedMap outage + serviceResolve the incident ID and service alias before expanding.
TraverseIncident → deployment → changeFollow only allowed, time-valid edge types within the incident window.
JoinChange → approval → personRecover the approval record and responsible identity.
RetrieveOpen supporting passagesDeployment log, incident timeline and approval record enter context.
AnswerState path + uncertaintyCite each hop; abstain if any required edge lacks evidence.

The graph earns production only if it passes a separate acceptance set.

Test familyFixturePass ruleFailure it catchesRelease action
Entity resolutionAliases, homonyms, mergers, renamed systems and versioned productsKnown same entities merge; known different entities remain separateFalse joins and broken neighborhoodsBlock new resolver; review uncertain identity queue
Relationship extractionPositive, negative, hypothetical and historical statementsPredicate, direction, time and source match the referenceInvented, reversed or timeless edgesQuarantine edge type or fall back to text retrieval
Path retrievalKnown one-, two- and three-hop questions plus impossible pathsRequired path is returned; impossible path produces no fabricated bridgeTraversal gaps and graph completion by guessingTune seeding and hop limits; keep abstention
Global themesDominant, minority and contradictory themes across a frozen corpusMaterial themes survive aggregation with traceable evidenceSummary flattening and majority biasChange community level or return scoped results
AuthorizationUsers with overlapping but different document and entity rightsNo node, edge, summary or citation crosses the caller's boundaryRelationship leakage across collectionsStop serving graph results until fixed

Implementation references: Microsoft's standard and fast indexing methods, query-mode overview and the systematic RAG versus GraphRAG evaluation. Microsoft's method notes explicitly trade richer extraction against cost and noisier fast graphs; treat that as an engineering choice to benchmark on your corpus.

Graph data can be confidently wrong

Keep source identifiers and confidence on every extracted claim. Test duplicate entities, aliases, missing edges, contradictory timestamps and unauthorized relationship leakage. If a path cannot resolve back to evidence, do not present it as a citation.

05 · Build sequence

Build one measured slice before a platform.

The first deliverable is not “chat with everything.” It is a small set of real questions answered within a defined data and authority boundary.

StageMinimum deliverableAcceptance checkDo not hideScale trigger
1 · ContractOne audience, corpus, task, owner and answer policyKnown answerable, unanswerable and forbidden questionsRights, personal data, stale sources and access boundariesThe workflow owner accepts the question set
2 · BaselineKeyword and vector retrieval over a small representative corpusCorrect evidence appears in top-k for held-out questionsParser failures, empty pages, tables and duplicate versionsRetrieval misses are understood by category
3 · Grounded answerAnswer, refusal and resolvable source citationsClaims match cited evidence; unsupported questions abstainPrompt and model version, context used and truncationA stable regression set passes repeatedly
4 · Optional graphOnly the entity and relationship types needed by failed questionsValid paths improve the named failures without harming simple QAResolution confidence, provenance and graph build costMeasured gain exceeds added latency and upkeep
5 · OperateIncremental refresh, deletion, ACL enforcement, monitoring and rollbackSource changes appear on time; revoked data disappears everywhereIndex age, last successful build and partial failuresRestore and re-index drills work
06 · Evaluation

Score the retriever before blaming the model.

A fluent wrong answer can begin with a retrieval miss, a ranking mistake, an incomplete graph path or unsupported generation. Preserve the stage boundary.

Retriever

Did the right evidence arrive?

Measure top-k hit rate, context precision and recall, metadata-filter accuracy and—when graph retrieval is used—entity and path coverage.

Generator

Did the answer stay inside it?

Measure answer correctness, citation entailment, refusal behavior and faithfulness to the retrieved context. Review consequential failures manually.

System

Was it useful repeatedly?

Track end-to-end latency, cost, freshness, access-control failures, user corrections and pass rate across repeated runs—not only a best attempt.

Metric caution: Ragas documents context precision, context recall, response relevance and faithfulness as separable RAG measures. Some of these use model-based scoring. Calibrate them against references and human review rather than treating one automated score as independent proof. See the current metric catalogue and this site's evidence policy.

Ten real trials before more authority

Freeze the corpus snapshot, questions, expected evidence and pass rules. Run vector, graph and hybrid variants on the same set. Save every retrieved context and answer. Expand only the route that improves the named workflow without unacceptable security, latency or maintenance regressions.

07 · Production boundaries

Retrieval creates a new route to governed data.

Embeddings, chunks, graph edges, traces and caches can reveal sensitive material even when the original repository is protected.

Authorize first

Filter candidates by the user's entitlement before generation. Do not retrieve broadly and ask the model to redact afterward.

Preserve provenance

Carry source ID, section or page, observed time, version and classification through every index and response.

Delete everywhere

Define how revocation reaches chunks, vectors, graph facts, summaries, caches, traces, backups and derived evaluations.

Expose freshness

Show the source date and last successful index build. Stop or warn when an update fails instead of silently serving stale evidence.

Map policy to every derived surface.

A source repository's controls do not automatically follow copied text, embeddings, community summaries or traces. Each derived surface needs an explicit owner, authorization check, retention rule and deletion path.

SurfaceWhat it can revealMinimum controlDeletion / correction pathProduction signal
Parsed text + chunksFull passages, hidden fields, OCR mistakes and prior versionsEncrypted storage, document ACL, parser allowlist and quarantine for unreadable filesRemove by stable source/version ID, then rebuild affected indexesParse success, skipped content and last valid version
Embeddings + search indexSimilarity, membership and retrievable sensitive conceptsTenant/collection isolation, pre-retrieval filters, private endpoints and tested backupsDelete vector and metadata by source ID; verify it cannot be retrievedIndex age, document count, filter result and restore test
Graph nodes + edgesSensitive relationships that no single document states plainlyNode and edge authorization, provenance, time validity and restricted traversalRetract affected claims, summaries and neighborhoods; re-run resolutionOrphan rate, unresolved identities, invalid edges and ACL denials
Community summaries + cachesCross-document conclusions and stale aggregate factsScope summaries to compatible ACL domains; attach input version set and expiryInvalidate every summary whose dependency set changedDependency version, expiry and cache-hit freshness
Prompts, traces + eval setsQuestions, retrieved evidence, model answers, corrections and user intentRedaction, access-limited observability, retention limits and separation from product analyticsPurge by run, user and source ID without destroying required audit recordsSampling rate, redaction failures, retention age and reviewer access

Treat refresh as a versioned release.

01 · DetectSource changedCreate, update, revoke or classification change enters a durable queue.
02 · RebuildDerived artifactsReparse affected units; re-embed; re-extract graph claims and summaries.
03 · ValidateQuality + policyParser, retrieval, graph, ACL, deletion and freshness checks run before publish.
04 · PublishAtomic versionPromote compatible index, graph, prompt and configuration versions together.
05 · ObserveCanary questionsCompare hit rate, groundedness, latency, empty results and authorization denials.
06 · Roll backLast valid releaseKeep a known-good manifest; never serve a half-updated vector/graph pair.

Define the failure response before the first incident.

FailureHow it appearsAutomatic responseOwner decisionEvidence to retain
Source or parser failureMissing pages, zero-length chunks, broken tables or unexpected document-count dropQuarantine source; keep last valid version with a visible stale flagRepair parser, accept exclusion or stop the collectionFile hash, parser version, errors and skipped ranges
Retrieval regressionKnown evidence falls out of top-k or irrelevant context dominatesFail canary; hold index promotion; fall back to last valid releaseChange chunking, embeddings, filters or rerankerQuestion, expected source, candidates, scores and versions
Graph corruptionEntity explosion, suspicious new hubs, reversed edges or impossible pathsDisable affected edge types or graph route; retain text RAGRe-run resolution, correct schema or rebuild graphExtraction prompt, claim source, merge history and graph diff
Grounding failureAnswer claim is not supported by the supplied passage or pathAbstain or return evidence without synthesized claimAdjust prompt, context assembly, model or answer policyFull context, answer, citations, grader and human adjudication
Authorization leakRestricted chunk, entity, relationship or summary reaches an unauthorized runStop affected route, revoke caches and preserve incident evidenceBreach process, user notification and safe re-enable criteriaCaller identity, policy decision, retrieved IDs and access logs
Refresh driftVector and graph versions disagree or revoked facts remain in summariesMark release unhealthy and route to a coherent known-good versionComplete rebuild or targeted dependency invalidationRelease manifest, dependency graph and deletion verification

Make ownership as explicit as the architecture.

Data owner

Controls the source boundary.

Approves corpus, rights, classification, retention, authoritative versions and who may see which documents and relationships.

Retrieval owner

Controls the derived memory.

Owns parsers, chunking, indexes, entity resolution, refresh, deletion, restore, latency and retrieval regression tests.

Workflow owner

Controls the useful answer.

Defines questions, acceptance rules, abstention, human escalation, outcome measurement and the authority the answer may trigger.

Cost lever, not a RAG property: vector quantization can reduce index memory and storage, but it is lossy and system-specific. Azure AI Search currently documents up to 28× index-size reduction for binary quantization and recommends oversampling and rescoring to offset information loss. Treat compression as an experiment with the same recall set. Read the official guide →

08 · Replaceable components

Choose interfaces before brands.

Keep the raw corpus, parsing output, retrieval evaluation and source identifiers portable. The index is derived infrastructure.

The practical default

Start with cited vector retrieval. Let failed questions earn more structure.