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

# Knowledge Base

> Browse, search, and edit your knowledge base, see what changed, and roll it back

The knowledge base is the set of documents the agent reads before it answers: your tables, metrics, business rules, and notes. Everyone in a workspace can browse it and its history. Developers can edit it.

## Open the knowledge base

* **Developers:** go to **Context Factory > Knowledge**.
* **Everyone else:** open your user menu and choose **Knowledge**, under your workspace.

## Browse and search

The page has two views. Switch between them with the buttons beside the page title.

* **Tree view** shows namespaces as folders on the left and the open document on the right.
* **Table view** lists every document with its **Name**, **Type**, **Namespace**, **Version**, and **Last Modified** date. Type in **Filter by name, type, namespace...** to narrow the list, or filter by **Type** and by **Modified** (last 24 hours, 7 days, or 30 days).

Turn on **Show system namespaces** to see the namespaces Delphina maintains itself (see [Namespaces and document types](#namespaces-and-document-types)).

Documents shared with your workspace from another workspace are marked **Read Only**. See [Knowledge sharing](https://docs.delphina.ai/workspaces.md#knowledge-sharing).

To find a document by what it says rather than where it lives, use [Search](https://docs.delphina.ai/analytics-agent/search.md) and pick the **Knowledge** tab.

## Namespaces and document types

Documents are organized hierarchically: `{domain}/table/{name}`, `{domain}/metric/{name}`, `{domain}/rule/{name}`, `{domain}/note/{name}`. Documents reference each other with wiki links like `[[sales/table/orders]]`.

| Type | What it documents |
| - | - |
| **Table** | A warehouse table: schema, relationships, common filters, and usage notes. |
| **Metric** | A business metric: its definition, tested SQL, source tables, and filters. |
| **Rule** | A business rule the agent must apply, such as excluding test accounts. |
| **Note** | Anything else worth knowing, such as an overview of a domain. |

The system namespaces are hidden by default. `raw` holds the source files you upload, and `evals` holds your [evaluation](https://docs.delphina.ai/trust-and-quality/evaluations.md) cases.

## Edit in the UI

> [!NOTE]
>
> Editing requires the Developer role. Everyone else can browse but not change the knowledge base.

Open a document and click **Edit**. You can change its Markdown content, and its **Namespace**, **Type**, and **Name**. Changing those moves the document. Click **Save** to publish the change, or **Cancel** to discard it. **Delete** removes the document.

To add a document, click **Create document** at the top of the page.

You can't edit while you're browsing an earlier version, or a document shared from another workspace.

### UI or `/knowledge`

Edit in the UI when you know exactly what to change: a typo, a filter value, a sentence that's out of date.

Use `/knowledge` in chat when you want the agent to do the work: write a new document in the standard structure, test its SQL against your warehouse, add wiki links to related documents, or investigate how a metric is computed before documenting it. See [Maintenance](https://docs.delphina.ai/knowledge-agent/maintenance.md).

Both paths are recorded in the same [version history](#see-what-changed).

## Knowledge PRs

A **knowledge PR** is a proposed set of changes to the knowledge base. Instead of publishing straight away, the changes wait until someone approves them.

An edit becomes a knowledge PR when:

* your organization requires review for that change, in which case saving shows **Submitted for review**; or
* you check **Request review** before you click **Save**.

Knowledge PRs appear in the [Inbox](https://docs.delphina.ai/knowledge-agent/inbox.md), marked **KB PR**, and in [Search](https://docs.delphina.ai/analytics-agent/search.md) under **Knowledge PRs**. Open one to read the proposed changes and its comments, then:

* **Run evals** to test the proposed knowledge against your [evaluation](https://docs.delphina.ai/trust-and-quality/evaluations.md) suite before it merges.
* **Approve & merge**, or **Merge** once it has all the approvals it needs.
* **Revise in chat** to rework it with Delphina.
* **Reject** it.

Your organization's review rules set who can approve.

## See what changed

Click **Version History** on the knowledge page. It opens **Versions**, scoped to whatever you have open: a document, a folder, or, from the top of the tree, the whole knowledge base. Click **View all versions** to widen a scoped list. You can also click **Full history →** on the Knowledge card on the **Context Factory** page.

Each version shows when it was made, who made it (and the chat, if it came from one), and each document it **added**, **modified**, or **deleted**. A version that merged through a knowledge PR links to it. Saves made close together are grouped into one entry.

From a version you can:

* **View Changes** — see a line-by-line diff against the version before it. Use the two pickers beside **Comparing:** to compare any two versions.
* **Browse Version** — open the knowledge base as it was at that version.
* **Restore Version** — roll back (see below).

### Roll back

> [!WARNING]
>
> **Restore Version** returns every document to that version, not only the one you're looking at.

Restoring requires the Developer role. The restore is saved as a new version, so you can undo it the same way. If your organization reviews knowledge changes, the restore opens as a knowledge PR.

To undo a change to a single document, open it with **View Changes** and edit the document back.

## Who can do what

| Action | Who |
| - | - |
| Browse, search, and view version history | Every workspace member |
| Create, edit, delete, and restore documents | Workspace Developers |
| Approve a knowledge PR | Whoever your organization's review rules name |

## Related

* [Maintenance](https://docs.delphina.ai/knowledge-agent/maintenance.md) — editing knowledge with `/knowledge`
* [Flywheel Agents](https://docs.delphina.ai/knowledge-agent/flywheel-agents.md) — the agents that keep the knowledge base current
* [Context Factory](https://docs.delphina.ai/context-layer.md) — how the knowledge base fits with sources and consumers


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