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

# Knowledge

> The documents your agent answers from: adding them, how the agent uses them, and RAG settings for large documents.

Open **Knowledge** to manage what the agent chosen in the **Agent** selector can refer to during a conversation:
web pages, files and text such as your policies, FAQs and product details. Everything on this page applies to that
agent; to work on another agent, choose it in the selector.

<Frame caption="The Knowledge Base page, with the documents attached to the agent.">
  <img src="https://mintcdn.com/ruleinside/KY_HxF97SL5TB96U/images/portal/05-knowledge.webp?fit=max&auto=format&n=KY_HxF97SL5TB96U&q=85&s=6270aeea30281346ef053e2c7197796a" alt="The Knowledge Base page in the portal" width="1440" height="940" data-path="images/portal/05-knowledge.webp" />
</Frame>

## Who can change knowledge

Any member can see this page. To change anything you need **both**:

* to be an **owner** of the account, and
* the active agent to be at **Full control** (see [Edit levels](/agent-settings#edit-levels)). Agents you create
  are always at Full control; your main agent often is not.

Otherwise the page is read-only. The header says "This agent is managed, its knowledge is configured by
RuleInside." (agent below Full control) or "Only account owners can change knowledge, ask an owner of your team."
(member), and each document shows its mode as plain text.

## The document list

The page title is **Knowledge Base**, with "What … can reference during a conversation." and your agent's name.

* **Configure RAG** and **Add document** (only when you can change knowledge).
* A search box, **Search Knowledge Base…**, which matches document names.
* Filters: **All**, **File**, **URL**, **Text**.

The search and filters appear once the agent has documents. The list shows:

1. **RuleInside's documents**, marked **Managed**. You cannot change or remove them.
2. **Your documents attached to this agent**, each with a type badge and, when you can change knowledge:
   * a mode menu, **Prompt** or **Auto** (see below),
   * **Remove**, to take it off this agent only,
   * a trash button, to delete it everywhere.

## How the agent uses a document

Each of your documents has a mode on each agent:

* **Prompt**: always given to the agent.
* **Auto**: looked up when it is relevant to the question.

The page footer reads: "Documents in Prompt mode are always included; in Auto mode they're retrieved when relevant
(enable RAG for large documents). Small documents (under \~500 bytes) can't be RAG-indexed."

<Note>
  Switching a document to **Auto** does not prepare it for look-up on its own. Open **Configure RAG**, make sure
  **Enable RAG** is on, and click **Save**: that prepares every one of your **Auto** documents on this agent.
</Note>

## Buttons on a document

| Button | What happens | Can it be undone? |
| - | - | - |
| Mode menu (**Prompt** / **Auto**) | Changes how this agent uses the document. Saves straight away. | Yes, change it back. |
| **Remove** | Takes the document off this agent only. It stays on your other agents and in your documents. Saves straight away. | Yes: attach it again with **Add document**. |
| Trash (**Delete**) | Deletes the document for good and removes it from every agent that uses it. Asks for confirmation first. | **No.** |

Deleting asks "Delete this document?": "'…' will be permanently deleted and removed from every agent that uses it.
To take it off only this agent, use Remove instead. This can't be undone." Click **Delete document**
("Deleting…") to confirm, or **Cancel**.

<Warning>
  Deleting a document cannot be undone, and it removes the document from every agent at once. To take it off one
  agent only, use **Remove**.
</Warning>

Messages you may see:

* Mode or Remove failed: "Could not update documents." (or the reason), and the page reloads.
* On your main agent below Full control: "This agent is managed, documents can only be attached to your own
  agents."
* Delete: "Document deleted." or "Could not delete the document."

## Adding a document

<Frame caption="The Add document menu: reuse one of your documents, or add a URL, a file or text.">
  <img src="https://mintcdn.com/ruleinside/KY_HxF97SL5TB96U/images/portal/05b-knowledge-add.webp?fit=max&auto=format&n=KY_HxF97SL5TB96U&q=85&s=e90d2a970abf3ebf87df99f2eede882d" alt="The Add document menu" width="320" height="169" data-path="images/portal/05b-knowledge-add.webp" />
</Frame>

Click **Add document**. A menu opens with two ways to add one.

**Reuse a document you already have.** Search with "Search documents…" among your documents that are not on this
agent (each shows its name and ID), and click one to attach it in **Prompt** mode. "No existing documents. Create
one below." means you have none to reuse; "No matches." means your search found nothing.

**Create a new document** with **URL**, **Files** or **Text**:

| Dialog | Fields | Rules |
| - | - | - |
| **Add URL**: "The agent will read this page as a knowledge source." | **Name (optional)** (placeholder "e.g. Return policy", up to 120 characters); **URL** (placeholder "[https://yourstore.com/faq](https://yourstore.com/faq)") | URL required ("Enter a URL."). "Must be a public https URL, internal/private addresses are blocked." No IP addresses, `localhost` or user names in the address. The name defaults to the URL. |
| **Create text**: "Paste text the agent can use to answer questions." | **Name** (up to 120 characters); **Content** (placeholder "Paste your policy, FAQ, product details…") | Content required ("Enter some text."). If you leave the name empty, the document is called "Text document". |
| **Add file**: "PDF, TXT, DOCX, HTML or EPUB, up to 21MB." | **Name (optional)**; **File** | A file is required ("Choose a file."). Accepted: .pdf, .txt, .docx, .html, .epub. Larger than 21 MB is refused ("File exceeds the 21MB limit."). The name defaults to the file name. |

Click **Add document** ("Adding…") to create it, or **Cancel**. A new document belongs to your account and is
attached to the active agent in **Prompt** mode: "Document added." On failure you see the reason, or "Could not add
the document." ("Could not upload the file." for files).

## Configure RAG

<Frame caption="The RAG configuration panel.">
  <img src="https://mintcdn.com/ruleinside/KY_HxF97SL5TB96U/images/portal/05a-knowledge-rag.webp?fit=max&auto=format&n=KY_HxF97SL5TB96U&q=85&s=959d22cd4bd17efc15098e9085918510" alt="The RAG configuration panel" width="576" height="959" data-path="images/portal/05a-knowledge-rag.webp" />
</Frame>

RAG (Retrieval-Augmented Generation) lets the agent pull only the relevant parts of large documents into each
answer, instead of loading whole documents. Click **Configure RAG** to open **RAG configuration**. It is available
only to owners, on an agent at **Full control**.

| Field | What it does | Values | Default |
| - | - | - | - |
| **Enable RAG** | "Retrieval-Augmented Generation (RAG) increases the agent's maximum Knowledge Base size. The agent will have access to relevant pieces of attached Knowledge Base during answer generation." | On or off | The agent's current setting (off if never set) |
| **Embedding model** | How text is matched to the question | **English optimized** or **Multilingual optimized** | English optimized |
| **Character limit** | "Limit the total number of characters retrieved per query." | A whole number, 0 or more | 50000 |
| **Chunk limit** | "Limit the number of document chunks retrieved per query." | A whole number, 1 or more | 20 |
| **Vector distance limit** | "Document chunks with a vector distance higher than this value (i.e., less similar) will not be retrieved." A slider from **More similar** to **Less similar**. | 0 to 2, in steps of 0.01 | 0.6 |
| **Number of candidates** | "Number of candidates evaluated in ANN vector search. Higher number means better results, but higher latency. Minimum recommended value is 100. If disabled, the default value is used." | A switch, then a number of 100 or more | Off; 100 when switched on |
| **Query rewrite prompt override** | "Override the default prompt used for rewriting user queries before retrieving documents. The conversation history will be automatically appended at the end." | A switch, then a text box filled with the default prompt | Off |

While **Enable RAG** is off, only the switch is shown.

Click **Save** ("Saving…"):

* **With RAG on**, your settings are saved, then every one of your documents attached to this agent in **Auto**
  mode is prepared for look-up. You see "RAG enabled, indexing … document(s) for retrieval." or "RAG settings
  saved." Documents under about 500 bytes, and any that fail, are skipped.
* **With RAG off**, only RAG is switched off; the other values are not saved.
* On failure you see the reason, or "Could not save RAG settings." On your main agent below Full control: "This
  agent is managed, RAG can only be configured on your own agents."

## What you might see

| Message | What it means |
| - | - |
| "Knowledge base isn't enabled on your plan. …" | Knowledge is not switched on for your account. Contact RuleInside. |
| "This workspace is not linked to a store yet." | Your workspace is not connected to your store yet. |
| "Couldn't load your knowledge base. Refresh to try again." | The page failed to load. Refresh it. |
| "No documents found" / "This agent has no attached documents yet." | The agent has no documents. Owners also see **Add document**. |
| "No documents match your search." | Nothing matches your search or filter. |
| "You do not have permission to manage knowledge." | You are a member; ask an owner. |

Document controls are greyed out while a change or delete is running.

## Common questions

<AccordionGroup>
  <Accordion title="What is the difference between Prompt and Auto?">
    **Prompt** documents are always given to the agent. **Auto** documents are looked up when relevant; for large
    documents this needs RAG switched on and saved.
  </Accordion>

  <Accordion title="I set a document to Auto but the agent does not use it">
    Open **Configure RAG**, make sure **Enable RAG** is on, and click **Save**. That prepares your Auto documents.
    Very small documents (under about 500 bytes) cannot be prepared; keep those in **Prompt** mode.
  </Accordion>

  <Accordion title="Remove or Delete?">
    **Remove** takes the document off this agent only. Delete (the trash button) erases it from every agent, and
    cannot be undone.
  </Accordion>

  <Accordion title="Why can't I change the knowledge base?">
    Either the active agent is below **Full control** (often your main agent) or you are not an owner.
  </Accordion>

  <Accordion title="Can I change RuleInside's knowledge base?">
    No. Documents marked **Managed** are kept by RuleInside.
  </Accordion>

  <Accordion title="Which file types can I upload?">
    PDF, TXT, DOCX, HTML and EPUB, up to 21 MB each.
  </Accordion>

  <Accordion title="Can I use the same document on two agents?">
    Yes. Choose the second agent in the selector, click **Add document**, and pick the document from the list at the
    top of the menu.
  </Accordion>

  <Accordion title="My URL is refused">
    It must be a public `https://` address, with a domain name rather than an IP address, and no user name or
    password in it.
  </Accordion>

  <Accordion title="Can I edit a document after adding it?">
    There is no edit button. Add the new version as a new document, then delete or remove the old one.
  </Accordion>

  <Accordion title="Can I add documents from the agent editor?">
    No. The **Knowledge base** card in the agent editor only lists the documents; on an agent you can change it links
    here (**Manage knowledge**). Add and manage documents on this Knowledge page.
  </Accordion>
</AccordionGroup>


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