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

# Knowledge Base

> Give your agent the documents, FAQs, and websites it should answer from. Upload files, type FAQs, add URLs to crawl, and turn on web search when you want the agent to look beyond your content.

<Note>
  Knowledge Base is **Step 4 (Hybrid)** or **Step 3 (Text / Voice)**. The page has four tabs: **Files**, **FAQs**, **URLs**, **Search**. Every item you add is saved immediately, you don't need to click Save Draft on this step.
</Note>

## How the agent uses the knowledge base

When a customer asks something, the agent searches your knowledge base for the most relevant chunks (passages from files, matching FAQs, indexed URL pages) and uses them to write its answer. Items go through a multi-stage **status pipeline** before they're ready: **pending → processing → training → trained**. Only **trained** items are queryable.

If you turn on **Search**, the agent can also look at the public internet (or a list of domains you specify) when none of your trained content matches.

## Tab bar

A custom tab bar at the top of the page with stat chips per tab.

| Tab        | What's there                                                                       |
| ---------- | ---------------------------------------------------------------------------------- |
| **Files**  | Document uploads (PDF, DOCX, TXT, etc.) with the two-phase upload and bulk actions |
| **FAQs**   | Q\&A pairs you type, with CSV import / export                                      |
| **URLs**   | Web pages the agent crawls and re-crawls on a schedule                             |
| **Search** | A switch to allow public web search, with optional domain restrictions             |

Each tab carries its own count chip (e.g. **12 files**, **34 FAQs**, **8 URLs**, **Search on**).

## Files tab

### Supported file types

| Type         | Extensions                 |
| ------------ | -------------------------- |
| Documents    | **PDF**, **DOCX**, **TXT** |
| Spreadsheets | **CSV**, **XLSX**          |
| Images       | **PNG**, **JPG**           |

| Limit         | Value                |
| ------------- | -------------------- |
| Per-file size | **10 MB**            |
| Total storage | **100 MB** per agent |

When total storage is full, the drag-drop zone is disabled and a red warning replaces the upload prompt.

### Two-phase upload

Files don't upload immediately. They go through a deliberate two-step flow so you can review before sending big batches.

<Steps>
  <Step title="Drop or browse">
    Drag files onto the upload zone, or click to open a file picker. Each accepted file appears in a list as a **pending placeholder** (status chip: **Pending**). The raw file is held in your browser until you confirm.
  </Step>

  <Step title="Pending bar appears">
    A bar at the top of the file list reads **N new files ready to train**, with two buttons: **Cancel** (clears pending files) and **Upload & Train** (sends them to the server). Filenames are deliberately not shown in the pending bar (long filenames break the layout). They appear in the file list below.
  </Step>

  <Step title="Upload & Train">
    Click **Upload & Train**. Files are sent to the server in one batch. The status flips to **Processing** (amber chip), then **Training** (primary chip with pulse), then **Trained** (green chip) once the agent can answer from them. If something goes wrong, the chip becomes **Failed** (red).
  </Step>
</Steps>

### Status chips

| Status         | Color         | Meaning                                    |
| -------------- | ------------- | ------------------------------------------ |
| **Pending**    | grey muted    | Local placeholder, not yet uploaded        |
| **Processing** | amber + pulse | Server received the file, parsing it       |
| **Training**   | blue + pulse  | Adding it to the agent's index             |
| **Trained**    | green         | Ready, the agent can answer from this file |
| **Failed**     | red           | Something went wrong server-side           |

The wizard polls the server while items are in transient states (Pending / Processing / Training) so you see status changes live without refreshing.

### File list

A sortable table once you have files. Columns:

| Column                 | Sort behavior                                                                                                                                   |
| ---------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------- |
| Checkbox               | Select all on the header, individual on each row                                                                                                |
| **File** (name + icon) | Alphabetical                                                                                                                                    |
| **Status**             | By state priority (Pending > Processing > Training > Failed > Trained)                                                                          |
| **Size**               | Numeric                                                                                                                                         |
| **Uploaded**           | Most recent first by default. This is the only column where Status priority breaks ties (so a freshly-added pending row surfaces near the top). |
| **Type**               | Alphabetical by extension                                                                                                                       |
| Actions                | Hover-revealed Trash icon per row                                                                                                               |

Click any column header to sort by that column. Click again to reverse. The active sort column is highlighted.

Pagination kicks in at 25 rows.

### Bulk actions

When you tick rows, a bulk action bar appears with:

* **Select all on this page** checkbox
* **Retrain** , re-runs the indexing pipeline on the selected files
* **Download** , downloads the original files as a zip
* **Delete** , opens a confirmation dialog, then deletes the selected files

Bulk delete requires confirmation, the dialog reads **Are you sure?** with a red **Delete** button.

### Empty state

When you have no files yet, the file list area shows an empty state card with a file icon and the line **No files yet** (plus a hint about supported types). The empty state stretches to fill the area so the page doesn't look broken.

## FAQs tab

Question and answer pairs that the agent uses verbatim when a customer asks something matching the question.

### Adding FAQs

Two ways:

1. **Type them manually** , click **Add FAQ**, fill in **Question** and **Answer**, save. New FAQs first appear as pending cards; click **Train all** (or wait for batch training) to convert them into trained table rows.
2. **Import from CSV** , click **Import CSV**, upload a `.csv` file with two columns: `question, answer`.

