Methods  β€Ί  Vector RAG
Method reference Β· retrieval

Vector RAG (top-k retrieval)

First, embed all your notes. When a user asks a question, embed the question too. Then, find the most similar note chunks and paste them into the prompt. The model only sees what you give it. But similarity doesn't tell you which information is most current.

Embeddings + vector DB Scales to huge corpora Similarity β‰  recency / authority Correctness depends on the agent choosing to retrieve

What it is

Vector RAG turns your documents into numbers called vectors. When a user asks a question, it turns the question into a vector, too. It then finds the most similar document chunks (the top-k nearest neighbors). These chunks are added to the model's prompt for context. The model doesn't memorize the documents. It only sees the chunks provided for that specific question. In our test, we used an all-MiniLM search_memory tool to find the top chunks from our notes.

Setup

  1. Chunk β€” Split your documents into smaller passages. You can split them by section or into fixed-size pieces. The size of these chunks is the most important factor for quality.
  2. Embed β€” Turn each chunk into a vector using an embedding model like all-MiniLM-L6-v2. Store this vector along with the original text and its details, like its file path and timestamp.
  3. Store β€” Load the vectors into a special database called an index. Examples include FAISS, Chroma, pgvector, Qdrant, or Pinecone.
  4. Retrieve β€” When a user asks a question, embed it. Find the most similar chunks (the top-k). Then, add them to the prompt. If a document changes, you must update the index. Otherwise, your information will become outdated.

Architecture sketch

repo/
β”œβ”€ docs/                    # the corpus: notes, decisions, PRDs, threads
β”œβ”€ ingest/
β”‚  β”œβ”€ chunk.py              # docs β†’ passages (fixed | semantic | by-heading)
β”‚  └─ embed.py              # passages β†’ vectors (e.g. all-MiniLM-L6-v2)
β”œβ”€ store/index              # {vector, text, meta:{path,heading,mtime}}
β”œβ”€ retriever.py             # query β†’ embed β†’ top-k ANN (+ BM25 hybrid + rerank)
└─ agent.py                 # search_memory(query) tool β†’ top-k chunks β†’ prompt β†’ LLM

The model only sees the retrieved chunks, not all your documents. This helps it handle large amounts of information. But it's also a risk. If the right answer isn't in the top few chunks, the model will never see it.

Pros & cons

Strengths

  • Works with huge document sets. You can store millions of chunks but only use a few in the prompt. The number of documents doesn't limit the prompt size.
  • Easy to update. You don't need to retrain the model. Just edit a document, re-embed it, and the new information is ready to be found.
  • Keeps data private. You can search a user's private data without training the main model on it.
  • Provides sources. Because it uses specific chunks, you can see where the information came from. This makes it easier to check for errors.

Weaknesses

  • Similarity isn't authority. The system doesn't know what's new or what's the final decision. It often returns outdated information that just looks similar.
  • Finds matching words, not meaning. It can pull up fragments that contain the right keywords but miss the actual point.
  • Splitting documents can break them. If a key fact is split between two chunks, the model can't answer questions about it.
  • Gets outdated easily. You must re-process every document that changes. If you don't, the search index won't match the real documents.
  • The 'top-k' setting is unreliable. It's hard to find a value for 'k' (how many chunks to retrieve) that works consistently.
  • If retrieval fails, the model makes things up. When it gets the wrong context, it will still answer confidently, but incorrectly.

Common user feedback

This feedback comes mainly from Hacker News. The point about 'top-k' instability is from a research paper. We also cite Cline, a company that sells an alternative to Vector RAG. They are a biased source, but many others share their complaint.

How it did in our benchmark

We tested this using only a search_memory tool with an all-MiniLM model. The score shows how many of the 6 facts were current. We averaged the results of 3 runs.

metricOpus 4.8Haiku 4.5
facts current6/60/6
retrieval tool callsseveral0 (never called it)
This test showed two kinds of failure. A capable model like Opus scored 6/6. But its success depends on the model choosing to search for information. Haiku scored 0/6 because it made zero tool calls. It never used the search_memory tool, even though the facts were easy to find. A deeper problem also exists. The system ranks results by similarity, not authority. It might retrieve an old, plausible document instead of the current one. Vector RAG scales well, but it isn't built to know which decision is final. See the full results β†’
This is part of the methods reference for our stale-context benchmark. Quotes are taken directly from Hacker News and the cited paper. We have noted which sources come from vendors.