# Knowledge base


# Knowledge base

A knowledge base gives your agents the facts they need to answer accurately. Upload your documents — product sheets, policies, FAQs — and your agent retrieves the most relevant passages during a call to ground its answers, instead of guessing. This is retrieval-augmented generation (RAG).

Open **Knowledge** (`/knowledge`).

## How a knowledge base works

![The Knowledge Base](/img/screenshots/portal/knowledge-base.png)
*The Knowledge Base: documents with indexing status, chunk count, quality score and coverage analysis.*

The flow from a raw document to a grounded answer has four steps:

1. **Upload** your documents to the knowledge base.
2. The Portal **processes and indexes** them, breaking each document into passages it can search.
3. You **link** the knowledge base to an agent.
4. On every call, the agent **retrieves** the passages that best match what the caller asked and answers from them.

The result is answers that reflect your own products, policies and processes — and far fewer made-up replies.

## Upload documents

Add the documents you want your agents to draw on. Supported formats are **PDF, DOC, DOCX and TXT** (`.pdf`, `.doc`, `.docx`, `.txt`), up to **10 MB** each.

1. Upload one or more files.
2. The content is processed and indexed so it can be retrieved during calls.

:::tip

Upload focused, well-structured documents. A clear FAQ or a tidy policy doc retrieves far better than a giant, mixed PDF. Split very large or unrelated material into separate files, and give each one a descriptive name so you can tell them apart later.

:::

## Search

Use search to check what's in your knowledge base and confirm a document was indexed and is findable. Searching the way a caller might actually ask — in their words, not yours — is a quick way to sanity-check that the right passage comes back before you rely on it in a live call. If your search turns up nothing, the agent won't find it either.

## Retrieval settings

Tune how retrieval behaves so your agent gets the right context — not too little, not too much:

- **Similarity** — how closely a passage must match the question to be used. Higher is stricter, so only strong matches come back; lower is more forgiving and surfaces more passages.
- **Top-k** — how many of the best-matching passages to pull in for each answer. Smaller keeps answers tight; larger gives the agent more to work with.

Raise top-k when answers are missing context; tighten similarity when the agent pulls in loosely related material. The same two controls also appear per agent on the [Knowledge & RAG](./agents/knowledge-rag) tab, so you can set a baseline here and adjust for a specific agent there.

## Keep your knowledge base current

A knowledge base is only as good as what's in it. When a policy, price or product detail changes, update the source document so agents stop answering from stale facts. Remove documents you no longer want agents to use, and re-check with [search](#search) after any change to confirm the new content is what comes back.

## Link to agents

A knowledge base is only used by an agent once it's linked to one. On the agent, open the **LLM (Model)** tab → **Add Knowledge Base** section to link the knowledge base and set its retrieval behavior — there is no separate Knowledge tab; see [Knowledge & RAG](./agents/knowledge-rag). After linking, the agent retrieves from your documents on every call.

## Next steps

- [Configure Knowledge & RAG](./agents/knowledge-rag) on an agent to use this content.
- [Build an agent](./agents/create-agent) and link your knowledge base.
- [Test the agent in chat](./agents/overview#test-before-you-publish) to confirm it answers from your documents.
