Quanta

← Back to Briefings

800-Token Chunks for a High-Volume Knowledge Base

Flagship modelsEN2 reads

For a team running sustained knowledge-base workloads, context limits become an operational constraint: every retrieved passage competes with instructions, conversation history, and the answer itself. Sending more text can increase cost without improving accuracy. This walkthrough starts with an illustrative 800-token chunk size, then turns it into a retrieval policy your team can measure and maintain.

01 · Step 1: Budget the Whole Request, Not Just Documents

A model’s context window is not a document allowance. Budget for system instructions, the user’s question, conversation history, tool messages, retrieved passages, and generation capacity. Check the selected model’s current limits and endpoint behavior; maximum output and reasoning-token accounting can impose additional constraints.

Set an application-level ceiling below the supported maximum. For example, an illustrative 32,000-token budget might allocate 4,000 tokens to instructions and history, 20,000 to retrieved evidence, and 8,000 to generation capacity. These are planning numbers, not specifications for any model. Count tokens with an appropriate tokenizer or estimator before sending the request, and leave a safety margin.

02 · Step 2: Split at Meaningful Document Boundaries

Start with approximately 800 tokens per chunk for prose-heavy internal documentation. Treat that as a testable baseline, not an optimum. Split first by document structure: headings, procedures, troubleshooting sections, and individual questions. Then split oversized sections into smaller units.

Keep numbered procedures together when practical. Preserve code blocks and tables when splitting would destroy their meaning. For oversized tables, repeat column labels in each segment. Attach a document identifier, section path, revision date, and access-control metadata to every chunk. A retrieved paragraph should remain understandable outside its original page.

03 · Step 3: Add Overlap Only Where Context Breaks

Test a small overlap, such as 80 to 120 tokens, where adjacent prose depends on shared context. Do not duplicate an entire preceding section by default. Overlap increases index size and can cause retrieval to return several nearly identical passages, wasting the evidence budget.

Consider a parent-child pattern for dense manuals: retrieve small passages, then expand selected hits to their enclosing section. Enforce a token ceiling on that expansion. This lets retrieval stay precise while giving the answer enough surrounding context to interpret exceptions and prerequisites.

04 · Step 4: Pack Evidence by Value, Not Arrival Order

Retrieve candidates, enforce access permissions, and rerank the authorized results before building the prompt. Remove duplicates and near-duplicates. Prefer evidence that directly supports the question, and include conflicting or newer guidance when it changes the answer.

  • › Reserve space for essential evidence before adding background material.
  • › Attach stable passage identifiers so answers can identify supporting excerpts.
  • › Stop adding passages when the evidence budget is reached.
  • › Return an explicit evidence gap when the retrieved material cannot support an answer.

Treat retrieved documents as data, not instructions. A passage telling the model to ignore system rules must not override your application’s policy.

05 · Step 5: Measure Retrieval Before Increasing Context

Build an evaluation set from representative questions, including multi-document procedures, outdated policies, permission boundaries, and questions with no documented answer. Compare chunk sizes and overlap settings while holding other variables steady.

Track whether retrieval finds the necessary evidence, whether answers are supported, and how many tokens each successful answer consumes. Also measure latency and unsupported-answer frequency. A larger window cannot repair missing documents or poor retrieval. If useful evidence is already present but overlooked, test evidence ordering and prompt structure before sending more text.

06 · Step 6: Meter the Rollout Across Sustained Traffic

Quanta fits teams that want one pay-as-you-go balance across models while retaining an OpenAI SDK workflow. You could evaluate Claude Sonnet 5.5 and Gemini 3.1 Pro against the same evidence packs, checking each model’s supported limits separately. Open a Quanta account to run a controlled pilot before expanding traffic.

Quanta meters calls on real tokens, with cache writes and cache reads priced separately. Record those categories independently, and verify cache eligibility rather than assuming repeated text produces a cache hit. Keep eligible shared prefixes stable, invalidate cached content when policies change, and monitor tokens per supported answer. Roll out the chunking policy only when quality, latency, and budget remain acceptable together.