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

# Managing the Knowledge Base

> Learn how to organize, update, and maintain your AI knowledge base (Admin feature)

<Note>
  This is an **administrator-only feature**. Only users with admin privileges can upload, delete, or assign documents to Master Prompts.
</Note>

## Where to manage documents

Open **Dashboard → Administration → AI Master Prompts → Documents** (older builds label the path **Admin Panel → AI Settings → Knowledge Base**). This screen shows the entire file library plus quick links to every Master Prompt that can use those files.

## What the Documents table shows

Every upload appears once in the library with these columns:

* **Document** – stored title plus the original filename so you can find the source file.
* **Size / Tokens** – quick health check on how big the file is and how many tokens it will add to a prompt.
* **Status** – Processing, Ready, Failed, or Disabled. Ready files can be attached to prompts; other states are read-only.
* **Enabled for Prompt** – a switch that lets you include or exclude the document for the prompt you’re editing.
* **Uploaded By / Actions** – who added it, plus download and delete buttons.

<Info>
  There are no folders, categories, or tags. Organization happens through **Master Prompts**: upload once, then select the documents you want in each prompt’s version.
</Info>

## Master Prompt quick-start

<Steps>
  <Step title="Create a Master Prompt">
    From **AI Master Prompts**, click **+ Create Prompt** and give it a clear name and description so other admins know when to use it.
  </Step>

  <Step title="Upload supporting files">
    Use the **Upload Documents** button to add the PDFs, DOC/DOCX, TXT, or MD files that should feed this prompt. Each file only needs to be uploaded once for your entire organization.
  </Step>

  <Step title="Enable the right documents">
    When a file’s status changes to Ready, flip the **Enabled for Prompt** toggle to include it in the current prompt version. Leave the toggle off for anything you don’t want referenced.
  </Step>

  <Step title="Generate the prompt">
    Click **Generate Prompt** in the top-right corner to compile every enabled document into a single master prompt the agent can use. If a prompt already exists, the button reads **Save & Regenerate**—it performs the same compile step after you add or remove files.
  </Step>

  <Step title="Assign users">
    In the right-hand sidebar, open **Assign Users**, search by name, and select the team members who should use this prompt. They’ll inherit the compiled context immediately.
  </Step>

  <Step title="Confirm it’s ready">
    Wait for the generation status to show complete, then test the AI with a question that should be answered by the included documents.
  </Step>
</Steps>

<Note>
  Need one prompt for everyone? From the prompt list, choose **Set as Default** so the entire team uses it without individual assignments. Only one Master Prompt can be the default at any time.
</Note>

## Document statuses

| Status     | Meaning                                                                  | What to do                                                   |
| ---------- | ------------------------------------------------------------------------ | ------------------------------------------------------------ |
| Processing | The system is extracting text.                                           | Wait; large PDFs can take a minute.                          |
| Ready      | Text is indexed and can be enabled for prompts.                          | Toggle it on wherever you need it.                           |
| Failed     | Something prevented parsing (often a password-protected or scanned PDF). | Re‑export the file as text-based PDF/DOCX/TXT and re-upload. |
| Disabled   | File exists but is not available to any prompt.                          | Toggle it back on or delete it if no longer needed.          |

## Uploading or replacing files

1. Click **Upload Documents** and choose one or more files (PDF, DOC/DOCX, TXT, or MD).
2. The files enter the Processing state while text is extracted.
3. Once Ready, they appear in the global list and are selectable inside every Master Prompt—no need to upload duplicates for different prompts.

<Tip>
  Give each file a descriptive title before uploading (e.g., “Finance – Expense Policy – Apr 2024”). Titles are what admins see when toggling documents on or off.
</Tip>

## Enabling documents for a Master Prompt

1. Open the Master Prompt you want to edit (from **AI Master Prompts → Edit**).
2. Use the **Enabled for Prompt** switches to decide which Ready documents belong in that prompt.
3. Generate or regenerate a prompt version so the new document set is baked into the assistant’s instructions.
4. Repeat for additional prompts—each prompt keeps its own document selection, but all selections draw from the same upload list.

Only Ready documents can be enabled. If a file is still Processing or Failed, resolve that issue first.

## Managing prompt versions and assignments

* Each Master Prompt keeps multiple versions. After changing the document selection, promote a new version so the AI uses the updated context.
* You can designate a **Default** prompt for the whole team or assign specific prompts to individuals via the Users panel on the edit screen.
* Versions show token counts and optimization stats to help you keep prompts lightweight.

## Cleaning up the library

* Use the checkboxes plus **Delete Selected** to remove multiple obsolete files.
* Download a copy before deleting if you need an offline backup; deletions are permanent.
* If content is temporarily outdated, leave the file disabled instead of deleting it so you can re-enable it later.

## Troubleshooting quick checks

* **Upload is stuck on Processing** – split overly large files or export as text-based PDF.
* **Document shows Failed** – open the original file, remove passwords, or run OCR so text is selectable, then upload again.
* **AI isn’t using the new info** – confirm the file is Enabled for the relevant prompt and that you promoted a version after toggling it on.

## What’s next?

* [Uploading new documents](/ai/uploading-documents)
* [Creating custom master prompts](/ai/creating-custom-prompts)
