Skip to main content

Knowledge Graph vs. Vector Store: Choosing Your Retrieval Primitive

· 9 min read
Tian Pan
Software Engineer

Most teams stumble into vector stores because they're easy to start with, then discover a category of queries that simply won't work no matter how well they tune chunk size or embedding model. That's not a tuning problem — it's an architectural mismatch. Vector similarity and graph traversal are fundamentally different retrieval mechanisms, and the gap matters more as your queries get harder.

This is not a "use both" post. There are real trade-offs, and getting the choice wrong costs months of engineering time. Here's what the decision actually looks like in practice.

What You're Actually Choosing Between

A vector store maps content into high-dimensional embedding space. Retrieval finds documents whose embeddings sit nearest to a query embedding. The mechanism is probabilistic, latency is sub-50ms at scale, and it requires no schema design. You feed documents in, query comes out.

A knowledge graph represents data as typed nodes connected by labeled edges. An employee node connects to a department node via a works_in edge. A drug node connects to a disease node via a treats edge. Retrieval is deterministic: write a Cypher or SPARQL query to follow specific relationship paths to specific entities.

The difference isn't just technical. Vector stores answer "what is semantically similar to this?" Knowledge graphs answer "what is structurally related to this, and how?"

Where Vector Search Wins and Why

Vector stores handle unstructured text, images, and audio in a unified way. You don't need a schema, you don't need domain experts to define relationships, and you can start returning useful results within hours. For the canonical RAG use case — "here's a corpus of documents, answer questions from it" — vector retrieval is correct by default.

The failure mode to know: vector search finds documents that look like the query, not documents that answer the query through a chain of reasoning. Searching a medical corpus for "aspirin contraindications for cardiac patients" retrieves documents about aspirin and documents about cardiac patients, but cannot automatically synthesize "aspirin thins blood" with "this patient is scheduled for surgery" to produce the correct contraindication. Those facts may live in separate documents with no shared vocabulary, and an embedding-based retriever has no way to join them.

This is not a chunking problem. Bigger chunks don't help if the causal chain spans three documents from different authors written five years apart. The retriever needs to traverse a relationship, not match a similarity.

Vector search also struggles with aggregation queries. "What is the total revenue across all subsidiaries of Acme Corp?" requires knowing the subsidiary relationships explicitly. Embedding space has no notion of ownership hierarchies. You'll retrieve documents about Acme Corp and adjacent entities, but you cannot sum across the right set of companies without structural knowledge of who owns whom.

Where Knowledge Graphs Win and Why

Knowledge graphs exist for exactly the cases where structure encodes meaning that semantics cannot capture.

Multi-hop reasoning is the primary example. Given entities A, B, and C with typed relationships, a graph query can traverse A→B→C in a single pass: "Find all drugs prescribed by doctors who treated patients diagnosed with condition X in 2023." Vector search has no analogue. You'd need multiple retrieval calls, manual synthesis, and significant LLM reasoning to approximate what a graph query returns directly.

Benchmarks illustrate the gap starkly. On cross-document reasoning tasks — questions that require synthesizing facts from multiple sources — graph-based retrieval retrieves the relevant information about 33% of the time versus 8% for vector-only RAG. For aggregation queries (count, sum, filter over relationship chains), graph retrieval scores around 23% versus near zero for vectors.

Entity disambiguation is another strong argument for graphs. Vector search treats "Apple" (company) and "apple" (fruit) as similar based on co-occurrence patterns in training data. A knowledge graph distinguishes them via explicit entity type: an Organization node named "Apple" has completely different edges than a Food node with the same label. When you're building financial or scientific applications where entity confusion causes real errors, this is not a minor issue.

Compliance and auditability also favor graphs. Every answer from a knowledge graph comes with a provenance chain: the exact sequence of nodes and edges that produced the result. Vector similarity scores tell you a document was 0.87 similar to the query; they cannot tell you why or through which conceptual path. In regulated industries, "similar embeddings" is not an acceptable audit trail.

The Query-Type Test

The decision reduces to a single diagnostic: what does your query distribution actually look like?

Run your representative queries through this classification:

Vector-appropriate queries have a single focal entity or concept, require semantic matching across varied vocabulary, and can be answered from a single retrieved chunk or a simple combination of a few chunks. "What is the company's return policy?" "Summarize the findings of this report." "Find documents about machine learning infrastructure."

Graph-appropriate queries require traversing relationships across entities, involve aggregation over sets defined by structural membership, need temporal reasoning (what was true in period X), or require disambiguation between entities that share names or surface-level semantic similarity. "What are the downstream dependencies of Service A?" "Which customers have an active subscription and an open support ticket and made a purchase in the last 30 days?" "Show me all transactions where the initiating party is connected to a flagged entity within two degrees."

If more than 20% of your query distribution falls into the second category, a pure vector approach will deliver chronic accuracy failures on exactly the cases that matter most.

What Hybrid Architecture Actually Looks Like

The "use both" recommendation is often vague. Here is the concrete architecture:

The query is classified at intake — either by a lightweight intent classifier or by explicit routing rules. Semantically fuzzy questions go to the vector retriever. Structural questions go to the graph retriever. Mixed questions go to both, with results merged before the LLM generates a response.

In the merge step, both result sets are labeled with their source so the LLM can apply different reasoning strategies: "these are semantically similar documents; these are structurally related entities." Without labeling, the LLM has no basis for weighting the two result types differently.

The implementation overhead is real. You maintain two systems, two indexing pipelines, and an orchestration layer. The latency budget increases: vector retrieval runs in 15-50ms, graph traversal in 100-300ms, coordination adds another 50ms. Plan for 200ms total for hybrid retrieval versus 50ms for vector-only.

Whether that overhead is justified depends entirely on whether your application has the query types that graphs solve. If 80% of your queries are semantic document search and 20% require multi-hop reasoning, you are probably not building a hybrid system for that 20% — you're simplifying the 20% until vectors can handle it, or you're accepting lower accuracy on those queries.

If your product depends on the 20%, build the hybrid.

The Cold-Start Trap in Graph Adoption

Teams that recognize they need knowledge graphs often hit a wall: building a useful graph requires entity extraction, relationship extraction, schema design, and ongoing maintenance. None of this has zero cost.

The entity extraction problem is frequently underestimated. General-purpose LLMs extract entities well from general text. For domain-specific corpora — clinical notes, legal contracts, financial filings — extraction quality degrades substantially on specialized terminology. You may need task-specific extraction pipelines before the graph is reliable enough to use.

Schema design compounds the problem. A vector store has no schema; indexing a new document type is trivial. A knowledge graph has an explicit ontology, and that ontology encodes your assumptions about the domain. When the domain evolves — new product lines, regulatory changes, organizational restructuring — the graph schema needs updating or the graph produces stale answers. Budget for ongoing schema governance, not just initial construction.

A practical approach: start with vector retrieval across your full corpus. Instrument your system to identify which queries fail due to multi-hop reasoning gaps. Use those failures to define the entities and relationships your knowledge graph actually needs to represent — rather than building a comprehensive ontology upfront that may not reflect real query patterns.

Decision Criteria in Practice

Start with a vector store if:

  • Your data is primarily unstructured text, images, or audio.
  • Queries are semantic and single-focus.
  • Latency requirements are below 100ms.
  • You need results in weeks, not months.
  • Your team has limited graph database experience.

Invest in a knowledge graph if:

  • Relationships between entities are the primary thing you're querying.
  • Aggregation, multi-hop traversal, or temporal reasoning are core to your use case.
  • Explainability or audit trails are requirements.
  • You're in a domain (finance, healthcare, legal) where entity disambiguation failures have real consequences.
  • Your query distribution shows chronic accuracy failures on relational questions despite vector tuning.

Build hybrid retrieval if:

  • Both semantic search and relational queries are important to your users.
  • You can absorb 200ms retrieval latency.
  • The team can maintain two indexing pipelines long-term.
  • A 15-25% accuracy improvement on complex queries justifies the infrastructure complexity.

The Underlying Principle

Vector similarity and graph traversal are not competing products. They are different mathematical operations that answer different questions. Vector search is a proximity function in embedding space. Graph traversal is a path-finding function in relationship space.

The failure mode teams keep hitting is using proximity to answer path questions. The embeddings for "subsidiary" and "revenue" will cluster near "Acme Corp" in vector space, but no distance calculation tells you which entities are subsidiaries of Acme Corp or what their individual revenues are. That's not a model quality issue — it's using the wrong primitive for the question.

When your application's hardest queries are fundamentally about relationships, structure, and traversal, a knowledge graph is not an over-engineered alternative to a vector store. It's the correct tool.

References:Let's stay in touch and Follow me for more thoughts and updates