FDE Foundations · Module 7: RAG & Retrieval
Chunking and Metadata
Chunking is document design, not token arithmetic: split at structural boundaries, attach the metadata answers will be filtered by, and keep provenance for citations.
11 min reading
Objectives
- Choose chunk boundaries based on document structure
- Attach metadata that later drives filtering and citation
- Avoid the classic mistakes that sink retrieval quality
Boundaries follow structure
Split on headings, sections, table rows, and logical units rather than a fixed token count alone. A size window with overlap handles uniform text; documents with structure deserve structure-aware splits. One idea per chunk is the target: a chunk that answers half a question retrieves half an answer.
Metadata is the real index
Attach to every chunk: source document, section title, document type, date, owner or access level, and version. Filters on metadata resolve half of all query failures ("only the 2026 policy", "only this customer's contract"). Access filtering depends entirely on metadata being right: a chunk with a wrong or missing permission label is a data leak waiting for a query.
Provenance for citations
Store enough to cite: document, section, and a stable locator. Systems that show sources get trusted and debugged; systems that show paragraphs of confident text get neither.
Classic mistakes
Re-chunking without re-evaluating, chunk sizes tuned on ten documents, losing tables by flattening them into prose, and discarding headers that carry the context a chunk needs to be understood.
Quick check
An optional 2-3 question self-check. Answers never leave your device, are not stored, and never count toward any assessment.
Exercise
Define the chunking scheme for a fictional knowledge base of HR policies: boundary rule, size and overlap, six metadata fields per chunk, and the citation format shown to users.
Pass criteria
Boundary rule references document structure, size and overlap stated with reasons, metadata includes an access or owner field, and citations identify document and section.