My first time building RAG (retrieval-augmented generation), I spent three weeks on embeddings (models that turn text into vectors). I moved from a small model to a larger one, then to a multilingual version, and the evaluation score went up by less than two points.
Later I printed out the bad cases (failed question-answer pairs) one by one and looked at them. Seventy percent had nothing to do with the vector store.
Those three weeks weren’t wasted, but they weren’t addressing the main problem.
Most errors happen before retrieval
The first is chunking. Documents are split by fixed length, and a condition’s explanation and its exception easily end up in two different chunks. Retrieval only hits the first half, so the model answers with the first half, and in a very confident tone. This kind of error is the easiest to miss during spot checks: the answer reads smoothly, it’s just incomplete. You can only tell it’s missing a piece if you already know the correct answer should include that exception. So I later tagged every question in the evaluation set with “key conditions that must appear,” and marked it wrong if any were missing, no matter how smoothly it was written.
When changing the chunking method I also stepped into the other ditch: fixed-length splitting didn’t work, so I switched to splitting by section, keeping chunks at a few hundred tokens with a little overlap between adjacent chunks. Overlap prevents a sentence from being cut in half, but it doesn’t solve “condition and exception split apart”—that’s the document’s own structure. Either you recognize it during chunking, or you just hand the whole section to the model, trading context budget for completeness.
The second problem is in the question itself. A user asks “can I return it,” while the document says “return conditions.” Semantically very close, but the intent is far off. Real users also often omit the subject and scenario—which type of order, how long ago it was bought, whether it’s been opened—this information simply isn’t in the document, and no amount of retrieval accuracy can fill it in. The solution to this kind of problem isn’t at the retrieval layer: either complete the colloquial phrasing during query rewriting, or bring structured fields like order status and user identity in as filter conditions at the product layer. Expecting vectors to understand a context they’ve never seen is pushing what the product should do onto the model.
The third is context assembly. The retrieved snippets are correct, but when they’re assembled the order is wrong, and the model treats supplementary notes as the main clause. I later added source and section titles before each snippet, and this kind of error dropped noticeably. Adding titles is a cheap move, but it gives the model a clue about “which part this belongs to.” When the model judges what’s primary and what’s secondary, it often relies on this kind of structural signal, not the similarity score.
Vector retrieval solves “can it be found,” not “is the answer right.”
More candidates, more noise
I ran a very simple experiment: change top-k from 5 to 20, leave everything else alone.
Accuracy actually dropped. Among the extra fifteen snippets, some were genuinely relevant, and some were only similar on the surface of words. The model’s attention got diluted, answers started to become vague, and things that could be said in one sentence started getting hedged with “generally speaking” and “please refer to the page for details.”
Treating the context window as “more can’t hurt” is a very common misjudgment. The model’s context isn’t a warehouse, it’s a workbench. The more stuff piled on the bench, the more likely it grabs the wrong sheet of paper. There’s an even trickier phenomenon in long contexts: information in the middle position is most easily discounted—put the correct answer in the seventh or eighth paragraph, and the model may just act like it didn’t see it.
The effective approach is to add a reranking layer rather than keep expanding recall:
1 | chunks = split(doc, by='section', max_tokens=400, overlap=50) |
Another approach is to tier by question type: 3 results for precise field-type queries, 10 for open-ended questions. Tuning top-k with a one-size-fits-all value is essentially shuffling back and forth between two kinds of error—too few causes missed recall, too many introduces noise—and the “optimal value” in between drifts as documents get updated.
Reranking makes mistakes too; it can push the correct answer down. So I keep the rankings before and after reranking, so that when something goes wrong I can compare which step lost it. Also, the reranking model, like the embedding model, needs to have seen bad cases from your business corpus—a general model isn’t necessarily more reliable than keywords on specialized terminology.
The cost is latency, a few hundred extra milliseconds per query. Added to a pipeline that already takes two or three seconds, users barely notice; added to a search box that’s supposed to show results as you type, it’s very noticeable. So reranking isn’t worth it in every scenario—first look at how long users can wait, then at whether this error is worth that wait.
The three things I now do first
The order has changed.
First build an evaluation set of about fifty questions, all from real users, not made up. Made-up questions are too tidy and don’t cover real vague expressions. Real questions have typos, colloquialisms, omissions, and some are continuations of the previous turn. You can’t come up with these things sitting at your desk. The evaluation set also can’t be locked down once built—new failure phrasings need to be added in batches over time, otherwise it quickly drifts from the real distribution, and the score looks good but is useless.
Then print out the raw text of every retrieval, and don’t look at the score—just look at whether the content is right. High score but wrong content is more common than you’d think, especially when the query and the document happen to share a few keywords. Similarity measures distance in vector space, not “can this snippet answer the question”—these two things diverge especially easily on short queries, specialized terminology, and negative sentences. A typical trap: the query contains a “not,” and everything retrieved is the passage without the “not.”
Only then decide whether to bring in a vector store. In many scenarios, keyword retrieval plus structured filtering is already enough, and the results are explainable. When something goes wrong, you can say clearly why this result was retrieved—was it because it hit the word “refund,” or because the category in the filter condition matched. When vector retrieval goes wrong, you’re often just staring at a score of 0.83.
Some scenarios where I really don’t use a vector store
When the document volume is in the hundreds to thousands, terminology is stable, and user phrasings basically stick to the original text—internal policy libraries, product spec queries, ticket classification—keyword plus field filtering already gives enough recall, with much lower maintenance cost and easier troubleshooting.
Conversely, the places where vector retrieval is irreplaceable are also clear: user phrasings don’t match document wording, there are many synonymous expressions, cross-language is needed, and documents are long-form rather than structured entries. In most cases the real answer is hybrid retrieval: keywords guarantee the floor, vectors supplement recall, reranking closes the loop. You don’t need all three layers, but every layer you add must come with a clear explanation of which type of error it blocks. If you can’t explain it, don’t add it yet—otherwise you’re just adding dimensions for yourself to tune.
This is also why I think vector store selection is the least worth agonizing over. The differences in recall quality among the mainstream options are usually smaller than the differences caused by chunking strategy; what really separates them is everything outside the index—how documents are organized, how permissions are filtered, how old vectors are invalidated after documents are updated. Nobody puts these in the selection comparison table, but they determine whether this thing is still usable three months after launch.
The parts I still haven’t solved
I’ve never handled coreference in multi-turn conversations well. When the user says “what about this one,” the retrieval layer doesn’t get enough information and can only guess based on the previous turn’s context. This looks like a retrieval problem, but it’s actually session state management. To solve it, you have to explicitly extract the entities already established in the conversation into a state, then use that state to construct the query. Most teams skip this step, retrieve directly with the last sentence, and then wonder why the results are bad.
Evaluation metrics have traps too. Recall and answer correctness are two different things; the former can be inflated by loosening the threshold, and the latter won’t move with it. In my current evaluation set, every question is tagged with a reference answer and the key conditions that must appear, and I only look at the final answer, not the intermediate scores. Intermediate scores are good for locating which layer the problem is in, not for reporting progress.
I now prefer to view RAG as a data engineering problem. Retrieval and models come after it; doing things in reverse order can still run, but you’ll get stuck somewhere and have to start over.
So next time someone asks me which vector database to choose, I’ll probably first ask: where is your evaluation set, and who defined the chunking rules.
Further reading: A few questions to tell whether someone has done RAG, Whether RAG is done well is mostly determined by chunking and context layout
Comments