| Limit                   | Value                                                     |
| ----------------------- | --------------------------------------------------------- |
| Question max length     | **300 characters**                                        |
| Answer max length       | **2,000 characters**                                      |
| Max rows per CSV import | **500**                                                   |
| CSV encoding            | **UTF-8 with BOM** (so Arabic renders correctly in Excel) |

### Editing & deleting

| Action      | Behavior                                                         |
| ----------- | ---------------------------------------------------------------- |
| Inline edit | Click any FAQ row to expand and edit Question / Answer in place  |
| Bulk select | Checkboxes on each row, plus a select-all checkbox in the header |
| Bulk delete | Same confirmation dialog as Files                                |
| Bulk export | Downloads selected FAQs as a UTF-8 BOM CSV                       |

The CSV import / export round-trips cleanly: you can export your FAQs, edit in Excel or Google Sheets, and re-import with no encoding drift.

## URLs tab

Add public web pages and the agent crawls them on a schedule, indexing their content into the knowledge base.

### Adding URLs

Type or paste a URL into the input. Click **Add URL**. The agent validates the URL:

* Must start with `http://` or `https://`. Other protocols (`javascript:`, `data:`, `file:`, etc.) are rejected.
* Must be a public, reachable URL.

Once added, the URL goes into the same status pipeline as files: **Pending → Indexing → Indexed**, or **Failed** on error.

### URL list

| Column           | What it shows                                                        |
| ---------------- | -------------------------------------------------------------------- |
| **URL**          | The URL itself                                                       |
| **Status**       | Same chip styles as Files: Pending, Indexing, Indexed, Failed        |
| **Pages**        | Number of pages indexed from that URL                                |
| **Last Crawled** | Timestamp of the most recent crawl                                   |
| Actions          | **Recrawl** (re-runs the crawler) and **Delete** (with confirmation) |

## Search tab

Lets the agent look at the public internet (or a list of domains you specify) when its knowledge base doesn't have an answer.

### Master toggle

A single switch: **Allow public web search**. When **off**, the agent will say *I don't have that information* if the knowledge base doesn't cover the question. When **on**, an amber note appears warning about the implications:

> *Allowing the agent to search the public internet means it may surface content you didn't author. Consider scoping it with a domain list below.*

### Domain restriction list

When the search switch is **on**, an optional list of allowed domains appears. Add one domain per row (e.g. `example.com`). When the list is non-empty, the agent only searches those domains. When the list is empty, search covers the entire public web.

| Action          | Behavior                                                                              |
| --------------- | ------------------------------------------------------------------------------------- |
| Add a domain    | Type or paste, then **Add**. Same protocol whitelist as URLs (no `javascript:` etc.). |
| Remove a domain | Click the trash icon. The list updates immediately.                                   |
| Bulk save       | Not needed, each add / remove is saved as it happens.                                 |

## How saves work on this step

Knowledge Base is the only step that **doesn't bulk-save**. Every item you add (a file, an FAQ, a URL, a domain restriction) is saved immediately, item by item. That's why the **Save Draft** button doesn't have a "save the KB" effect, there's nothing to save, it's already saved.

Deletes always require a confirmation dialog with a red **Delete** button.

## Common questions

<AccordionGroup>
  <Accordion title="My file got stuck on Processing.">
    Refresh the page once. The wizard's polling sometimes loses the connection on slow networks. If it's still stuck after 5 minutes, retrain the file via the Files tab bulk **Retrain** action.
  </Accordion>

  <Accordion title="The agent isn't using my FAQ.">
    Two checks: (1) the FAQ status is **Trained** (not Pending), (2) the question phrasing in the FAQ is similar to how customers actually ask. Try adding a second FAQ with a paraphrase of the same question.
  </Accordion>

  <Accordion title="I uploaded a 12 MB PDF and it was rejected.">
    Per-file limit is 10 MB. Split the PDF into smaller chunks, or compress images inside the PDF, then re-upload.
  </Accordion>

  <Accordion title="My CSV import showed Arabic as `???`.">
    The CSV must be **UTF-8 with BOM**. Open it in Excel, export it as **CSV UTF-8 (Comma delimited)**. Or use the **Export CSV** in the FAQs tab as your template, that file is BOM-encoded.
  </Accordion>

  <Accordion title="A URL I added shows 'Pages: ,'.">
    The Pages count and Last Crawled timestamp are columns the backend doesn't fill yet. The crawl still happens, the agent does answer from the URL's content. The display columns will populate once the backend ships those fields.
  </Accordion>

  <Accordion title="Can I limit the agent to only answer from one specific file?">
    Not on this step. The agent searches across all trained items. To scope answers, write your **system prompt** in [Text Settings](/en/Systems/AI-Agents/Wizard/Text-Settings) to point the agent at specific topics.
  </Accordion>

  <Accordion title="The Search toggle is off but the agent still answers things I didn't upload.">
    Models have general world knowledge that's separate from your knowledge base. The toggle controls *web search*, not what the model already knows. To force strictly-grounded answers, write that into your system prompt: *Only answer using the provided knowledge base. If you don't know, say so.*
  </Accordion>
</AccordionGroup>

## Next

<Card title="Step 5: Tickets & Leads" icon="ticket" href="/en/Systems/AI-Agents/Wizard/Tickets-and-Leads">
  Configure how the agent collects customer info, files tickets, and qualifies leads. Plus notifications by email, Slack, or CRM.
</Card>
