# Add knowledge

> Connect a search server that holds your documents, so an agent can ground its judgment in your own material, and check what it retrieves.

After this page your agent can search your own documents through a knowledge base connection, and you've checked what a search brings back.

## What this is

A **knowledge base** connection points at a search server that holds your documents. In the invoice workflow, the Assess phase searches the supplier contracts for the clause covering a price difference.

Mindset doesn't load, store or index documents itself. Adding sources, removing them and tuning search all happen on the search server.

## What the server must do

| Requirement | Why |
|---|---|
| It's a remote server that speaks MCP | Mindset reaches it the same way it reaches an [MCP server](https://docs4.mindset.ai/docs/ams/connect-an-mcp-server). A local (stdio) server can't be connected |
| It exposes exactly one tool, named `rag_search` | That one tool is the search every agent with this knowledge base gets. A server with any other tool list is refused when its tools are discovered |
| It accepts a credential Mindset can send | A token, up to three headers, or an OAuth browser sign-in, as for an MCP server |

If your search server offers several tools, connect it as an [MCP server](https://docs4.mindset.ai/docs/ams/connect-an-mcp-server) instead.

## How to connect it

1. **Connections → + New connection → Describe it to the builder.** Say it's a knowledge base, and give its address. The knowledge base type isn't on the shortlist, so the Connection Builder creates it.
2. Give the builder the credential when it asks. It opens the **Enter a secret value** form, and the value is never shown to the assistant. If the server signs in through the browser, you'll be asked to sign in instead.
3. On the connection's **Overview** tab, press **Discover tools**. Mindset checks the server exposes exactly one `rag_search` tool.
4. On the **Knowledge** tab, enter a **Sample query** and press **Search**. It runs `rag_search` once and shows what comes back.
5. On the agent's **Resources** tab, add the knowledge base, then save a version and activate it. A knowledge base is added to an agent as a whole.

## Check what it retrieves

The **Knowledge** tab is the only control Mindset has over the corpus: it runs a sample search. Use it the way finance would ask:

- Search "price variance tolerance" and check the clause that comes back is the one in the current contract, not last year's.
- Search a supplier's name and check its contract is in the results at all.

If the right clause isn't in the top results, fix it on the search server. A firmer instruction in the agent's prompt won't make a search find what isn't indexed.

## What can go wrong

**Discovery is refused.** The server doesn't expose exactly one tool named `rag_search`. Connect it as an MCP server, or ask its owner for a single search tool.

**The sample search returns nothing.** The server is reachable and the index is empty or doesn't hold those documents. Check the sources on the search server.

**The agent never searches.** It was granted the knowledge base and never called it. That shows as granted versus used in [Check what happened](https://docs4.mindset.ai/docs/ams/check-what-happened). In a script, list the knowledge base on the phase that needs it, and make the phase's exit condition depend on what the search returns. See [Write a script](https://docs4.mindset.ai/docs/ams/write-a-script).

**You want to upload documents in Mindset.** You can't. Documents live on the search server.

## You're done when

- **Discover tools** found the one `rag_search` tool.
- A sample search for a question finance would ask returned the right clause.
- The agent has the knowledge base on its **Resources** tab in the active version.
