> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agents and MCP clients

> Attach brains to an agent, read citations, and ask the brain from MCP clients.

## Attach knowledge to an agent

**Agent settings > `KNOWLEDGE`** lists what one agent can look up:

* **Company Brain**: on by default for every agent. Turn it off to keep this agent away from company knowledge.
* **Attached brains**, each marked "each person's access" or "shared agent access".
* **Attached collections**. A collection attached directly always uses each person's own access.

**Add knowledge** attaches a brain or collection. When nothing is offered, admins can create a collection or connect a source, and members can make their own collection in **Settings > Knowledge**.

![Knowledge row with the Company Brain switched on and the Add knowledge menu listing the Legal, Support KB and Pricing brains and four collections with their file counts](https://mintcdn.com/xpanderai-099931d1/PE_rYtMHQe3CXVP1/images/use/company-brain/company-brain-add-knowledge.png?fit=max\&auto=format\&n=PE_rYtMHQe3CXVP1\&q=85\&s=dca4c8b7732192dbc4f010caed1c85a4)

Add knowledge on an internal agent: the Company Brain is on, and the menu lists the brains and collections you can attach. Shown with sample data.

> [!NOTE]
>
> On a public agent, visitors have no company login. The Company Brain shows "Off. On a public agent it would be empty for visitors without a company login.", and brains and collections that use each person's own access find nothing there. Attach a brain with shared agent access instead. See [Whose access it uses](https://docs.xpander.ai/use/company-brain/admins.md#whose-access-it-uses).

![Agent settings with the Knowledge row: Company Brain switched off for a public agent, the Support KB and Pricing brains using shared agent access, the Runbooks collection, and Add knowledge](https://mintcdn.com/xpanderai-099931d1/k9UOsTNQoJ3cIiJ7/images/use/company-brain/company-brain-agent-knowledge.png?fit=max\&auto=format\&n=k9UOsTNQoJ3cIiJ7\&q=85\&s=c6c8f7720b902a218528d64f64e95890)

The Knowledge row on a public agent: the Company Brain is off, and two brains with shared agent access and a collection are attached. Shown with sample data.

## How an agent uses the brain

The agent asks all its brains at once: the Company Brain, when on, and the attached brains. It can also ask one brain by name, chosen from the brain's **What it's for** description. An agent can ask only brains attached to it. Live sources are searched in parallel. A source that does not answer in time is left out of that answer and named. When a passage is too short, the agent opens the cited item in full.

## Citations in the conversation

An answer that used the brain ends with **Sources**: numbered chips that match the numbers in the text.

![Sources list with 1 Enterprise MSA Playbook v4 (Collection, Legal playbooks, p. 7), 2 Deal Desk Exceptions (Confluence, REVOPS) and 3 Q3 Contract Review minutes (SharePoint, Legal)](https://mintcdn.com/xpanderai-099931d1/k9UOsTNQoJ3cIiJ7/images/use/company-brain/company-brain-citations.png?fit=max\&auto=format\&n=k9UOsTNQoJ3cIiJ7\&q=85\&s=434b97c185ac1ae940ee57f63bbe41b3)

The Sources row under an answer, opened: a stored document with its collection and page, and two live items with their source. Shown with sample data.

* A **stored document** opens over the answer with the cited passage highlighted. Admins also get **Manage in Knowledge**.
* A **live item** opens where it lives, with your own account.

![Enterprise MSA Playbook dialog, Collection, Legal playbooks, p. 7, listing passages with the cited section 9 Liability, 9.2 Cap highlighted](https://mintcdn.com/xpanderai-099931d1/k9UOsTNQoJ3cIiJ7/images/use/company-brain/company-brain-cited-document.png?fit=max\&auto=format\&n=k9UOsTNQoJ3cIiJ7\&q=85\&s=dd1edeed4c1576f09e8cc2e82422ed34)

A cited collection document opened from the answer, with the cited passage highlighted. Shown with sample data.

An answer that skipped a source you never connected offers **Connect** for it.

## Ask the brain from an MCP client

MCP clients connected to xpander, such as Claude Code, Claude Desktop, ChatGPT, Codex, Cursor and OpenCode, can ask the same brain. See [Connect your MCP client](https://docs.xpander.ai/guides/deploy/omni-mcp.md). Every call runs as the person who signed in.

| Call | What it does | Inputs |
| - | - | - |
| `brain_ask` | Asks the company's knowledge and returns ranked passages with citations, or a written, cited answer | `question` (required), `brain`: `company` or the id of a brain, `scope`: `onsite`, `external` or both, `mode`: `passages` (default) or `answer` |
| `brain_read` | Opens one cited item in full | `citation_id` from an earlier answer, or `source` and `ref` |

An example in Claude Code, once xpander is connected:

```text theme={"dark"}
Ask the company brain what our refund policy says about annual plans, and cite the sources.
```

Learned facts are proposed only from agent conversations. MCP clients can ask and read, not propose.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.