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

# Knowledge bases

> Give the agent your documents (FAQs, policies, product details) to answer callers from during the call.

A knowledge base is a document the agent looks answers up in during the call: an FAQ, a policy, a product guide, a job description. Upload a PDF, DOCX, TXT or MD file, or paste text.

Each knowledge base is a function the agent can call, like a [tool](https://docs.talking-avatar.dev/voice-agents/tools.md). When a caller asks something on its topic, the agent calls it with the question, and gets back the answer from the document's text. The document isn't part of the prompt, so it doesn't count toward the prompt's 20,000 characters.

## Your library

Knowledge bases belong to your account, not to one agent. Click **Knowledge bases** in the sidebar to see them all, with their size, the agents using each one, and when each was last changed.

* Add a knowledge base once, and attach it to any number of agents.
* Edit it, and every agent using it answers from the new text from its next call. Calls in progress carry on with what they started with.
* Delete it, and the agents using it stop using it from their next call. This can't be undone.

## Add a knowledge base

**1. Click Add knowledge base**

On the **Knowledge bases** page, or on an agent's **Knowledge base** tab.

**2. Upload a file, or paste text**

Drag and drop a PDF, DOCX, TXT or MD file, or click **Write or paste text**. Files are read in your browser: only their text is saved, never the file.

**3. Review the name and instruction**

We suggest a **Function name** and an **Instruction** from the text (marked **AI generated**). Edit them if they're off.

**4. Click Add knowledge base**

It's added to your library. Added from an agent, it's attached to that agent too: click **Save changes** (**Create agent** for a new one) to keep it.

| Field | Description |
| - | - |
| **Function name** | What the agent calls it, such as `refund_policy`. Letters, numbers, `_` and `-`, up to 64 characters, and not `end_call`. Unique in your library, and different from the tools of every agent it's attached to. |
| **Instruction** | When to look here, such as *Use this to answer questions about refunds, returns and exchanges.* The agent reads it to decide which knowledge base to call. Up to 1,000 characters. |
| **Text** | The document's text. Up to 50,000 characters. Edit it any time with the pencil icon, in the library or on the agent's tab. |

> [!NOTE]
>
> A knowledge base that shares its name with one of an agent's tools is left out of that agent's calls. Rename one of them.

## Attach to an agent

On the agent's **Knowledge base** tab, click **Add knowledge base**:

* **From your library:** tick the ones to use, then click **Attach**.
* **Or add a new one:** upload a file or paste text, as above.

Then click **Save changes**. The **×** next to a knowledge base detaches it from the agent; it stays in your library. **Shared** shows when other agents use it too.

## Limits

| | |
| - | - |
| Knowledge bases per agent | Up to 10 |
| Text per knowledge base | Up to 50,000 characters |
| File types | PDF, DOCX, TXT and MD |

A longer document can be split across several knowledge bases, one topic each.

## How the agent answers

* The agent decides from each **Instruction** when to look something up, and asks with the caller's question.
* The answer comes from the document only, not from general knowledge.
* If the knowledge base it asked doesn't have the answer, the agent's other knowledge bases are checked too. The agent tells the caller it doesn't know only when none of them has it.

## Tips

* **One topic per knowledge base.** A refund policy and a product catalog work better as two, each with its own instruction.
* **Write a clear instruction.** Name what the document covers, so the agent knows when to call it.
* **Mention it in the prompt,** such as *Answer questions about our plans from pricing\_faq*.
* **Scanned PDFs have no text.** Their pages are pictures, so nothing can be read. Paste the text instead, or export a PDF with selectable text.

## Prompt, knowledge base or tool?

| Use | For |
| - | - |
| The [prompt](https://docs.talking-avatar.dev/voice-agents/prompting.md) | How the agent behaves, and the few facts it must always know: who it is, the flow of the call, your hours |
| A knowledge base | Reference documents it looks things up in: FAQs, policies, product details, a job description |
| A [tool](https://docs.talking-avatar.dev/voice-agents/tools.md) | Live data and actions: order status, availability, bookings, or searching a document set larger than 10 knowledge bases |


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