Logo: Vector Vs Graph Retrieval Selector

Vector Vs Graph Retrieval Selector

Communautéit
AnthonyAlcaraz
vector-vs-graph-retrieval-selector

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.

Iwwersiicht

EditeurAnthonyAlcaraz
Repositoryagentic-graph-rag-skills
Skill-Nummvector-vs-graph-retrieval-selector
Stären
29
Forks
9
Matgeliwwert Dateien
3
LizenzMIT
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 3 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    AnthonyAlcaraz huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Vector Vs Graph Retrieval Selector an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/crisis/vector-vs-graph-retrieval-selector
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills.git /tmp/agentic-graph-rag-skills
mkdir -p .claude/skills
cp -r /tmp/agentic-graph-rag-skills/skills/crisis/vector-vs-graph-retrieval-selector .claude/skills/vector-vs-graph-retrieval-selector
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert Vector Vs Graph Retrieval Selector an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Vector Vs Graph Retrieval Selector automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Vector Vs Graph Retrieval Selector net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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

StepInputActionOutputVerification
1scope / type / multi-hop / temporal / structure / scale / latencylib.recommend(...)VECTOR / GRAPH / HYBRID + reasonsDataLocal lookup -> VECTOR; ActivityGlobal multi-hop -> GRAPH
2agentic workloadrecommend(..., agentic=True)HYBRIDagent workloads default to the parallel hybrid
3graph signals + unstructured/latency-criticalrecommend(...)HYBRID (not pure GRAPH)costly-graph condition down-shifts GRAPH -> HYBRID
4larger_context_window=Trueread larger_context_window_rebuttalthe ~1M-token rebuttal textrebuttal cites the 1M-token BenchmarkQED test
5dataset_scale_pages >= 100000read scale_noteEyeLevel 12%-vs-2% notescale note present at 100k+ pages
6GRAPH/HYBRID resultread graphrag_coststhe four GraphRAG strugglescosts present for GRAPH/HYBRID, absent for VECTOR
7list of workloadslib.recommend_batch(...)per-workload + tallytally sums to the workload count

Rationalizations

Agent rationalizationDocumented 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

  1. 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
  2. Verify CLI help. python cli.py --help exits 0 and prints the SKILL.md description.
  3. 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.

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill Vector Vs Graph Retrieval Selector?

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 reb...

Firwat Vector Vs Graph Retrieval Selector op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Vector Vs Graph Retrieval Selector besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Vector Vs Graph Retrieval Selector an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/AnthonyAlcaraz/agentic-graph-rag-skills/tree/main/skills/crisis/vector-vs-graph-retrieval-selector an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Vector Vs Graph Retrieval Selector benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Vector Vs Graph Retrieval Selector benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Vector Vs Graph Retrieval Selector domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Vector Vs Graph Retrieval Selector gratis?

Jo. AnthonyAlcaraz huet de Skill ënner der Lizenz MIT op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