01Chunk for the question shape
Chunks should be coherent enough to answer likely questions and small enough to rank precisely. Preserve headings, source location, timestamps, and permissions. Consider hierarchical parent/child retrieval for long documents.
Retrieval adds external evidence to the model's input. A lexical index matches terms such as exact error codes; an embedding maps text to a learned vector so geometrically nearby items may capture paraphrases. A vector is a retrieval feature, not a truth score. The next chapter develops that geometry; here, treat semantic retrieval as one candidate-generation method whose results must be evaluated.
Ingestion determines what can later be found. Preserve headings, source IDs, versions, permission metadata, and useful table or code structure. A chunk that cuts a condition away from its exception can look relevant while being insufficient. Compare chunking on known question/evidence pairs: does the required passage survive as a coherent retrievable unit, and can its source still be cited?
- Overlap repairs boundary loss but creates duplicates
- Tables and code need structure-aware parsing
- Index updates and deletes need lifecycle tracking