Settings: Knowledge & memory
Last reviewed November 15, 2026 (checked against the app).
These settings are on the Knowledge pages of Settings: Vault & search, Agent memory and Learned preferences, on desktop and web. All settings lists every page.
How do I configure knowledge retrieval?
Open desktop Settings -> Vault & search. The Search and embeddings card configures embeddings and recall, and the Duplicates and memory tools card on Settings -> Agent memory holds duplicate handling:
| Control | Choices and behavior |
|---|---|
| Embeddings source | Auto prefers configured, enabled Ollama, then OpenAI, then OpenRouter. Select a specific provider to use only that backend, or Off for keyword-only knowledge recall. |
| While any company is in Local Only, search sends no text to a cloud embedding provider | Off by default. On: while any company is in Local Only without Any model, search indexing and semantic search send nothing to OpenAI, OpenRouter or an Ollama cloud model. Set Embeddings source to Local Ollama only to keep semantic search working; keyword search keeps working either way. Every company shares one search index, so this applies to all of them. Only you can turn it on or off. |
| Embedding model | Choose a local Ollama embedding model. The default is bge-m3; only embedding-capable models are listed. Use Pull if the selected model is missing from the Ollama server. |
| Search mode | Hybrid combines meaning and keyword matches and is the default. Semantic uses keyword results as a fallback. Lexical uses full-text and exact-token matches without generating a query embedding. |
| Duplicate memories | Exact, the default, reuses an existing memory for identical content. Exact + propose near-duplicates also records possible duplicates for review; it does not automatically merge them. Off disables this duplicate handling. |
Auto chooses among configured providers without testing server health. Review connection errors in the Search index row if retrieval or indexing is unavailable.
The desktop app and web dashboard both show search index status in Search and embeddings: a badge in the card header (up to date, rows to re-index, re-indexing, or unavailable), and in the Search index row the current model, native vector-search availability, outdated rows, progress, and errors. After changing models, use Re-index now when outdated rows remain. Search only compares vectors from the current model, so notes from another embedding model need re-indexing before they can match semantically. If native vector search is inactive, the service can use its slower in-process path.
These retrieval modes apply to knowledge and memory recall. Individual Vault and Chat semantic-search controls have separate behavior. See Vault and Smart Context.
How do I connect my CLI to CPL memory?
In desktop Settings -> Agent memory, enable Memory tools for your sessions, then run cpl mcp install in a CPLai terminal. The installer registers the server for Claude Code and prints setup instructions for other clients, including Codex. Use cpl mcp status to check registration.
The server provides recall, search, remember, memory-list, and code-search tools. To also make it available to fleet agent runs, enable Memory tools for agents. Both switches are off by default. See Agent Memory Files for the separate project instruction-file workflow.
The server also appears as CPL Memory (built-in) in the MCP server list, and its on/off and agent switches there are the same two switches: change either place and both follow, right away. To give it to just one agent or company instead of every agent, leave Memory tools for agents off and assign it there; Memory tools for your sessions must still be on.
How do I review and trim an agent's memory?
Open Settings -> Agent memory on desktop or web (the web shows it to admins). Agents by memory used lists every agent's memory against its budget, fullest first; pinned memories never count. Click an agent's name to open the agent, or Review & trim to start a review.
The Memory review model (Settings -> Utility models, the Utility Model unless you choose another) drafts a trim that brings the agent back to about 70% of its budget:
| Part of the draft | What it does |
|---|---|
| Before and after | The agent's non-pinned characters now and once the draft is applied, with the memory count. |
| Merge duplicates | Groups of memories that say the same thing, each with the one shorter memory that replaces them. Edit the draft lets you change the merged text. |
| Retire low-value memories | Memories that look stale or one-off, with their importance and when they last changed. |
| Pinned | Pinned memories are listed and never touched. Memories changed in the last 14 days and operator corrections are left out too. |
Clear any item you want to keep, then click Approve trim. Nothing is deleted: merged and retired memories stay as history and stop counting toward the budget.
Open the History tab of the review to bring memories back. Undo merge makes each merged memory live again with its own links, and retires the merged one. Restore brings back one retired memory as a new memory that records where it came from; a memory that already has a live copy shows Restored.
How does Trim automatically work?
Trim automatically, on Settings -> Agent memory, lets the nightly memory janitor trim agents itself instead of only filing a review. It is off by default.
| Setting | What it does |
|---|---|
| Trim automatically | On: each night the janitor trims agents past the line, the same way as Review & trim. Off: it only counts the agents it would review. |
| When an agent passes | The share of its budget that starts a trim. Default 90%. |
| Trim down to | Where a trim stops. Default 70%, always at least 10 points under the start. |
| Runs at | When the nightly run happens, on this computer's clock. Default 03:00. If CPLai was off then, it runs once when it starts. |
| Pinned memories | Always kept. Memories changed in the last 14 days and operator corrections are left alone too. |
Each night trims at most 20 agents, fullest first, with the Memory review model. Nothing is deleted: merged and retired memories stay as history, and each agent's Review & trim History tab can undo a merge or restore a memory from a night as well. When a night brings an agent under its budget, the janitor files no review ticket for it.
Last night shows what the most recent run did. With Trim automatically off it says how many agents and memories it would review, and nothing changes. Open report lists each night with every agent's characters before and after. Only an admin can change these settings.
How do I manage learned preferences?
Open Settings -> Learned preferences, in the Knowledge group, on desktop or web.
CPLai learns durable preferences from Chat, such as writing style, workflow rules, or repeated corrections. Active preferences are added to future text and reasoning conversations so you do not need to repeat the same instruction in every new chat. See Learned Preferences in Chat for what it picks up.
The page has two cards:
- Learning: the Learn preferences from chats switch, a link to the model that runs the check (it lives in Utility models), and, when the cards sit side by side, how many preferences of each type it has learned.
- Learned Preferences: the list, most important first. Search it, filter it by type with the chips above it, and turn on Show dismissed to include the ones you dismissed. The list scrolls inside its card, so the page itself stays put.
On each preference you can:
- Click Edit if the wording is too broad or too narrow
- Click the dismiss icon so it stops affecting future chats
- Click Keep preference on a dismissed one to restore it
Dismissed preferences are not added to future chat prompts.
Tip: Learned preferences are for durable habits, not one-off tasks. Use notepads or project rules when you want to provide larger reusable context.