Start RAG from what success looks like

People often treat RAG as vector search. That mistakes one method for the definition. The better starting point is what success looks like.

RAG adds context for generation

The original RAG paper defines it as a model’s internal memory plus an external memory. The vector index was the paper’s implementation, not part of the definition, and the paper also tried BM25 as the retrieval method.

In plain words, RAG adds the context an LLM needs before it generates an answer. Many methods can fetch that context, and embedding search is one of them.

Start from success

So the starting point is not a tool. It is a question. When the system succeeds, what does the user see?

  1. Define success. Write down what the user asks and what a good answer looks like. The answer might be one fact, a set of items that match a condition, a reasoned explanation with sources, or a summary across several documents. Be specific enough to turn it into a test question.
  2. Work out the context you need. For the LLM to produce that answer, it must see something concrete. That might be one field value, a few sections, the result of a filter across documents, or a whole document.
  3. Pick the simplest method that fetches that context. Choose the tool at this step, not before.

With a small corpus, the answer to step 3 may be no retrieval at all. Anthropic suggests that a knowledge base under about 200,000 tokens (about 500 pages) can go straight into the prompt. That is a vendor recommendation, so check it against your own model and cost.

LLMs bring query expansion back

On the query side, an LLM essentially recognizes intent. It reads what the user wants, then rewrites the question into a form the retrieval system can handle. That is the idea behind query expansion, done much better now. query2doc expands the query with a pseudo-document that an LLM generates. HyDE retrieves with a hypothetical document that an LLM generates in place of the query. Both rewrite the query side with an LLM.

Few people talk about this. While embeddings were the focus, most attention went to document vectors, and the query side got one embedding call. LLMs put the query side back at the center.

Intent recognition can be wrong. I expect errors to raise failure rates and cost, but I found no data. Turnbull points out that a classic RAG pipeline is linear, so every step must succeed and the whole thing is fragile. He argues for an escape hatch that lets the agent try again when the results are poor. So build in retries and a fallback, and do not assume one attempt is enough.

No good tools, only fit

Intent recognition routes the question to a method. Each method solves one kind of question.

Methods also combine. Anthropic reports that BM25 plus embeddings beats embeddings alone, measured on its own datasets. Vector search used alone has a limit too. Turnbull points out that a similarity score cannot decide by itself whether a result matches, and a cutoff that suits one query can be bad for another.

Treating any one of them as a general solution leads to errors.

Keep the ability in the success criteria

Because the success criteria are specific, the evaluation follows them. Prepare a separate set of test questions for each kind of question, and score each set on its own. If you blend all the questions into one score, you cannot see which kind broke.

The success criteria and the test sets are the part of the system that can grow. A new edge case goes into the matching set. When the data grows, you run the same questions to confirm quality held. When you swap a tool, the test set stays the same. You can compare the old tool and the new one on the same questions and confirm the new one did not regress.

So the ability to solve the problem does not depend on a tool. It can grow, and it can move.

Before you choose any tool, write down the success criteria, then write the first set of test questions for each kind of question.

References