# Using a Knowledge Base with Agents

Agents retrieve context by searching the knowledge bases available to them:

- **Custom agents** search the knowledge bases explicitly attached to them. In the agent's create or edit form, the **Knowledge Bases** section lists eligible knowledge bases as checkboxes — select one or more. A user-level agent can attach your user-level knowledge bases; an org-level agent can attach organization knowledge bases.
- The built-in **Insulin** assistant searches your own knowledge bases automatically. You can also pick an explicit set — see [Choosing which knowledge bases Insulin uses](#choosing-which-knowledge-bases-insulin-uses) below.

At query time an agent can search up to three knowledge bases and cites the source document for each result. See [Agents](/insulin/agents/) for how to create and configure custom agents.

*Diagram: A custom agent searches the knowledge bases attached to it and the Insulin assistant the ones you own or ticked, up to three per search, and gets back the best-matching passages with their sources.*

- A custom agent (the knowledge bases attached to it) → Up to three knowledge bases (per search)
- The Insulin assistant (every one you own, or the ones you ticked) → Up to three knowledge bases (per search)
- Up to three knowledge bases (per search) → Search each one (with its own embedding model and settings)
- Search each one (with its own embedding model and settings) → Best-matching passages (each citing its source document)

## Choosing which knowledge bases Insulin uses

Open **Chat**, select the **Insulin** agent, and click the pencil button in the conversation header (labelled *Insulin model settings*). Its **Knowledge Bases** section controls what Insulin can search.

By default the section shows an **Automatic** badge and Insulin searches every knowledge base you own, read-only. Ticking or unticking any row switches to an explicit selection, which then takes over completely:

| Selection | What Insulin searches |
|-----------|-----------------------|
| **Automatic** (default) | Every knowledge base you own, read-only |
| One or more ticked | Exactly the ticked knowledge bases |
| Nothing ticked | No knowledge base at all |

The list covers every knowledge base you can reach — the ones you own, plus organization knowledge bases shared with you, each marked with a **Shared** badge. The built-in Insulin assistant never searches an organization knowledge base, even one you tick, so grounding answers in organization content still needs a custom agent that has it attached.

Each ticked row also carries an access mode, **Read** or **Edit**, with the same meaning as for a custom agent (see [Agents](/insulin/agents/)). Choosing **Edit** only expresses intent: Fours re-checks your own role on that knowledge base immediately before every write, so picking **Edit** on one you can only read grants you nothing, and access revoked mid-conversation stops the next write.

Select **Reset to automatic** to discard the selection and go back to the default.

:::info
This selection is personal to you and applies only to the built-in Insulin assistant. Custom agents keep their own attachments, and [Inbox](/insulin/inbox/) has a separate, read-only selection it uses when drafting email replies.
:::

![The agent panel's Knowledge Bases section — the Automatic badge, the note that Insulin searches all your knowledge bases by default, and a per-knowledge-base checkbox with its Read/Edit access selector](../images/19-agent-knowledge-bases.png)
