Demos lie politely
A retrieval-augmented generation (RAG) demo is easy: load ten documents, ask three friendly questions, get three good answers. Production is different. Real users ask vague questions, documents contradict each other, and the right answer is often "we don't know".
Start with an evaluation set, not a vector database
Before choosing an embedding model or a chunk size, we collect 50 to 200 real questions with known good answers. That set decides every later choice. Without it, "it feels better" is the only metric you have.
Rule of thumb
If you can't say how often your RAG system is wrong, you can't ship it.
Chunking is a product decision
- Chunk by meaning, not by character count. Headings, list items and table rows are natural boundaries.
- Keep the context. Store each chunk with its document title and section path so the model knows where it came from.
- Test two or three strategies against the eval set. The winner is rarely the one you expected.
Retrieval needs a second opinion
Vector search finds text that is similar, which is not always text that is relevant. A reranking step, plain keyword search alongside embeddings, and metadata filters (date, product, region) fix most "it found the wrong policy" bugs.
Teach it to say "I don't know"
The most valuable answer a support copilot gives is a confident refusal when the documents don't cover the question. We measure that explicitly, and route those cases to a human.
Watch it after launch
Log every question, the chunks retrieved and the answer. Review a sample every week and add the failures to the eval set. RAG systems don't stay good by themselves; they stay good because someone keeps feeding the evals.
Pasindu Oshahda, Senior AI Native Developer
AI features, agents, full-stack delivery