> For the complete documentation index, see [llms.txt](https://docs.klink.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.klink.cloud/kai-ai-agent-chat/knowledge-base.md).

# Knowledge base

Build and train the knowledge base that powers Kai (and AI Copilot).

A library of answers that powers **Kai** (and **AI Copilot**).

For the full agent setup (Studio, channels, workflow), see [How to setup AI Agent (Step by Step Guide)](/kai-ai-agent-chat/how-to-setup-ai-agent-step-by-step-guide.md).

## Add knowledge

1. Open **Knowledge Base**.
2. Click **Create**.
3. Choose one source:

| Source                | What to do                                                                     |
| --------------------- | ------------------------------------------------------------------------------ |
| **Write article**     | Write the article in the editor. Turn on **AI Agent** usage so Kai can use it. |
| **Upload PDF**        | Upload a **text** PDF (up to **45 MB**).                                       |
| **Sync with Web URL** | Crawl a website URL into the knowledge base.                                   |

### Sync with a website (example)

1. Choose **Website URL**.
2. Paste the business website (for example `https://escapebangkok.com`).
3. Select **Crawl single page** (for 1 URL), or **Crawl all pages under the domain**.
4. Click **Sync** and wait for training to complete.

## Train the AI (Corrections)

When Kai answers wrong:

1. Create a **Correction** with the right answer in the **Knowledge Base**, or
2. Use **Train AI** on a message (for example from the Emulator or a conversation).

Corrections teach Kai the preferred answer for similar questions.

## Related

* [How to setup AI Agent (Step by Step Guide)](/kai-ai-agent-chat/how-to-setup-ai-agent-step-by-step-guide.md)
* [Recipe: Let Kai answer first](https://docs.klink.cloud/advanced-setup/workflow-automation/recipe-let-kai-answer-first)
