Layer · Data

    Your RAG is only as good as its corpus

    Layer · Data, retrieval-augmented generation is a data problem in a tooling costume. Qualify the corpus, or tune the retriever forever.


    Mark Rhys Thomas · June 4, 2026 · 5 min

    Retrieval-augmented generation gets talked about as a clever technique. Teams reach for it as an architecture decision. And then they are surprised when it returns confident nonsense.

    Retrieval-augmented generation gets talked about as a clever technique, a way to make a model answer from your documents instead of its own memory. Teams reach for it as an architecture decision, a thing to stand up, a box on a diagram. And then they are surprised when it returns confident nonsense.

    The surprise is the tell. RAG is not a tooling problem. It is a data problem wearing a tooling costume.

    Strip it back and a RAG system is simple. It retrieves from a corpus, and it hands what it finds to a model to answer with. The model's answer is only ever as good as what the retrieval pulled. And what the retrieval pulled is only ever as good as the corpus it pulled from. The corpus is the raw material. Everything true of raw material is true here, in full.

    Almost everywhere, that corpus is unqualified. A team points the system at a SharePoint, a shared drive, a decade of accumulated documents nobody has curated, and assumes the retrieval will sort the good from the bad. It will not. It will surface the superseded SOP with exactly the same confidence as the current one. It will return the old label beside the approved label, the draft next to the final, the rumour next to the record. Garbage retrieved is garbage answered, only faster and in a more fluent voice.

    The disciplines from the rest of this layer apply directly, with no translation needed. Contamination: a corpus thick with stale, duplicated, and superseded documents is a contaminated input, and the system has no way to tell. Suppliers: every document in that corpus came from somewhere, with rights and a provenance you either know or you do not. Specification: a corpus needs acceptance criteria as much as any batch does, what is allowed in, what is kept current, what is retired, and who owns the answer.

    So the reframe for the team is blunt. Stop tuning the retriever and start qualifying the corpus. A controlled, current, owned corpus with mediocre retrieval will beat a brilliant retriever pointed at a junk drawer, and it is not close. Pharma already runs controlled document sets, with versions, effective dates, and named owners. The corpus behind a RAG system should be held to that same standard, because that is precisely what it now is: a controlled document set that a machine reads on your behalf and answers from in your name.

    The model is rented. The retriever is fast becoming a commodity. The corpus is the one part that is actually yours, the one part that is raw material, and it is the part nobody is qualifying. That is not where the attention goes. It is where the failures live.