# Knowledge bases

> Give an agent a help center or files to answer from, follow each source's runs, and see what it cites under the answer.

A knowledge base is a named body of content the agent searches while it answers: a crawled site, uploaded files, or both. Each one is made of sources, indexed on their own. Add a knowledge base to an agent and it searches the sources that are ready, answers from the passages it finds, and cites them under the answer.

## Create one and add sources

On **Knowledge**, press **New knowledge base**, name it, and press **Create knowledge base**. Then add sources on its page:

- **Add URL** crawls a public page and the pages under its path, such as a help center's home. Crawling starts at once.
- **Upload file** indexes one file as a source of its own. Plain text, code and markup up to 10 MiB; PDF, Office files, HTML, CSV and images up to 4 MiB. Images aren't read for text.

Each source shows **Indexing** with its progress, then **Ready** with its page count, or **Error** with the reason. The **Try a question** box on the knowledge base's page runs the same search the agents run, so you can check what it finds before an agent does.

### Crawl options

Set them when adding a URL, or later from the source's menu under **Edit crawl options**. Saving options doesn't crawl again; **Sync** the source afterwards.

| Option                 | Default              | What it does                                                  |
| ---------------------- | -------------------- | ------------------------------------------------------------- |
| **Page limit**         | 500                  | The most pages to index. 500 is also the cap.                 |
| **Link depth**         | Any                  | How many links to follow from the URL.                        |
| **Discovery**          | Sitemaps and links   | Where the crawl finds pages.                                  |
| **Include patterns**   | Under the URL's path | One per line. `*` matches within a path segment, `**` across. |
| **Exclude patterns**   | None                 | One per line. Matching pages are skipped.                     |
| **Render JavaScript**  | On                   | Needed for pages built in the browser. Off is faster.         |
| **Include subdomains** | Off                  | Also crawl the same path on the site's subdomains.            |

A site's Content Signals can refuse the crawl, which fails the run with that reason.

## Runs

Every sync is a run, shown newest first on the source's page with its stages: **Crawl**, **Store** and **Index** for a URL, **Upload** and **Index** for a file. A run lists every page it went through with **Indexed**, **Failed** and its reason, or **Not indexed**.

While a run goes, what the source indexed before stays searchable. When it finishes, unchanged pages are kept, changed pages are replaced, and pages the crawl no longer found are removed. **Cancel run** stops it and deletes nothing.

## Give it to an agent

Open the agent's editor, press **Add a knowledge base** under **Knowledge**, and save. The agent's prompt then names its knowledge bases and tells it to search them with `search_knowledge` before answering a question they may cover, to answer from the passages, and to cite no source the search didn't return.

A search returns up to 8 passages, each with its knowledge base, title, URL, score and text. The panel shows them under the answer as numbered chips, one per page or file, in the [sources card](https://superassist.app/components/cards/sources-card.md).

Deleting a knowledge base deletes its sources and their indexed content, so agents no longer find them.
