Short answer: for a privacy-focused personal knowledge manager that searches B2B SaaS product content, choose chunk boundaries from the smallest unit that can be independently authorized, revised, and cited; then make freshness a versioned indexing contract rather than a background promise. A fixed token window is useful only as a final size guard. It should not decide where meaning, access control, or audit history begins and ends.
Freshness is a state.
This changes the central question. The important comparison is not 300 tokens versus 600 tokens in isolation, because either number can produce an apparently relevant result whose cited source has since changed, whose neighboring sentence belongs to another permission scope, or whose replacement coexists with a stale vector. The safer design has three layers: a source revision, a stable semantic unit, and one or more retrieval windows derived from that unit. Keep those identities separate.
How should a privacy-focused personal knowledge manager choose chunk boundaries?
Start with the product-content object that carries independent meaning and governance: a release-note entry, a help-center section under one heading, a pricing caveat, or a single integration step. That object becomes the semantic unit. Its identifier should survive harmless formatting edits, while its revision changes whenever the normalized text or authorization metadata changes. Retrieval windows may split a long unit or add limited neighboring context, but every window must point back to exactly one source revision.
This rule is deliberately stricter than visual layout. A heading boundary is often useful, yet HTML structure alone cannot tell the indexer that a sentence such as "available on enterprise plans" qualifies the preceding feature claim. Conversely, concatenating an entire page because it shares one URL creates an authorization and freshness blast radius: one changed paragraph forces a large embedding replacement, and one restricted subsection can contaminate a broadly visible result. The boundary contract therefore needs content semantics, policy scope, and revision identity, with size treated as a constraint after those decisions.
The original retrieval-augmented generation paper describes a system that combines parametric memory with a retrieved non-parametric memory and evaluates retrieval over chunked documents. That establishes the retrieval pattern, but it does not settle the application boundary for mutable, permissioned product content. An operational knowledge manager has to supply that contract itself.
No universal chunk size can do this.
The 3-layer contract makes freshness observable
The source layer records the canonical document ID, source revision, visibility policy, and ingestion time. The semantic-unit layer records a stable unit ID, its normalized content hash, and its exact source span. The retrieval layer records the embedding model identifier, the derived window text, and the unit revision from which it was produced. Those fields form an audit trail that can answer two different questions without hand waving: "Why was this passage eligible?" and "Was it generated from the current source revision?"
Treat publication as a reconciliation problem. For source revision 42, derive the complete desired set of retrieval-window IDs, upsert that set idempotently, verify that every stored window names revision 42, and only then make revision 42 searchable; windows from revision 41 can be retired after the new manifest is visible. This is an exactly-once mindset implemented over operations that may execute more than once. The indexer doesn't need magical delivery semantics. It needs deterministic identities and a commit condition that rejects mixed revisions.
Replays are normal.
A compact record is enough to preserve the invariants:
type RetrievalWindow struct {
WindowID string `json:"window_id"`
UnitID string `json:"unit_id"`
SourceID string `json:"source_id"`
SourceRevision uint64 `json:"source_revision"`
ContentHash string `json:"content_hash"`
PolicyID string `json:"policy_id"`
EmbeddingModel string `json:"embedding_model"`
Text string `json:"text"`
Citation Citation `json:"citation"`
}
type Citation struct {
URI string `json:"uri"`
StartByte int64 `json:"start_byte"`
EndByte int64 `json:"end_byte"`
}
Byte spans are an implementation choice, not a universal recommendation: character offsets or structural paths may be a better fit when normalization changes byte positions. The invariant is that a citation resolves against the named revision, rather than against whatever happens to live at the URI later. I'm not sure one locator representation works across HTML, Markdown, and imported rich text; a corpus sample containing edits, moved headings, and Unicode text is what should resolve that uncertainty.
Boundary policies should follow failure domains
For B2B SaaS product content, begin with a small policy matrix and make each row falsifiable. Release-note entries usually stand alone and change independently, so entry boundaries are a sensible first candidate. Procedural documentation needs ordered steps plus local prerequisites; splitting every list item can improve lexical focus while destroying the condition that makes the step safe. Pricing and entitlement text should remain attached to the claim it limits. Tables often need a row together with column headers, since a row without headers is compact but semantically empty.
| Content shape | Initial semantic unit | Context rule | Main failure to test |
|---|---|---|---|
| Release notes | One dated entry | Keep product and version labels | Old and new behavior retrieved together |
| Help article | One heading section | Carry the nearest qualifying sentence | Exception detached from the answer |
| Procedure | One complete operation | Include prerequisites and ordered steps | Correct step returned without its precondition |
| Entitlement text | Claim plus its plan qualifier | Never cross a policy boundary | Restricted or misleading eligibility claim |
| Comparison table | Header plus one logical row | Repeat headers in derived text | Values retrieved without their dimensions |
These are starting hypotheses, not measured optimums. Use a size ceiling to split a semantic unit only when the embedding or retrieval pipeline requires it, and use a small overlap only within that same unit. Cross-unit overlap looks convenient but duplicates facts, complicates deletion, and can join text governed by different policies. If a long procedure must be divided, each child window should retain the procedure ID, revision, prerequisite context, and an ordinal; retrieval can then expand siblings after authorization rather than embedding a giant block in advance.
The catch is real: smaller units increase manifest cardinality and indexing work, while larger units reduce bookkeeping but enlarge the scope of invalidation and can dilute the evidence returned to a generator. A highly static, uniformly public handbook may be better served by simpler heading-based chunks and periodic full rebuilds. A rapidly edited catalog with per-account entitlements should accept the additional versioning machinery because stale deletion and policy isolation dominate raw indexing convenience. Don't choose the heavier contract when the corpus cannot benefit from it.
Test retrieval as a ledger, not a demo
A top-k result that looks plausible is weak evidence. Build evaluation cases around transitions: revise a feature limit, move a section without changing its words, revoke a tenant's access, merge two help articles, change the embedding model, and replay the same ingestion event. For each transition, assert both positive and negative outcomes. The new passage must be retrievable; the superseded passage must not be retrievable; every returned citation must resolve to the searchable revision; and replay must leave the same manifest, rather than creating duplicate windows.
Use synthetic identifiers such as doc_017, revisions 41 and 42, and a deliberately duplicated event ID evt_9f2a in fixtures. These values aren't benchmark claims. They make failures reproducible and audit logs readable. A useful reconciliation report compares four sets: windows desired from the current source snapshot, windows present in the vector index, windows present in the metadata store, and windows eligible under the requesting principal's policy. Any asymmetric difference is a deployment blocker, even if a manual query returns the expected paragraph.
Privacy testing belongs in the same harness. Authorization must be evaluated before a passage reaches generation or query logs, and cache keys must include the security context that affects eligibility. Keep raw source text, derived windows, embeddings, and query traces under explicit retention rules; encryption and local deployment do not erase the need for deletion propagation, access review, and evidence that a revoked unit disappeared from every searchable derivative. The exact compliance obligations depend on jurisdiction and data classification, so counsel and the organization's control owners must define retention periods and audit evidence. An architecture article cannot substitute for that determination.
Observe age by revision, not just by clock time. A five-minute-old window is stale if revision 43 is canonical and it still names revision 42; a week-old window may be current if its source has not changed. Useful metrics therefore include current-manifest coverage, stale-window count, orphan-window count, citation-resolution failures, policy-denied retrieval attempts, ingestion replay duplicates, and the interval between source commit and searchable manifest commit. Avoid declaring a universal service-level objective here. Your update frequency and the harm of an obsolete answer should set it.
Roll out with a reversible manifest migration
Begin in shadow mode: derive the new units and manifests without serving them, then compare citation resolution, stale-window detection, policy eligibility, and transition tests against the existing index. Next, dual-read a controlled evaluation corpus while keeping one searchable manifest authoritative. Promote by source partition only after the new partition reconciles to zero missing, extra, or mixed-revision windows.
Make rollback boring.
Rollback should switch the authoritative manifest pointer, not attempt to reconstruct an earlier index from application logs. Retain the prior manifest for the approved rollback interval, preserve its source revisions, and record every promotion with the actor, policy version, embedding model, and manifest hash. This is less glamorous than tuning a similarity threshold. It is also the part that prevents a freshness change from becoming an untraceable content mutation.
The final decision rule is compact: use semantic units aligned to revision and authorization boundaries, derive bounded retrieval windows from them, and publish only reconciled manifests. Stick with a simpler periodic rebuild when content is public, changes rarely, and a full replacement comfortably fits the operational window; use the three-layer model when independent edits, deletion guarantees, citations, or tenant policy make mixed revisions unacceptable.
References
- Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks: https://arxiv.org/abs/2005.11401
Top comments (0)