---
title: "Knowledge"
description: "Give an agent background text and documents it can rely on in every chat."
---

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

# Knowledge

Knowledge is background material an agent should always have. Add it in the **Context** section of the agent. It works for facts like product details, style guides or price lists. For rules and behavior, use the instructions on the **Persona** section instead.

## Free text

Type or paste text into the **Background knowledge** field. The agent reads it in every chat.

The field works like the instructions in the **Persona** section: it is a formatted editor, and the text reaches the model exactly as written, including tags such as `<facts>`. Switch to **Raw text** to edit the stored markdown directly, or use **Expand** for more room. See [Create an agent](https://docs.ragna.io/agents).

The field is limited to 30,000 characters. A counter in the bottom right corner shows the length, for example **12 / 30,000**. It turns red above the limit, and the agent cannot be saved until the text is shorter.

## Documents

Upload files under **Documents** in the **Context** section. RAGNA Studio extracts the text and adds it to the agent's knowledge base. Each agent has one knowledge base.

The drop zone sits on top. Files can be dragged into it, or the zone can be clicked to browse. The supported types are PDF, DOCX, PPTX, XLSX, CSV, TXT and MD. Each file can be up to 10 MB. An agent holds up to 25 documents.

A table lists the documents with their **Status** and **Size**. The status is one of:

| Status       | Meaning                                                                               |
| ------------ | ------------------------------------------------------------------------------------- |
| **Indexing** | RAGNA Studio is extracting and indexing the text. The list refreshes on its own.      |
| **Indexed**  | The agent can use the document.                                                       |
| **Failed**   | Extraction failed. Hover the badge to see why. Use **Retry extraction** to try again. |

The ⋮ menu of a row has **Rename document**, **Replace file**, **Retry extraction** and **Delete document**.

Two limits apply to the text of a document:

- A single document is cut off after 500,000 characters. The list then notes "Truncated: only the first part of this document was kept."
- The indexed documents of one agent hold up to 5,000,000 characters together.

Only **Indexed** documents count toward these limits and reach the agent.

## Small and large knowledge

RAGNA Studio decides how the agent reads its documents. Users don't configure it.

- **Up to 30,000 characters in total:** the full text of all indexed documents goes into every chat. The agent sees everything at once.
- **Above 30,000 characters in total:** the agent gets a list of document names and sizes. It searches the documents for the passages it needs.

The switch is automatic. It happens when the documents grow past the limit, and it reverts if they shrink again. The free text in the **Background knowledge** field always goes into the chat in full.

## How the agent searches

Above 30,000 characters, the agent has two search steps:

- **Search Knowledge:** finds the passages that match a question.
- **Read Knowledge:** reads the passages before and after a hit, up to three on each side.

The search combines two methods. It matches by meaning, and it matches the exact words. So exact terms such as product codes, article numbers and clause numbers are found too, which a search by meaning alone often misses.

Documents are split by their headings. Each passage keeps its document name and its heading path, for example "Terms > Payment > Late fees". The agent is told to cite them, so the user can see which document and which section a statement comes from.

If an answer misses a detail, ask the agent to search for the exact term.

## Task runs

A [task](https://docs.ragna.io/content/tasks) run searches exactly the documents of the [approved agent version](https://docs.ragna.io/agents#lock-and-approve) it runs with.

## Related

- [Documents](https://docs.ragna.io/content/documents) are workspace files. They are separate from agent knowledge. Give an agent the Documents [tool](https://docs.ragna.io/agents/tools) to let it read those.
- [Memory](https://docs.ragna.io/agents/memory) holds facts the agent learns by itself during chats.

Source: https://docs.ragna.io/agents/knowledge/index.mdx
