---
title: "Retrieval settings"
description: "Control how much of your knowledge your bot reads for each message - document relevance, context documents, enhanced retrieval, sources and chunk size."
canonical_url: "https://chatthing.ai/docs/knowledge/retrieval-settings"
last_updated: "2026-09-25"
---

# Retrieval settings

When someone sends a message, your bot searches your data sources for the most relevant pieces of content (called **documents**) and reads them before it answers. These settings control that search. They are in your bot's **General settings** tab: the toggles for sources are under **General settings**, the rest under **Model settings (advanced)**.

## Settings

| Setting | What it does | Default | Range |
| --- | --- | --- | --- |
| **Document relevance** | How closely a document must match the message before the bot is given it. Higher = only very relevant documents; lower = more, looser matches. | 0.75 | 0.25–0.9 (0.25–0.75 on bots using a newer embedding model) |
| **Max context documents** | The maximum number of documents given to the bot for each message. `0` turns knowledge retrieval off. | 4 (6 for bots created from the dashboard form) | 0–12 |
| **Max context size (base tokens)** | The token budget for each reply's prompt, knowledge and conversation history. Documents that don't fit are left out. | The model's default | 1,024 up to the model's context window |
| **Enhanced knowledge retrieval** | Before searching, rewrites the latest message into a standalone question using the conversation so far. Makes follow-up questions ("how much does *it* cost?") find the right content. Uses extra message tokens. | Off | On / off |
| **Include sources for responses** | Shows links to the pages an answer came from. Only web data sources are shown. | Off | On / off |
| **Document character limit** | The maximum size of each document when your content is split up during syncing. | 2,000 | 1,000–4,000 |

## When to change them

### The bot says it doesn't know, but the answer is in your content

1. Check the data source has finished syncing and contains the page (see [manage data sources](https://chatthing.ai/docs/knowledge/manage-data-sources)).
2. Lower **Document relevance** a little (for example from 0.75 to 0.6). Short content, such as product feeds or one-line FAQ entries, often needs 0.5.
3. Raise **Max context documents** to 8–10 so more content reaches the bot.
4. Turn on **Enhanced knowledge retrieval** if it fails mainly on follow-up questions.

### The bot uses irrelevant content or drifts off topic

Raise **Document relevance** so only close matches are used, and tighten your [instructions](https://chatthing.ai/docs/bot-settings/instructions).

### Replies use too many tokens

Lower **Max context documents** or **Max context size (base tokens)**. Keep **Max context size** above about 2,560: below that, the settings warn "This is quite low & could mean your bot won't be given any context documents."

### Answers are cut off mid-topic or miss surrounding detail

Raise **Document character limit** so each document holds more text. The new size applies the next time your data sources sync; see [keep it up to date](https://chatthing.ai/docs/knowledge/keep-it-up-to-date).

## Change a setting

1. Open your bot and go to the **General settings** tab.
2. For sources, use the **Include sources for responses** toggle under **General settings**. For everything else, scroll to **Model settings (advanced)**.
3. Adjust the setting.
4. Click **Update bot**.
5. Ask the questions that were failing and check the answers. If **Include sources for responses** is on, check the cited pages are the right ones.

You can also change these settings from an AI assistant with the [`update_bot` MCP tool](https://chatthing.ai/docs/mcp/tools) (`documentRelevance`, `maxContextAmount`, `enhancedRetrieval`, `includeSources`, `documentChunkSize`).

## Related

- [Improve your bot's answers](https://chatthing.ai/docs/improve/improve-answers): Fix a bot that says "I don't know", gives wrong or made-up answers, goes off-topic, rambles, forgets context or replies in the wrong language.
- [Bot settings reference](https://chatthing.ai/docs/bot-settings/settings-reference): Every setting on your bot's General settings tab - what it does, its default and range, and which plans include it.
- [Structure your content for better answers](https://chatthing.ai/docs/knowledge/best-practices): Split data sources sensibly, pick the right CSS selectors for your CMS, and write content your bot can find and quote accurately.
