Models · English edition
Choosing a RAG corpus: define the question before the documents
Practitioner methodology · key facts carry official sources
A RAG corpus is not “the more the better”. Write down what users will ask, which document family should answer, and whether the documents change, before deciding what to collect, how to chunk and how to evaluate.
Write 20 real questions first
Start from questions users actually ask, not from the documents you happen to have. For each question, mark the document family, whether it needs multiple hops, whether it is time-sensitive and whether permissions apply. If 15 of 20 answers live in one small set, build that set first.
Document quality beats chunk size
Duplicate, stale and contradictory documents make retrieval look good while answers conflict. Deduplicate, mark versions, mark invalid documents and mark permissions before tuning chunk size. Preserve heading hierarchy and table structure; splitting a table into fragments makes relations hard to recover.
Evaluate retrieval and generation separately
Retrieval is measured by recall and ranking: did the right passage enter the top k, and at what rank? Generation is measured by faithfulness and completeness: did the answer use only retrieved content, and did it miss a key condition? Do not replace both with one “answer quality” score.
Updates and permissions belong in the design
Documents change; the index must be rebuildable by document version. Deleted documents must be removed from the index, not just hidden. Permission filtering belongs in retrieval, not in a prompt that says “please do not answer”. If the corpus contains personal or customer data, redact and control access before indexing.