# Knowledge Base

> The Knowledge Base is the core of your AI Agent's expertise. These endpoints manage its settings and trigger retraining.

The Knowledge Base is the core of your AI Agent's expertise — it contains all the information your AI uses to answer questions. These endpoints let you manage the Knowledge Base configuration and trigger retraining after content changes.

The Knowledge Base draws from [Articles](/api-reference/knowledge-base/articles/) you create, import from websites, or upload as files. After making changes to articles, you need to [retrain](/api-reference/knowledge-base/#retrain-knowledge-base) the Knowledge Base for updates to take effect in conversations.

## Get Settings

Retrieve your Knowledge Base configuration.

**Scope: read_all**

`GET https://app.quickchat.ai/v1/api/knowledge_base/`

**Shell**

```shell
curl https://app.quickchat.ai/v1/api/knowledge_base/ \
  -H 'Authorization: Bearer <API_TOKEN>'
```

**Python**

```python
import requests

response = requests.get(
    url="https://app.quickchat.ai/v1/api/knowledge_base/",
    headers={"Authorization": "Bearer <API_TOKEN>"},
)
data = response.json()
```

**Response** `200 OK`

```json
{
  "one_word_description": "Support Agent",
  "short_description": "A helpful customer support assistant.",
  "ai_commands": ["Be polite", "Stay on topic"],
  "retrain_state": null
}
```

| Field | Description |
|-------|-------------|
| `one_word_description` <br/> string | AI Agent name. Dashboard: **Identity > Profile > AI Agent Name** |
| `short_description` <br/> string | System prompt / AI Agent description. Dashboard: **Identity > Profile > AI Agent Description** |
| `ai_commands` <br/> array of strings | Behavioral guidelines. Dashboard: **Identity > Conversation Style > AI Guidelines** |
| `retrain_state` <br/> string or null | Current training status: `null` (up to date or never trained), `"to_be_retrained"`, `"in_progress"`, `"up_to_date"`, or `"failed"` |

:::note
These three fields (`one_word_description`, `short_description`, `ai_commands`) are shared with [Chatbot Settings](/api-reference/chatbot-settings/). Updating via either endpoint modifies the same underlying data.
:::

## Update Settings

**Scope: write_all**

`PATCH https://app.quickchat.ai/v1/api/knowledge_base/`

**Request Body**

| Parameter | Description |
|-----------|-------------|
| `one_word_description` <br/> string | AI Agent name |
| `short_description` <br/> string | System prompt / AI Agent description |
| `ai_commands` <br/> array of strings | AI Guidelines |

**Shell**

```shell
curl -X PATCH https://app.quickchat.ai/v1/api/knowledge_base/ \
  -H 'Authorization: Bearer <API_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{
  "one_word_description": "Sales Bot"
}'
```

**Python**

```python
import requests

response = requests.patch(
    url="https://app.quickchat.ai/v1/api/knowledge_base/",
    headers={"Authorization": "Bearer <API_TOKEN>"},
    json={"one_word_description": "Sales Bot"},
)
data = response.json()
```

**Response** `200 OK` — Returns the updated Knowledge Base settings (same schema as [Get Settings](/api-reference/knowledge-base/#get-settings)).

## Retrain Knowledge Base

Trigger an asynchronous retraining of the Knowledge Base.

**Scope: write_all**

`POST https://app.quickchat.ai/v1/api/knowledge_base/retrain/`

**Shell**

```shell
curl -X POST https://app.quickchat.ai/v1/api/knowledge_base/retrain/ \
  -H 'Authorization: Bearer <API_TOKEN>'
```

**Python**

```python
import requests

response = requests.post(
    url="https://app.quickchat.ai/v1/api/knowledge_base/retrain/",
    headers={"Authorization": "Bearer <API_TOKEN>"},
)
```

**Response** `202 Accepted`

:::note
Retraining is needed after publishing article changes to ensure the AI Agent uses the latest content. You can monitor progress via the `retrain_state` field in [Get Settings](/api-reference/knowledge-base/#get-settings) — it changes from `"to_be_retrained"` to `"in_progress"` to `"up_to_date"`.
:::

---
