AI Help

How do I choose chunk size and overlap for an AI knowledge base?

Choose chunk size and overlap through retrieval tests on your documents. Preserve enough context for the questions users actually ask.

Steps to follow

  1. Build representative questions with known supporting passages, including tables and answers spanning section boundaries.
  2. Try supported chunking settings and compare evidence coverage, duplicate retrieval and the generator's answer quality.
  3. Keep metadata and document structure where supported. Select settings from measured results rather than a universal token count.

Example in practice

Illustrative example. A procedure split between a condition and its exception may need a different boundary so retrieval returns both together.

Related AI help

Official guidance

OpenAI documentation