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

# Instruction files

> Documents a bot always reads, with a history that is never deleted.

**Instruction files** are named documents a bot reads right after its [instructions](https://docs.usecadence.gg/bots/instructions.md), on every run. Use them for the facts the bot must always know:

* A rulebook or policy
* A price list
* Opening hours and delivery areas
* Answers to common questions

## Add a file

1. Open the bot's settings and find **Files**, under **Instructions**.
2. Click **Add file**, type a **File name** and click **Add**.
3. Click the file to open it, then paste or type its content. It saves when you click away.

The bot reads the files in the order shown. Use **Move up** and **Move down** to change the order. Empty files are skipped.

## Limits

| Limit | Value |
| - | - |
| Files per bot | 30 |
| File name | 80 characters, unique per bot (ignoring case) |
| One file | 100,000 characters |
| All files together | 300,000 characters |

Anyone who can edit the bot can edit its files.

## History and restore

Click **File history** on a file to see its recent versions, each marked as an edit, a rename or a restore, with its date. Click **Restore** to bring a version back. The 20 most recent versions of each file are listed there.

## The forever archive

Nothing in an instruction file is ever lost. Every edit, rename, restore and delete keeps the version it replaced in a permanent archive. A deleted file stays in the archive with all of its content.

You do not browse the archive yourself. You ask the bot.

### Ask the bot what changed

The bot has a read-only tool, `instruction_file_history`, that reads the archive. Ask questions like:

* "When did the express delivery fee change?"
* "What did the returns policy say on 1 October?"
* "Show me what was in the price list before it was deleted."

| Parameter | What it does |
| - | - |
| `file` | Only this file. Its current name or an earlier one both work. |
| `at` | A date or time, like `2026-10-01`. Returns each file as it read then. |
| `limit` | How many changes to list, 1 to 100. Default 20. |

Without `at`, the tool lists changes newest first, with the lines taken out and the lines put in. With `at`, it returns the full text of each file as it was on that date.

> [!NOTE]
>
> Bots read instruction files but do not edit them. Only people change them, from bot settings or the [API](https://docs.usecadence.gg/api/reference/instruction-files.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.