ClouisleClouisle

Knowledge Base Optimization

Improve recall and answer quality by tuning chunking, retrieval modes, and reranking configuration

Significantly improve knowledge base retrieval quality and response accuracy by adjusting chunking, retrieval, and reranking strategies.

Chunking Strategy

Clouisle uses character-based chunking. Defaults: chunk_size = 1000 characters, chunk_overlap = 100 characters; the UI accepts chunk sizes from 100 to 2000 characters.

Content TypeChunk SizeOverlap
General prose1000 chars100 chars
Short Q&A400-800 chars50-100 chars
Code or structured text800-1500 chars100-200 chars

Tune against representative documents and retrieval quality; these values are recommended starting points, not hard defaults.

Retrieval Parameters

The retrieval API uses top_k, score_threshold, and (for hybrid search) dense/lexical weights and rrf_k. Defaults: top_k = 5 and score_threshold = 0.0; there is no KB search max_tokens parameter. Context length is governed by the chat model's available token budget.

  • top_k: Start with 3-5 and increase only when recall is insufficient
  • score_threshold: Start at 0.0, then raise it using a representative evaluation set
  • search_mode: Compare vector, fulltext, and hybrid for the corpus
  • reranking: Enable only with an authorized rerank model; tune candidate count and threshold using measured quality/latency

When to Reprocess

  • Document content changed
  • Chunking settings or separators changed
  • A document needs explicit reprocessing/rechunking

Changing the embedding model on an existing KB is rejected because its dimension must remain compatible. Create a replacement KB or use an explicit migration/reprocessing process; the application does not silently auto-reindex the KB.

Evaluation

Keep a small set of representative queries and record recall, answer quality, latency, and cost before changing settings. Compare retrieval modes and reranking with the same queries rather than relying on a single example.

Embedding model changes

Do not directly replace the embedding model dimension in production. Dimension changes break existing vector indexes, requiring KB re-creation or a full re-indexing workflow.

How is this guide?

On this page