← Back to list

Why Does RAG Need a Vector Database? Actually, It Doesn’t

Vector databases are useful, but they are not the whole RAG architecture. The mistake is thinking embeddings magically solve retrieval…

Hui Wang · 2026-06-08 20:56 · 0 claps · 3.0 min read
#artificial-intelligence #rags #vector-database #llm #search
Open on Medium ↗
Wiki topics: LLM · Large Language Models RAG · RAG & Retrieval AI · AI · General GEN · Genomics & Sequencing 🏛️ · Architecture

Why Does RAG Need a Vector Database? Actually, It Doesn’t

Vector databases are useful, but they are not the whole RAG architecture. The mistake is thinking embeddings magically solve retrieval. They do not. They solve one kind of retrieval problem: semantic similarity.

The harder production problem is different: can your system retrieve the exact evidence the model needs, without flooding it with almost-relevant noise?

That is why serious RAG systems usually move toward hybrid retrieval plus reranking, not “vector search only.” The source material gets this core point right: vectors are strong at meaning, but weak at exact identifiers, numbers, codes, and domain-specific tokens.

The key idea

A RAG pipeline has two jobs before the LLM ever starts writing:

  1. Recall enough potentially useful documents.
  2. Precision-rank them so the LLM sees only the best evidence.

Vector search helps with recall when users phrase things differently from the documents. Keyword search helps when exact terms matter. Reranking helps decide which candidates are actually worth sending to the model.

That is the real pattern:

User query
  -> Vector search for semantic matches
  -> Keyword/BM25 search for exact matches
  -> Merge results with RRF or similar fusion
  -> Rerank top candidates
  -> Send only the strongest evidence to the LLM

Azure AI Search documents this pattern directly: hybrid queries produce multiple ranked result sets and merge them using Reciprocal Rank Fusion. OpenSearch also supports hybrid queries that combine keyword and semantic retrieval. Pinecone’s docs similarly describe dense vectors for semantic search, sparse vectors for lexical search, and reranking at different stages.

Core example

Problem:

User asks: "How do I fix error code 503?"

Naive vector-only retrieval:

Query embedding: "How do I fix error code 503?"

Top results:
1. "How to fix HTTP 404"
2. "Common server error troubleshooting"
3. "How to fix HTTP 500"
4. "Error code 503: service unavailable"

This looks plausible, but it is dangerous. To an embedding model, 503, 404, and 500 may sit near each other because the surrounding language is similar: “HTTP error,” “fix,” “server,” “status code.” But for the user, 503 is not “kind of like 404.” It is a different failure mode.

Better retrieval:

Step 1: Vector search
- Find semantically related troubleshooting docs.

Step 2: Keyword/BM25 search
- Require strong matches for "503".

Step 3: Merge with RRF
- Promote documents that rank well in either or both result sets.

Step 4: Rerank top 50 candidates
- Cross-check the query against each candidate passage.

Final context to LLM:
1. "Error code 503 means service unavailable..."
2. "503 during deployment: upstream health check failure..."
3. "Fixing 503 in Nginx reverse proxy..."

Why this works:

Vector search answers, “What sounds related?” Keyword search answers, “What contains the exact thing the user asked for?” RRF gives both retrieval paths a fair way to contribute candidates. Reranking then performs the expensive but more accurate comparison only on a smaller candidate set.

The win is not that hybrid retrieval is more complex. The win is that the complexity is placed where it reduces hallucination: before the LLM sees the context.

One practical limitation

Hybrid retrieval is not free.

You now maintain multiple retrieval signals: embeddings, lexical indexes, metadata filters, and possibly a reranker. Latency and cost increase, especially when a cross-encoder reranker compares the query against dozens of candidate chunks.

That trade-off is usually worth it for enterprise knowledge bases, support systems, contracts, incident reports, legal documents, and technical documentation. It may be overkill for a small FAQ where keyword search already works well.

The practical engineering judgment is this: do not add hybrid search because it sounds advanced. Add it because your failure cases prove vector-only retrieval is returning semantically similar but factually wrong context.

Practical rule

Use vector search for meaning, keyword search for exactness, metadata filtering for scope, and reranking for final judgment.

A strong RAG system is not “the one with a vector database.” It is the one that retrieves the right evidence under real user queries.

Conclusion

  • RAG does not require a vector-only mindset.
  • Vector retrieval is strong for semantic recall, but weak for exact codes, numbers, IDs, and proper nouns.
  • Hybrid retrieval fixes this by combining semantic and lexical signals.
  • Reranking matters because the LLM should receive the cleanest evidence, not the largest pile of candidates.
  • Interview-friendly sentence: “In production RAG, vectors are a core retrieval signal, but hybrid retrieval plus reranking is often the more reliable architecture.

메타데이터
post_id
eececfb82dff
slug
why-does-rag-need-a-vector-database-actually-it-doesnt-eececfb82dff
url
https://medium.com/@foks.wang/why-does-rag-need-a-vector-database-actually-it-doesnt-eececfb82dff
canonical_url
https://medium.com/@foks.wang/why-does-rag-need-a-vector-database-actually-it-doesnt-eececfb82dff
author_url
https://medium.com/@foks.wang
status
ok
fetched_at
2026-06-09 15:37:30