Retrieval hands the model a passage with no surrounding document. If the passage says "the 30-day window above does not apply to digital goods," the model has no idea what window, which product, or which jurisdiction. The fix is structural chunking: split on the document's own hierarchy so the heading travels with the body.
SurrealDB's survey of chunking strategies makes the tradeoff explicit. Fixed-size chunking is simple and fast but "completely ignores sentence and paragraph boundaries" and can split mid-sentence or mid-idea. Document-structure chunking, which splits on headers and sections, is slower to prepare but produces chunks that match how the document is actually organized SurrealDB. For policy documents, where a section is already the unit a human would cite, structure chunking wins.
A practical policy-chunk recipe:
- Split at heading level, using the deepest heading that still covers one rule.
- Prepend the heading path to the chunk text, for example "Refunds > Digital goods > EU consumers:" so the passage restates its own scope.
- Keep the effective date in the text or metadata, and keep superseded versions retrievable but filtered out by default.
- Cap the chunk at the point where a single section covers more than one distinct rule. Two rules in one chunk means the model can cite the passage for the wrong one.
Here is what a policy chunk looks like once prepared:
{
"source_id": "policy-refund-0042-v3",
"doc_title": "Refund Policy",
"heading_path": "Refunds > Digital goods",
"effective_from": "2025-03-01",
"product": ["streaming", "ebooks"],
"region": ["US", "CA"],
"plan": ["consumer"],
"text": "Refunds > Digital goods. Digital goods are refundable within 14 days of purchase only if the download has not been started. If the download was started, no refund applies unless the file is defective."
}
The AWS Bedrock documentation notes that when documents are ingested, content is split into manageable chunks, converted to embeddings, written to a vector index, and kept mapped back to the original document AWS documentation. That mapping is your citation trail, so never let a chunk lose its pointer to the parent document and heading.
Help articles need a different rule. Split at step boundaries so a procedure step does not arrive without the step before it. For FAQ-style articles, split per question and answer pair. A tutorial with eight numbered steps should produce eight chunks plus one overview chunk, not nine arbitrary token windows. The general guidance for prose knowledge bases favors sentence-aware or recursive splitting that respects natural language boundaries, which is close to what help articles need at the sentence level, while section boundaries should be respected at the article level Medium.