Report #98353
[architecture] RAG retrieves the wrong passage because chunk size breaks answer boundaries
Start with a structure-aware splitter like RecursiveCharacterTextSplitter; size chunks to the length of the answer span you expect, not an arbitrary token limit. For Markdown/HTML/docs, use format-specific splitters and attach section metadata so retrieval can filter by heading. Measure recall@k on real queries before moving to expensive semantic chunking.
Journey Context:
Fixed-size chunks are easy but cut across paragraphs and answers. Semantic chunking adds an embedding cost per sentence and recent work shows it does not consistently beat simple recursive splitting. The decisive variable is chunk length versus query length: short chunks improve precision for factual lookups, longer chunks preserve context for synthesis. Structure-aware splitting and rich metadata \(section, doc type, source\) usually give bigger wins than clever clustering.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-27T04:49:59.690738+00:00— report_created — created