Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 111 additions & 2 deletions src/content/docs/kai/settings.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
---
title: Kai Settings
slug: 'kai/settings'
description: Configure Kai's tool permissions, system instructions, context files (knowledge files), and skill files — in the UI or programmatically via the Storage Files API.
---



Kai's settings let you personalize how Kai behaves in your project. Open the Kai chat panel and click the **Settings** icon (gear) to access them. Settings are **per-user and per-project**, so each team member can configure their own preferences independently.

The settings panel has two tabs: **Tool Permissions** and **System Instructions**.
The settings panel has two tabs: **Tool Permissions** and **System Instructions**. Project-wide customization — project-level instructions, [context files](#context-files), and [skill files](#skill-files) — is managed in **Settings → Kai Agent** in the main Keboola navigation (the tab is labeled **Kai Assistant** in projects not yet upgraded to the new Kai engine).

## Tool Permissions

Expand Down Expand Up @@ -49,7 +50,7 @@ System Instructions let you provide Kai with persistent context and guidelines s

Project-level instructions apply to **all users** in the project. They are managed in the project settings:

1. Go to **Settings → Kai Assistant** in the main Keboola navigation.
1. Go to **Settings → Kai Agent** in the main Keboola navigation.
2. Enter your instructions in the **System instructions** text field.
3. The instructions auto-save.

Expand Down Expand Up @@ -93,3 +94,111 @@ This means user-level instructions can refine or add to the project-level instru
- Update instructions as your project evolves and conventions change.
- Focus on rules Kai can't infer from your project data alone (e.g., business logic, team preferences).
- If Kai doesn't seem to follow an instruction, try rephrasing it more directly.
- For knowledge that outgrows the 4,000-character limit — data standards documents, business glossaries — use [context files](#context-files) instead.

## Context Files

Context files (also called knowledge files) are Markdown documents that Kai reads automatically at the start of every conversation. Use them to give Kai project knowledge that is too long for system instructions: data standards, naming conventions, business glossaries, or documentation of your data model.

To manage them, go to **Settings → Kai Agent** in the main Keboola navigation and use the **Context files** card:

1. Click **Upload** and select a Markdown (`.md`) file.
2. The file is uploaded and takes effect in every **new** conversation (running conversations are not affected).
3. To replace a file, upload the new version and delete the old one.

Rules and limits:

- **Format:** Markdown (`.md`) only.
- **Size:** up to **50 KB** per file.
- **Count:** up to **10 files** per project.
- A file named `CLAUDE.md` becomes Kai's top-level memory file; all other files are loaded as always-on rules alongside it.
- Context files apply **project-wide** — every user's conversations include them.

:::tip
Every context file is read in every conversation, so keep the set small and focused. One well-structured standards document usually works better than many overlapping files.
:::

Under the hood, context files are ordinary [Storage Files](/storage/files/) tagged **`kai-context`**, which means you can also manage them programmatically — see [Managing Files via API or CLI](#managing-files-via-api-or-cli).

## Skill Files

Skills are reusable, on-demand playbooks that appear in the chat's **`/` slash-command menu** alongside Kai's built-in skills. Unlike context files, Kai loads a skill only when it is invoked — making skills the right place for longer, task-specific instructions (e.g., "build the monthly report," "onboard a new data source") that shouldn't consume context in every chat.

Manage them in **Settings → Kai Agent** using the **Skill files** card. Two formats are accepted:

1. **A single `.md` file** starting with YAML frontmatter. The `name` and `description` fields are required — the description tells Kai when to invoke the skill:

```markdown
---
name: monthly-reporting
description: Build the monthly revenue report. Use when the user asks for the monthly report or KPI refresh.
---

# Monthly reporting

Step-by-step instructions for Kai...
```

2. **A `.skill` archive** — a ZIP file with a `SKILL.md` at its root (or at the root of a single top-level directory), plus any supporting files the skill references.

Rules and limits:

- **Size:** up to **50 KB** per file.
- **Count:** up to **10 skill files** per project.
- A project skill with the same `name` as a built-in skill replaces the built-in one.

Skill files are Storage Files tagged **`kai-skill`**.

## Managing Files via API or CLI

Because context and skill files are ordinary Storage Files identified by a tag (`kai-context` or `kai-skill`), any Storage API client can manage them. Upload with the tag and the **permanent** flag (so the file never expires):

List current files by tag:

```
GET https://connection.{stack}/v2/storage/files?tags[]=kai-context
X-StorageApi-Token: {token}
```

Upload a new file (Storage import service, multipart form — see the `?service=import` section of your stack's [API reference](https://keboola.docs.apiary.io/)):

```
POST https://import.{stack}/upload-file
X-StorageApi-Token: {token}
Form fields: data=@data-standards.md, tags[]=kai-context, isPermanent=1
```

Delete a file by ID:

```
DELETE https://connection.{stack}/v2/storage/files/{fileId}
X-StorageApi-Token: {token}
```

Or use [kbagent, the Keboola CLI](/cli/):

```bash
kbagent storage files --project myproj --tag kai-context
kbagent storage file-upload --project myproj --file data-standards.md --tag kai-context --permanent
kbagent storage file-delete --project myproj --file-id 12345 --yes
```

### Keeping a Context File in Sync Automatically

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this deserves an accompanying skill

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We actually built exactly that (a bundled kai-customization skill in kai-agent, keboola/ui#7690) and then deliberately dropped it: a second copy of this how-to living in a repo the docs team never touches would drift — this page is now the single source of truth, and Kai reaches it via docs_query (its prompt routes all capability/customization questions there). If a skill still feels valuable, the drift-safe shape would be a downloadable example skill file linked from this section (a user uploads it to their own project) rather than a bundled one — deferring that call to @davidesner as a follow-up so it doesn't hold this page.


Generated by Claude Code


A common pattern: your team maintains a standards document in its own repository or wiki, and a scheduled job keeps Kai's copy current. Kai then answers standards questions from the actual document, and it stays up to date without manual re-uploads.

On each run, the sync job should:

1. **List** files tagged `kai-context` and note the ID(s) of the current copy (match by file name).
2. **Upload** the fresh version with the `kai-context` tag and the permanent flag.
3. **Delete** the old file ID(s) from step 1.

Upload-then-delete (rather than delete-then-upload) ensures a conversation starting mid-sync still finds a copy. Deleting the old copy is required: Kai loads at most 10 tagged files, and both revisions would otherwise be loaded together.

The job can run anywhere — a CI pipeline triggered on changes to the source document, or a scheduled Keboola flow with a Python step calling the Storage API. It only needs a Storage API token with file write permissions. The same pattern works for skill files using the `kai-skill` tag.

### Troubleshooting

- **File uploaded but Kai doesn't see it** — check that the tag is exactly `kai-context` or `kai-skill`, the file is under 50 KB, there are at most 10 tagged files, and the conversation was started *after* the upload.
- **Skill shows without a description, under a wrong name, or Kai doesn't invoke it** — add `name` and `description` to the `.md` frontmatter. Uploads from the Settings UI enforce the frontmatter, but API uploads don't — a file without it still appears in the `/` menu under a name derived from its file name, with no description to tell Kai when to use it. A `.skill` archive must contain `SKILL.md` at its root (or at the root of a single top-level directory).
- **File expired or disappeared** — it was uploaded without the permanent flag; re-upload it as permanent (uploads from the Settings UI are always permanent).
Loading