Vector-vs-Graph Retrieval Selector
Overview
Ch1 makes the vector-vs-graph choice evidence-based rather than ideological.
Microsoft's BenchmarkQED classifies queries on two axes:
- Scope — local (specific facts in a small number of regions) vs
global / sensemaking (reasoning over large portions of the dataset).
- Type — data (direct fact retrieval) vs activity
(interpretive / strategic).
The chapter's numeric anchors:
- Vector RAG: ~90% accuracy on simple lookups (DataLocal); 20-30% on
complex reasoning (ActivityGlobal). "The very mechanism that makes vector
search efficient becomes its fundamental limitation."
- LazyGraphRAG outperforms vector RAG by 50-60% on multi-hop reasoning.
- EyeLevel.ai: at 100,000 pages, vector accuracy drops up to 12% while
graph drops only ~2%.
- The larger-context-window rebuttal: BenchmarkQED tested vector RAG against
LazyGraphRAG with a ~1-million-token window (essentially the whole
dataset); vector RAG still lost on every query type except the most basic
factual questions, and bigger windows worsen "lost in the middle."
Where vector RAG shines (Ch1): local, fact-based lookups — customer support,
FAQ, recommendation. Where it collapses: multi-hop reasoning, temporal
awareness, the associativity gap ("which services were affected by the
database migration that followed the security patch we discussed last month").
Ch1's own recommendation for agents is a HYBRID architecture — parallel
vector + graph (vector search -> graph traversal -> context synthesis) —
because agentic behavior "requires constantly moving between local and global
understanding." GraphRAG is not free: the chapter names upfront
graph-construction cost, query latency that grows with graph size, contextual
nuance lost in triples, and schema-evolution cost. The selector surfaces those
costs whenever it recommends GRAPH or HYBRID.
When to Use
- Choosing a retrieval architecture for a new enterprise agent
- Answering "should we add a graph, or is vector RAG enough?"
- Rebutting "let's just use a bigger context window instead of a graph"
- Mapping a mixed query workload to the right per-query strategy
- Teaching the BenchmarkQED local/global x data/activity quadrants
Phrases: "vector or graph", "do we need GraphRAG", "will a bigger context
window fix it", "retrieval architecture", "why does RAG fail on this query",
"local vs global queries".
When NOT to Use
- Tuning an existing pipeline (chunk size, embedding model, reranker) —
this chooses the architecture, not its hyperparameters.
- Consumer FAQ / support bots where DataLocal lookups dominate — the answer
is VECTOR and you already know it.
- As a graph builder. This recommends graph; it does not construct one.
See Ch3 skills (
graph-model-selector, schema-pattern-selector).
Process
| Step |
Input |
Action |
Output |
Verification |
| 1 |
scope / type / multi-hop / temporal / structure / scale / latency |
lib.recommend(...) |
VECTOR / GRAPH / HYBRID + reasons |
DataLocal lookup -> VECTOR; ActivityGlobal multi-hop -> GRAPH |
| 2 |
agentic workload |
recommend(..., agentic=True) |
HYBRID |
agent workloads default to the parallel hybrid |
| 3 |
graph signals + unstructured/latency-critical |
recommend(...) |
HYBRID (not pure GRAPH) |
costly-graph condition down-shifts GRAPH -> HYBRID |
| 4 |
larger_context_window=True |
read larger_context_window_rebuttal |
the ~1M-token rebuttal text |
rebuttal cites the 1M-token BenchmarkQED test |
| 5 |
dataset_scale_pages >= 100000 |
read scale_note |
EyeLevel 12%-vs-2% note |
scale note present at 100k+ pages |
| 6 |
GRAPH/HYBRID result |
read graphrag_costs |
the four GraphRAG struggles |
costs present for GRAPH/HYBRID, absent for VECTOR |
| 7 |
list of workloads |
lib.recommend_batch(...) |
per-workload + tally |
tally sums to the workload count |
Rationalizations
| Agent rationalization |
Documented rebuttal |
| "Just use a bigger context window and skip the graph." |
Ch1's direct test: BenchmarkQED ran vector RAG with a ~1M-token window (the whole dataset) and it still lost on every query type except the most basic factual questions. More tokens don't create relationships, temporal evolution, or systematic patterns — they worsen "lost in the middle." |
| "Vector RAG scored 90%, it's fine." |
That 90% is DataLocal only. On ActivityGlobal the same system scores 20-30%. If your workload has global/multi-hop queries, the headline number does not apply. |
| "Graphs are always better, use GRAPH everywhere." |
Ch1 names GraphRAG's costs: upfront construction, query latency, nuance loss in triples, schema-evolution burden. For a latency-critical DataLocal lookup, vector wins. The selector down-shifts to HYBRID/VECTOR when those costs bite. |
| "Our data is unstructured, so a graph is impossible." |
Then the recommendation is HYBRID, not 'give up on graph': run vector first, traverse a partial graph selectively, synthesize. Ch1's hybrid is exactly this parallel path. |
| "Scale doesn't change the vector-vs-graph answer." |
EyeLevel.ai (Ch1): at 100k pages vector drops up to 12% while graph drops ~2%. Scale widens the gap; the selector attaches the scale note at 100k+ pages. |
Red Flags
- A multi-hop / temporal / global workload recommended VECTOR. The scope or
multi-hop flags are unset; re-check the workload description against the
associativity-gap example.
- GRAPH recommended for a latency-critical DataLocal lookup. Graph
traversal is slower than an ANN lookup here; the selector should have chosen
VECTOR or HYBRID — verify the flags.
- HYBRID chosen for everything. Either the workload is genuinely agentic
(legitimate — that is the book's default) or the signals are under-specified;
add concrete scope/type/multi-hop values.
- A GRAPH/HYBRID recommendation adopted without reading
graphrag_costs.
The upfront-construction and maintenance cost is real; budget for it before
committing.
Non-Negotiable Verification
- Run the benchmark battery.
python cli.py benchmark must report 8/8:
- DataLocal lookup -> VECTOR; ActivityGlobal multi-hop -> GRAPH; agentic ->
HYBRID; graph-signals + unstructured -> HYBRID
- the larger-context-window flag attaches the 1M-token rebuttal
- 100k+ pages attaches the EyeLevel 12%-vs-2% scale note
- GRAPH/HYBRID surface GraphRAG costs; VECTOR does not
- the ActivityGlobal quadrant carries the 20-30% anchor
- Verify CLI help.
python cli.py --help exits 0 and prints the SKILL.md
description.
- Inspect the scenario.
python cli.py scenario devops should recommend
VECTOR for the 5xx lookup, GRAPH for the cascading-migration query, and
HYBRID for the autonomous agent.
Security Posture
- Prompt injection. The selector consumes structured flags and booleans,
not free-text documents, so there is no injection surface in
lib.py. The
numeric anchors and rebuttal text are author-controlled constants, not
model-generated.
- Data exfiltration. No network calls; the only file read is the workloads
JSON path the caller supplies (default: the bundled sample).
--json output
goes to stdout.
- Privilege escalation. No shell invocation, no dynamic import, no file
writes. The recommendation is advisory; it selects an architecture and does
not touch any datastore or credential.
- Decision integrity. Treat the recommendation as a starting point, not a
mandate — the chapter's numbers are reported so a human can audit the
rationale rather than trust an opaque verdict.
Source Attribution
Distilled from Agentic GraphRAG (O'Reilly, by Anthony Alcaraz and Sam Julien), Chapter 1 —
Defining Agentic AI, "The Limitations of Vector-Based Retrieval" and
"GraphRAG" sections. The BenchmarkQED quadrants, the 90% / 20-30% vector-RAG
numbers, the LazyGraphRAG +50-60% multi-hop figure, the EyeLevel.ai
12%-vs-2%-at-100k-pages result, and the ~1-million-token larger-context-window
rebuttal are all the chapter's, anchored in Microsoft's "From Local to Global:
A GraphRAG Approach to Query-Focused Summarization" and BenchmarkQED research.
1---2name: vector-vs-graph-retrieval-selector3description: Recommend VECTOR / GRAPH / HYBRID retrieval for a query workload, grounded in Ch1's BenchmarkQED evidence for where vector RAG succeeds and where it collapses. Classifies the workload on the BenchmarkQED scope x type axes (local/global, data/activity), weighs multi-hop / temporal / associativity needs, domain structure, corpus scale, and latency, then returns a recommendation with the chapter's numbers (vector RAG ~90% on DataLocal vs 20-30% on ActivityGlobal; LazyGraphRAG +50-60% on multi-hop; EyeLevel 12% vs 2% accuracy drop at 100k pages). Includes the explicit larger-context- window rebuttal (the ~1M-token BenchmarkQED test) and surfaces GraphRAG's own costs. Use when choosing a retrieval architecture for an enterprise agent. NOT for tuning an existing pipeline's embeddings, NOT for consumer FAQ bots where vector RAG is already the right fit.4---56# Vector-vs-Graph Retrieval Selector78## Overview910Ch1 makes the vector-vs-graph choice evidence-based rather than ideological.11Microsoft's BenchmarkQED classifies queries on two axes:1213- **Scope** — *local* (specific facts in a small number of regions) vs14 *global / sensemaking* (reasoning over large portions of the dataset).15- **Type** — *data* (direct fact retrieval) vs *activity*16 (interpretive / strategic).1718The chapter's numeric anchors:1920- Vector RAG: **~90%** accuracy on simple lookups (DataLocal); **20-30%** on21 complex reasoning (ActivityGlobal). "The very mechanism that makes vector22 search efficient becomes its fundamental limitation."23- **LazyGraphRAG outperforms vector RAG by 50-60%** on multi-hop reasoning.24- **EyeLevel.ai**: at 100,000 pages, vector accuracy drops up to **12%** while25 graph drops only **~2%**.26- The larger-context-window rebuttal: BenchmarkQED tested vector RAG against27 LazyGraphRAG with a **~1-million-token window** (essentially the whole28 dataset); vector RAG **still lost on every query type except the most basic29 factual questions**, and bigger windows worsen "lost in the middle."3031Where vector RAG shines (Ch1): local, fact-based lookups — customer support,32FAQ, recommendation. Where it collapses: multi-hop reasoning, temporal33awareness, the associativity gap ("which services were affected by the34database migration that followed the security patch we discussed last month").3536Ch1's own recommendation for agents is a **HYBRID** architecture — parallel37vector + graph (vector search -> graph traversal -> context synthesis) —38because agentic behavior "requires constantly moving between local and global39understanding." GraphRAG is not free: the chapter names upfront40graph-construction cost, query latency that grows with graph size, contextual41nuance lost in triples, and schema-evolution cost. The selector surfaces those42costs whenever it recommends GRAPH or HYBRID.4344## When to Use4546- Choosing a retrieval architecture for a new enterprise agent47- Answering "should we add a graph, or is vector RAG enough?"48- Rebutting "let's just use a bigger context window instead of a graph"49- Mapping a mixed query workload to the right per-query strategy50- Teaching the BenchmarkQED local/global x data/activity quadrants5152Phrases: "vector or graph", "do we need GraphRAG", "will a bigger context53window fix it", "retrieval architecture", "why does RAG fail on this query",54"local vs global queries".5556## When NOT to Use5758- **Tuning an existing pipeline** (chunk size, embedding model, reranker) —59 this chooses the architecture, not its hyperparameters.60- **Consumer FAQ / support bots** where DataLocal lookups dominate — the answer61 is VECTOR and you already know it.62- **As a graph builder.** This recommends graph; it does not construct one.63 See Ch3 skills (`graph-model-selector`, `schema-pattern-selector`).6465## Process6667| Step | Input | Action | Output | Verification |68|------|-------|--------|--------|--------------|69| 1 | scope / type / multi-hop / temporal / structure / scale / latency | `lib.recommend(...)` | VECTOR / GRAPH / HYBRID + reasons | DataLocal lookup -> VECTOR; ActivityGlobal multi-hop -> GRAPH |70| 2 | agentic workload | `recommend(..., agentic=True)` | HYBRID | agent workloads default to the parallel hybrid |71| 3 | graph signals + unstructured/latency-critical | `recommend(...)` | HYBRID (not pure GRAPH) | costly-graph condition down-shifts GRAPH -> HYBRID |72| 4 | `larger_context_window=True` | read `larger_context_window_rebuttal` | the ~1M-token rebuttal text | rebuttal cites the 1M-token BenchmarkQED test |73| 5 | `dataset_scale_pages >= 100000` | read `scale_note` | EyeLevel 12%-vs-2% note | scale note present at 100k+ pages |74| 6 | GRAPH/HYBRID result | read `graphrag_costs` | the four GraphRAG struggles | costs present for GRAPH/HYBRID, absent for VECTOR |75| 7 | list of workloads | `lib.recommend_batch(...)` | per-workload + tally | tally sums to the workload count |7677## Rationalizations7879| Agent rationalization | Documented rebuttal |80|------------------------|--------------------|81| "Just use a bigger context window and skip the graph." | Ch1's direct test: BenchmarkQED ran vector RAG with a ~1M-token window (the whole dataset) and it still lost on every query type except the most basic factual questions. More tokens don't create relationships, temporal evolution, or systematic patterns — they worsen "lost in the middle." |82| "Vector RAG scored 90%, it's fine." | That 90% is DataLocal only. On ActivityGlobal the same system scores 20-30%. If your workload has global/multi-hop queries, the headline number does not apply. |83| "Graphs are always better, use GRAPH everywhere." | Ch1 names GraphRAG's costs: upfront construction, query latency, nuance loss in triples, schema-evolution burden. For a latency-critical DataLocal lookup, vector wins. The selector down-shifts to HYBRID/VECTOR when those costs bite. |84| "Our data is unstructured, so a graph is impossible." | Then the recommendation is HYBRID, not 'give up on graph': run vector first, traverse a partial graph selectively, synthesize. Ch1's hybrid is exactly this parallel path. |85| "Scale doesn't change the vector-vs-graph answer." | EyeLevel.ai (Ch1): at 100k pages vector drops up to 12% while graph drops ~2%. Scale widens the gap; the selector attaches the scale note at 100k+ pages. |8687## Red Flags8889- **A multi-hop / temporal / global workload recommended VECTOR.** The scope or90 multi-hop flags are unset; re-check the workload description against the91 associativity-gap example.92- **GRAPH recommended for a latency-critical DataLocal lookup.** Graph93 traversal is slower than an ANN lookup here; the selector should have chosen94 VECTOR or HYBRID — verify the flags.95- **HYBRID chosen for everything.** Either the workload is genuinely agentic96 (legitimate — that is the book's default) or the signals are under-specified;97 add concrete scope/type/multi-hop values.98- **A GRAPH/HYBRID recommendation adopted without reading `graphrag_costs`.**99 The upfront-construction and maintenance cost is real; budget for it before100 committing.101102## Non-Negotiable Verification1031041. **Run the benchmark battery.** `python cli.py benchmark` must report 8/8:105 - DataLocal lookup -> VECTOR; ActivityGlobal multi-hop -> GRAPH; agentic ->106 HYBRID; graph-signals + unstructured -> HYBRID107 - the larger-context-window flag attaches the 1M-token rebuttal108 - 100k+ pages attaches the EyeLevel 12%-vs-2% scale note109 - GRAPH/HYBRID surface GraphRAG costs; VECTOR does not110 - the ActivityGlobal quadrant carries the 20-30% anchor1112. **Verify CLI help.** `python cli.py --help` exits 0 and prints the SKILL.md112 description.1133. **Inspect the scenario.** `python cli.py scenario devops` should recommend114 VECTOR for the 5xx lookup, GRAPH for the cascading-migration query, and115 HYBRID for the autonomous agent.116117## Security Posture118119- **Prompt injection.** The selector consumes structured flags and booleans,120 not free-text documents, so there is no injection surface in `lib.py`. The121 numeric anchors and rebuttal text are author-controlled constants, not122 model-generated.123- **Data exfiltration.** No network calls; the only file read is the workloads124 JSON path the caller supplies (default: the bundled sample). `--json` output125 goes to stdout.126- **Privilege escalation.** No shell invocation, no dynamic import, no file127 writes. The recommendation is advisory; it selects an architecture and does128 not touch any datastore or credential.129- **Decision integrity.** Treat the recommendation as a starting point, not a130 mandate — the chapter's numbers are reported so a human can audit the131 rationale rather than trust an opaque verdict.132133## Source Attribution134135Distilled from *Agentic GraphRAG* (O'Reilly, by Anthony Alcaraz and Sam Julien), Chapter 1 —136Defining Agentic AI, "The Limitations of Vector-Based Retrieval" and137"GraphRAG" sections. The BenchmarkQED quadrants, the 90% / 20-30% vector-RAG138numbers, the LazyGraphRAG +50-60% multi-hop figure, the EyeLevel.ai13912%-vs-2%-at-100k-pages result, and the ~1-million-token larger-context-window140rebuttal are all the chapter's, anchored in Microsoft's "From Local to Global:141A GraphRAG Approach to Query-Focused Summarization" and BenchmarkQED research.