RAG is a data-cleaning problem wearing a trench coat
Most retrieval-augmented systems fail because of chunking, duplication, and stale documents — not because of embeddings.
By Nzubechukwu Cyprian · Pharmacy student at UNN, full-stack developer
I built a small retrieval-augmented answer system for project documentation, and I learned the lesson everyone learns: the embeddings were never the problem.
My first version answered questions by retrieving the top few chunks and trusting the model to make sense of them. It hallucinated constantly. The fix, in order of impact:
- deduplicating content — the same instructions existed in four documents with slightly different wording, and retrieval happily returned all four
- fixing chunk boundaries — my chunks split mid-sentence, so the "answer" was literally fragments
- adding metadata filtering — questions about version 2 were being answered with version 1 docs
- only then, tuning the model prompt
The 80/20 of RAG quality
- clean the corpus before touching the pipeline
- chunk on structural boundaries: headings, sections, paragraphs — never mid-sentence
- store metadata (date, version, source) and filter with it
- log which chunks were retrieved, because when answers go wrong, that's your first suspect
The reframe that helped
A RAG system is a librarian, not an oracle. If the library is a mess, the most brilliant librarian in the world will fetch you the wrong book with total confidence. Spend your effort on the library.
Keep reading
- AI
The model is not the product
Everyone debates which model is smartest. Almost nobody talks about the ninety other things standing between a prompt and a shipped feature.
- AI
My AI workflow is boring, and that's the point
No autonomous agents rewriting my codebase. No prompt wizards. Just a disciplined loop between a draft, a review, and a test suite.
- AI
Prompting is just requirements gathering with worse vocabulary
The teams that get good results from AI aren't better at talking to models. They're better at saying what they want.