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

# Knowledge Base

> Store reference documents the agent searches on demand to interpret your terms, rules, and policies.

<Note>
  The Knowledge Base is available for orgs on the skills + persistent-memory architecture.
</Note>

The Knowledge Base is a tab in the Data Model editor — alongside **Tables** and **Global Data Security** — that holds reference documents the agent must read before it can interpret your business correctly: definitions, business rules, policies, company background, and known caveats about the data.

It answers a different need than [System Prompts](/ai-agent-builder/system-prompts). A system prompt is a compact set of rules the agent applies on **every** message. The Knowledge Base is a library of reference material the agent **searches on demand** — long-form documents that would swamp a system prompt but are invaluable when a question touches them. If your refund policy is two pages long, it belongs in the Knowledge Base, not the system prompt.

<Frame>
  <img src="https://mintcdn.com/upsolve/Jbl7moVDPeEAJImg/images/ai-agent-builder/knowledge-base-tab.png?fit=max&auto=format&n=Jbl7moVDPeEAJImg&q=85&s=3940518afd9ca7e7981e5d62a5324a5d" alt="Knowledge Base tab in the Data Model editor showing uploaded markdown files with tags" width="3456" height="2156" data-path="images/ai-agent-builder/knowledge-base-tab.png" />
</Frame>

## Adding files

Files can be added two ways from the Knowledge Base tab:

**Create inline** — write a new document directly in the built-in markdown editor. Best for definitions and rules you're authoring for the agent in the first place.

**Upload** — drop in existing `.md`, `.txt`, or `.docx` files. Uploads are converted to Markdown so that every file is editable in the same editor, diffable between versions, and readable by agents without a parser. The original file is not stored.

<Frame>
  <img src="https://mintcdn.com/upsolve/Jbl7moVDPeEAJImg/images/ai-agent-builder/knowledge-base-upload.png?fit=max&auto=format&n=Jbl7moVDPeEAJImg&q=85&s=742c2b60ba84d0e3fcd79230d7b72901" alt="Upload zone for dropping markdown, text, or Word documents into the Knowledge Base" width="3456" height="2154" data-path="images/ai-agent-builder/knowledge-base-upload.png" />
</Frame>

Organize files with **tags** so related documents stay grouped as the library grows.

## What belongs in the Knowledge Base

* **Definitions** — the canonical meaning of terms users will use loosely ("gross margin", "active account", "churn")
* **Business rules and policies** — refund windows, SLA tiers, pricing rules the agent should cite rather than guess
* **Company background** — how the business is structured, what entities relate to what
* **Data caveats** — "the `legacy_orders` table stops at March 2024", "EMEA revenue excludes partner channels"

The test is: would the agent need to **read** this to interpret a term correctly? If yes, it belongs here. If it's a short rule that must always apply without being looked up, it belongs in the [system prompt](/ai-agent-builder/system-prompts) instead.

## Versioning

The Knowledge Base is version-aware, just like the rest of the data model. There is one working copy per data model, and writes land on the **draft** version. Files are checkpointed when you publish a data model version, so every published version carries the exact set of documents the agent had at that point — and edits never silently alter a version that's live in production. See [Data Model & Schema](/ai-agent-builder/data-model-schema) for how draft and production versions work.

## How the agent uses it

At chat time, the agent doesn't preload your Knowledge Base. It reaches in with two tools:

* `search_context_files` — finds files relevant to the user's question
* `read_context_file` — reads a specific file's contents in full

So the cost of a large library is low: documents only enter the agent's context when retrieval says they're relevant. This is also why descriptive file names and good tagging matter — they improve what retrieval surfaces.

## Next steps

<CardGroup cols={2}>
  <Card title="Data Model & Schema" icon="database" href="/ai-agent-builder/data-model-schema">
    The foundation the Knowledge Base sits in — tables, columns, descriptions, and versioning.
  </Card>

  <Card title="Skills" icon="graduation-cap" href="/ai-agent-builder/skills">
    Package procedures and conventions the agent loads on demand.
  </Card>

  <Card title="System Prompts" icon="message" href="/ai-agent-builder/system-prompts">
    Short, always-on rules that apply to every message.
  </Card>

  <Card title="Golden Assets" icon="star" href="/ai-agent-builder/golden-assets">
    Example questions with trusted SQL and charts, retrieved by similarity.
  </Card>
</CardGroup>
