← Back to Index

RAG Chunks vs. Subgraph Retrieval

The same underlying knowledge expressed two ways: as flat text chunks retrieved by embedding similarity, and as a typed subgraph retrieved by hash lookup and traversal. Compare what an agent actually receives in context — and why structure outperforms prose for multi-hop reasoning.

Query

RAG Chunk Retrieval

— tokens
Select a query and press Run Retrieval.

Subgraph Retrieval

— tokens
Select a query and press Run Retrieval.
Efficiency Comparison
Dimension RAG Chunk Retrieval Subgraph Retrieval
Retrieval mechanism Approximate nearest-neighbor search in embedding space (cosine similarity over dense vectors) Hash lookup + graph traversal from seed node (BFS / DFS over an adjacency list)
Context representation Flat unstructured prose — sentences, paragraphs, and surrounding noise all arrive together Typed nodes + directed labeled edges — only the relational structure, no prose filler
Typical token cost 300–800 tokens per query (chunks contain much text irrelevant to the specific relation needed) 30–80 tokens per query (only the nodes and edges within the retrieved subgraph)
Relation fidelity Relations are implied by prose — the agent must infer "requires", "enables", "opposes" from natural language Relations are explicit typed edge labels — unambiguous, machine-readable, provably present in the graph
Multi-hop reasoning Requires multiple retrieval rounds or long-context reasoning across stacked chunks; hops are not guaranteed to be covered Inherent — graph traversal follows edges across hops by construction; k-hop neighborhood is a single query
Hallucination risk Higher — agent fills gaps between implied relations with parametric prior knowledge, which may not match the source Lower — every edge is either in the graph or it isn't; no interpolation needed, no relations invented
Update cost Re-embed changed chunks; similarity index must be rebuilt or incrementally updated Edit the node or edge; existing hashes remain stable; no re-indexing of unrelated content
Why an Agent Can Reason When Given a Hash

Hash = Stable Address into a Typed Relational Structure

A hash is not just an opaque ID. It is a dereferenceable pointer into a graph where every edge is labeled, directed, and typed. Compare what the agent actually sees in context for the same conceptual question — and what cognitive work each form demands.

Agent context — RAG chunk (~480 tokens)
"""
Justification is generally held to be one of the key components of knowledge, alongside truth and belief. A belief is justified if the agent has adequate grounds for holding it. Philosophers disagree about what constitutes adequate grounds — some appeal to reliable cognitive processes (reliabilism), others to coherence within a web of beliefs (coherentism), and others to the presence of evidence that directly supports the belief (evidentialism). Without justification a belief can be true by luck alone, as illustrated by Gettier cases...
[chunk continues — 310 more tokens of prose]
"""
The agent must parse hundreds of tokens of prose, extract that Belief requires Justification and Justification enables Knowledge, then hold those inferred relations in working context. Competing philosophical positions embedded in the same chunk may confuse the inference. The relations are real, but buried — the agent must comprehend language first, then reason second.
Agent context — subgraph (~52 tokens)
a3f7c2 Justification [requiresb12e91 Evidence] [enablesc88f04 Knowledge] [required-byd5a310 Belief]

b12e91 Evidence [supportsa3f7c2 Justification] [opposesf09c21 Bias]

d5a310 Belief [requiresa3f7c2 Justification] [part-ofc88f04 Knowledge]

c88f04 Knowledge [requiresd5a310 Belief, a3f7c2 Justification, e77b33 Truth]
Each hash is a stable, unambiguous address. The agent sees exactly which nodes exist, which typed edges connect them, and which hashes it can dereference next for deeper traversal — all in ~52 tokens. No inference about implied relations is needed. The graph is the reasoning substrate; the agent navigates rather than comprehends.
Why hashes enable reasoning: A chunk asks the agent to read language and extract structure. A hash gives the agent the structure directly — the hash is a handle, every edge is a provable step, and the full k-hop neighborhood is reachable in a single traversal. The agent shifts from language model performing comprehension to graph reasoner performing lookup and traversal. Fewer tokens, fewer inferences, fewer opportunities to hallucinate a relation that was never in the source.
The vocabulary invariance point: The same graph topology — two sources converging on a justification node that enables a knowledge node — appears identically in epistemic, legal, biological, and computational domains (see the Structure Isomorphism Explorer). A hash makes this isomorphism explicit: a3f7c2 is the same structural role whether the label reads "Justification", "Argument", "Adaptation", or "Validation". RAG chunks cannot express this equivalence without additional prose.