Pre-Processing tunes what happens to a user's query, and to the running conversation, before the Enterprise Search agent generates an answer. This screen mirrors the AI Agent editor's Pre-Processing settings exactly.
Overview
Pre-Processing optimizes how the agent processes queries and retrieves knowledge for accurate responses, and manages the conversation's context. You set the model that rephrases queries, how many knowledge chunks to retrieve, the model that re-ranks them, and Compaction, which keeps long conversations within the model's context budget. The section saves automatically.
Query rephrasing, chunk retrieval, and ranking
Query Rephrasing Model — reformulates user queries to improve retrieval accuracy.
Chunk Retrieval — the number of chunks retrieved against one query (default 50). Raise it for breadth, lower it for focus and speed.
Ranking Model — prioritizes retrieved chunks by reassessing their relevance and authority to enhance result quality.
How query rephrasing behaves at runtime
The rephrasing model sees the conversation history, the new message, and the user's context (profile fields like email or department), and does more than reword:
Follow-ups become standalone questions — "for smoking?" after a policy question is retrieved as "what is the company policy for smoking?".
Chit-chat is short-circuited — greetings, or questions already answered in the conversation, get a direct reply with no knowledge retrieval at all.
Missing context is filled in — an incomplete question can be completed from the user's context, such as scoping "the leave policy" to the user's own department.
Rephrasing is skipped and the raw query used as-is when it's disabled, or when the agent runs in full agentic (task-executor) mode, where the agent forms its own knowledge queries. A custom rephraser prompt attached to the agent replaces the default behavior.
How Chunk Retrieval and Ranking work together
The vector search deliberately over-fetches — it pulls a few hundred candidate chunks by embedding similarity, optionally blended with keyword matching. The Ranking Model then re-scores those candidates against the query in batches and keeps only the top Chunk Retrieval count, which is what reaches the answer step. So Chunk Retrieval is the keep count after reranking, not the width of the initial search. The ranking model can be a dedicated reranker, an LLM acting as a judge, or a custom reranking automation. If reranking is disabled, chunks pass through in raw similarity order instead; if a reranking call errors, the agent falls back to similarity order rather than failing the answer.
Compaction
Compaction compresses older conversation turns so long chats stay fast and within the model's context window. Without it, every call replays the full chat history — costs scale with conversation length, and threads eventually hit the model's context window. Turning Compaction on gives you lower token spend, longer conversations, and faster responses by summarizing older turns. Enable it for agents that hold long, multi-turn conversations; leave it off for short, transactional ones.
Configuring when compaction kicks in
With Compaction on, you edit a Default entry, and can add exception entries for specific audiences. Each entry has:
Trim Threshold — an emergency trim level when the limit is breached, set as a percentage or a token count.
Trigger — the point at which compaction starts summarizing.
Preserved — how much recent context to keep verbatim.
Summarisation Model — the model used to generate summaries of the older turns.
Data Compression Mode — compresses structured data for tool outputs and API responses to save more tokens.
The defaults trigger compaction well before the limit and keep the most recent turns intact. Add an exception when one audience needs different thresholds than everyone else.