# Prompt to work with the knowledge base

A connected knowledge base does not replace a bot instruction. In the system prompt, you need to explain what questions to use files for and what to do if there is no exact answer.

## Connect the vault first.

1. Open **My Bots** and press **Change**.
2. On the **Basic** tab, select the storage in the **Bot Database** field.
3. Press **Save changes**.

If the storage is not already created, use the instruction [**Manage storage and files**](<../base/manage-storages-and-files.md>).

## The Four Rules for Prompt

### 1. Specify topics

List the questions for which a knowledge base is needed.

```md
Use the knowledge base for questions about the company, services,
delivery, payment, returns, and warranty.
```

### 2. Separate data sources

If some of the information comes from integration, record it separately.

```md
Get service descriptions and contraindications from the knowledge base.
Get current prices and availability only through YCLIENTS actions.
Do not use a price from a file if the action returned a different value.
```

### 3. Stop making things up.

```md
Answer only from the information you find. Do not invent prices,
dates, addresses, or rules. If there is no exact answer, say so clearly
and offer help from a team member.
```

### 4. Describe the response format

```md
Give a short answer in plain language. If a condition has several
parts, use a list. Do not mention an internal filename unless the
customer asks about it.
```

## A ready-made example

```md
## Working with the knowledge base

Use the knowledge base for questions about the company, services,
preparation for procedures, contraindications, and service rules.

For delivery questions, use the `Delivery and pickup` file.
For warranty questions, use the `Warranty and returns` file.

Get current prices, staff, and availability only through
booking-system actions.

Answer only from the information you find. If data is missing
or contradictory, do not choose an option yourself:
say that a team member must clarify it.
```

## If several files are suitable

Don't make the bot choose by guess. Specify the priority of sources or the rule of clarification.

```md
If a question concerns both delivery and returns, use both files
and split the reply into two sections. If the conditions conflict,
do not present either option as correct—hand the question over to a team member.
```

## Verification

Test:

1. a question with an exact answer in one file;
2. the same question in other words;
3. an issue requiring two files;
4. An issue that needs integration, not a framework.
5. unanswered question;
6. conflicting information.

Check in the processing log that the bot has used the right source. If it selects the wrong file, improve **File Assignment** and make the rule more specific.

!!!tip
Do not list the contents of all documents in the Prompt. Prompt explains the rules of choice, and the facts themselves should remain in the knowledge base.
!!!
