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

# Overview

> How the knowledge base powers your assistants' answers

The knowledge base is the material your assistants consult to answer your leads:
policies, price tables, manuals, frequently asked questions. Each item can be
created from a text or from an uploaded file.

## Scope: global or assistant-specific

Every knowledge item has a scope, defined by the `assistant_id` field:

| `assistant_id`      | Scope     | Who can see it                |
| ------------------- | --------- | ----------------------------- |
| absent or `null`    | Global    | Every assistant in the tenant |
| An assistant's UUID | Exclusive | Only that assistant           |

<Note>
  An exclusive item belongs to a single assistant. To share the same material
  across a few assistants — but not all of them — keep the item global and use
  [exclusions](/en/api-reference/knowledge/assignments).
</Note>

## Exclusions: narrowing down a global item

Global items accept an `excluded_assistant_ids` list. The assistants on that
list stop seeing that knowledge, even though it is global.

```
Global item "Price table"
  excluded_assistant_ids: ["support-assistant"]

  → Sales Assistant   ✅ sees it
  → Support Assistant ❌ does not see it
```

<Warning>
  Exclusions only apply to **global** items. Trying to exclude an assistant from
  an item that already has `assistant_id` filled in returns `409`.
</Warning>

## Accepted file formats

| Category    | Extensions                             |
| ----------- | -------------------------------------- |
| Text        | `.txt`, `.md`, `.mdx`, `.rst`, `.adoc` |
| Document    | `.pdf`, `.html`                        |
| Spreadsheet | `.xlsx`, `.xls`, `.csv`                |

The limit is **10 MB** per file. The content is extracted as text and indexed —
images inside the file are not interpreted.

## Usage instruction

The optional `usage_instruction` field (up to 2000 characters) tells the
assistant **when** to rely on that knowledge. It is useful when you have several
similar items:

```json theme={null}
{
  "name": "2026 price table",
  "usage_instruction": "Use only when the lead asks about prices. Never quote prices from previous years."
}
```

## Knowledge object

```json theme={null}
{
  "id": "9f1c2d34-5678-4abc-9def-0123456789ab",
  "tenant_id": "d6b10acc-2307-413f-a4de-4c2edf3f9a70",
  "name": "Return policy",
  "description": "Exchange and return rules",
  "content": "Returns within 30 days with the receipt...",
  "source_url": null,
  "usage_instruction": "Use when the lead asks about exchanges or returns.",
  "assistant_id": null,
  "excluded_assistant_ids": ["3f8a1b2c-4d5e-6f70-8192-a3b4c5d6e7f8"],
  "created_at": "2026-01-15T10:30:00Z",
  "updated_at": "2026-02-02T09:12:00Z"
}
```

| Field                    | Type           | Description                                   |
| ------------------------ | -------------- | --------------------------------------------- |
| `id`                     | UUID           | Knowledge item identifier                     |
| `tenant_id`              | UUID           | Organization that owns the item               |
| `name`                   | string         | Display name (1–255 characters)               |
| `description`            | string         | Free-form description (up to 1000 characters) |
| `content`                | string         | Indexed text                                  |
| `source_url`             | string \| null | Filled in when the item came from a URL       |
| `usage_instruction`      | string \| null | When to use this knowledge (up to 2000)       |
| `assistant_id`           | UUID \| null   | `null` = global                               |
| `excluded_assistant_ids` | array          | Assistants without access (global items only) |

## Endpoints

| Method   | Route                                              | Description                                                     |
| -------- | -------------------------------------------------- | --------------------------------------------------------------- |
| `GET`    | `/backend/knowledge`                               | [List](/en/api-reference/knowledge/list)                        |
| `GET`    | `/backend/knowledge/{id}`                          | [Retrieve](/en/api-reference/knowledge/list)                    |
| `POST`   | `/backend/knowledge`                               | [Create](/en/api-reference/knowledge/create)                    |
| `PUT`    | `/backend/knowledge/{id}`                          | [Update](/en/api-reference/knowledge/update)                    |
| `DELETE` | `/backend/knowledge/{id}`                          | [Delete](/en/api-reference/knowledge/delete)                    |
| `PUT`    | `/backend/knowledge/{id}/exclusions`               | [Set exclusions](/en/api-reference/knowledge/assignments)       |
| `POST`   | `/backend/knowledge/{id}/exclusions/{assistantId}` | [Exclude an assistant](/en/api-reference/knowledge/assignments) |
| `DELETE` | `/backend/knowledge/{id}/exclusions/{assistantId}` | [Restore an assistant](/en/api-reference/knowledge/assignments) |

<Note>
  Every endpoint operates only on the knowledge of the organization that owns the
  API key used in the request. It is not possible to read or change data from
  another organization.
</Note>
