# Botpress ADK
Source: https://botpress.com/docs/adk
The Botpress Agent Development Kit (ADK) is a developer-first TypeScript framework for building AI agents on the Botpress Platform.
Setup and configuration, conversations, workflows, tools, testing, the Zai LLM utilities, and the CLI reference.
# HITL with Desk
Source: https://botpress.com/docs/adk/advanced/desk-hitl
Escalate conversations to support agents in Botpress Desk.
The `desk-hitl` plugin connects your agent to Botpress Desk for human handoff. When escalated, your agent calls `startHitl` to create a Desk ticket and a support agent takes over from there.
## Add `desk-hitl` to your agent
Add the plugin to `agent.config.ts`:
```typescript theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
import { defineConfig, z } from "@botpress/runtime"
export default defineConfig({
name: "my-agent",
dependencies: {
integrations: {
webchat: "webchat@0.3.0",
},
plugins: {
"desk-hitl": {
version: "desk-hitl@latest",
},
},
},
})
```
### Customize handoff messages
Override the default messages the plugin sends when an agent joins or a session ends:
```typescript theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
plugins: {
"desk-hitl": {
version: "desk-hitl@latest",
config: {
agentAssignedMessage: "A support agent has joined the conversation.",
sessionEndedMessage: "The support session has ended. Is there anything else I can help you with?",
},
},
},
```
## Connect your bot in Botpress Desk
To enable escalations, link your bot to Botpress Desk from the Desk UI. This is a one-time step per bot. Your bot must be deployed at least once before it appears in the list.
Run `adk deploy` to deploy your bot.
Open [**Botpress Desk**](/docs/desk/introduction).
Go to **AI Agents → Deflecting Bots**.
Add your bot.
If you skip this step, `startHitl` will fail with: *"This bot is not connected to Botpress Desk. Enable it on the Deflecting Bots page in Botpress Desk, then republish."*
## Create an escalation tool
Wrap `startHitl` in an `Autonomous.Tool` so the model can decide when to escalate. Create a file called `handToSupport.ts` under `src/tools/`:
```typescript theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
import { Autonomous, context, plugins, z } from "@botpress/runtime"
export default new Autonomous.Tool({
name: "handToSupport",
description:
"Transfer the conversation to a support agent. Use when the user explicitly asks for a support agent, or when their issue is beyond the bot's capabilities.",
input: z.object({
reason: z.string().describe("Why the conversation needs a support agent"),
priority: z.enum(["low", "medium", "high", "urgent"]).default("medium"),
}),
handler: async ({ reason, priority }) => {
const conversation = context.get("conversation")
await plugins["desk-hitl"].actions.startHitl({
conversationId: conversation.id,
title: reason,
priority,
})
},
})
```
Fields passed to `startHitl`:
| Field | Type | Description |
| ---------------- | ----------------------------------------- | --------------------------------------- |
| `conversationId` | `string` | The conversation to escalate — required |
| `title` | `string` | Ticket title shown in Desk |
| `priority` | `'low' \| 'medium' \| 'high' \| 'urgent'` | Ticket priority (default: `'medium'`) |
| `userName` | `string` | Customer name shown in the Desk ticket |
| `userEmail` | `string` | Customer email shown in the Desk ticket |
## Use the tool in a conversation handler
Add the tool to `conversations/index.ts` and instruct the model when to use it:
```typescript theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
import { Conversation } from "@botpress/runtime"
import handToSupport from "../tools/handToSupport"
export default new Conversation({
channel: "*",
handler: async ({ execute }) => {
await execute({
instructions: `You are a helpful support assistant.
If the user needs help beyond your capabilities or explicitly asks for a support agent, use the handToSupport tool. After calling it, do not send any message.`,
tools: [handToSupport],
})
},
})
```
# Human-in-the-loop (HITL)
Source: https://botpress.com/docs/adk/advanced/hitl
Escalate conversations to live human agents.
This covers the HITL integration and plugin, which works with Botpress's built-in HITL dashboard and external helpdesk platforms (Zendesk, Intercom, etc.). This is separate from [Botpress Desk](/docs/adk/advanced/desk-hitl).
HITL (Human-in-the-Loop) lets your agent hand off a conversation to a live human agent. It's powered by two dependencies working together: the **HITL integration** (the transport to a helpdesk or agent platform) and the **HITL plugin** (the actions your code calls).
## Add HITL to your agent
Add both the integration and the plugin to `agent.config.ts`. The plugin's `dependencies` block points at the integration by alias:
```typescript theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
import { defineConfig } from "@botpress/runtime"
export default defineConfig({
name: "my-agent",
defaultModels: {
autonomous: "openai:gpt-4.1-mini-2025-04-14",
zai: "openai:gpt-4.1-mini-2025-04-14",
},
dependencies: {
integrations: {
chat: "chat@1.0.0",
webchat: "webchat@0.3.0",
hitl: "hitl@2.0.2",
},
plugins: {
hitl: {
version: "hitl@1.3.0",
dependencies: {
hitl: {
integrationAlias: "hitl",
integrationInterfaceAlias: "hitl",
},
},
},
},
},
})
```
`integrationAlias` must match a key in `dependencies.integrations`. The ADK validates this at build time, so a typo here fails fast. `integrationInterfaceAlias` tells the plugin which interface entity the integration implements (`hitlSession` for the generic HITL integration, `hitlTicket` for Zendesk, and so on).
The HITL plugin also accepts a top-level `config` object for plugin-wide behavior. See the HITL plugin's Hub listing for the full set of fields.
## Start a handoff
Import `plugins` from `@botpress/runtime` and call `startHitl` from a conversation handler. All inputs are typed against the plugin:
```typescript theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
import { Conversation, plugins } from "@botpress/runtime"
export default new Conversation({
channel: ["chat.channel", "webchat.channel"],
handler: async ({ execute, conversation, message }) => {
if (message.payload.text.toLowerCase() === "/starthitl") {
await plugins.hitl.actions.startHitl({
title: "Support HITL",
description: "Escalate to support agent",
conversationId: conversation.id,
userId: message.userId,
configurationOverrides: {
onHitlHandoffMessage: "Escalating to support...",
userHitlCloseCommand: "/end",
agentAssignedTimeoutSeconds: 100,
},
})
return
}
await execute({
instructions: "You are a helpful assistant. If the user asks for a human, tell them to type /starthitl.",
})
},
})
```
The fields passed to `startHitl`:
| Field | Description |
| ------------------------ | --------------------------------------------------------------------- |
| `title` | Short label shown to the human agent when the ticket opens |
| `description` | Longer context the human agent sees alongside the conversation |
| `conversationId` | The conversation to hand off (use `conversation.id` from the handler) |
| `userId` | The user initiating the handoff |
| `configurationOverrides` | Optional per-handoff overrides of the plugin config |
Common override fields:
| Field | Description |
| ----------------------------- | --------------------------------------------------------------- |
| `onHitlHandoffMessage` | Message sent to the user when the handoff begins |
| `userHitlCloseCommand` | Message text the user can send to close the session |
| `agentAssignedTimeoutSeconds` | How long to wait for a human agent to pick up before timing out |
For the full set of override fields, see the HITL plugin's Hub listing.
## Use a different provider
The HITL plugin works with any integration that implements the HITL interface. To swap the generic HITL integration for Zendesk, change the integration and update the alias. `hitlTicket` replaces `hitlSession` because Zendesk implements the interface with tickets instead of sessions:
```typescript theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
dependencies: {
integrations: {
zendesk: "zendesk@1.0.0",
},
plugins: {
hitl: {
version: "hitl@1.3.0",
dependencies: {
hitl: {
integrationAlias: "zendesk",
integrationInterfaceAlias: "hitl",
},
},
},
},
},
```
Your application code doesn't change. `plugins.hitl.actions.startHitl` works the same regardless of which integration is wired underneath.
## Deploy and test
Run `adk deploy` to push the agent to Botpress Cloud. See the [CLI reference](/docs/adk/cli-reference#adk-deploy) for all deploy flags:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk deploy
```
HITL only works against a deployed bot. `adk dev` downloads the plugin into `bp_modules/` and generates types, but handoffs need the integration's real connection to your helpdesk, which is configured on the production bot.
# Skills
Source: https://botpress.com/docs/adk/ai-native/skills
Give AI coding assistants deep ADK knowledge with installable skills.
Skills are packaged instructions and documentation that teach AI coding assistants how to build with the ADK. When installed, assistants like Claude Code, Cursor, and Codex use them automatically when you ask them to build features, debug issues, write evals, or connect integrations. `adk init` installs them for you alongside your dependencies, so most projects get them out of the box.
## Manual installation
If you need to install skills in an existing project or reinstall them, run the same command `adk init` runs:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
npx skills add botpress/skills -s '*' -a codex claude-code -y
```
Use `bunx` instead of `npx` if your project has a `bun.lockb`.
To install a single skill instead of all of them:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
npx skills add botpress/skills --skill adk
```
Or install as a Claude Code plugin:
```
/plugin marketplace add botpress/skills
/plugin install adk@botpress-skills
```
## Available skills
| Skill | What it teaches | Use when |
| ---------------------- | ------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- |
| **`adk`** | Core ADK framework: actions, tools, workflows, conversations, tables, knowledge, triggers, Zai, configuration | Building any feature with the ADK |
| **`adk-debugger`** | Trace reading, log analysis, common failure diagnosis, the debug loop | Bot isn't responding, tools failing, workflows stuck, LLM issues |
| **`adk-evals`** | Eval file format, all assertion types, CLI usage, per-primitive testing patterns | Writing and running automated tests |
| **`adk-frontend`** | Authentication, type generation, client setup, calling bot actions from React/Next.js | Building a frontend that connects to your bot |
| **`adk-integrations`** | Discovery, adding, configuring, and using integrations end-to-end | Connecting Slack, WhatsApp, Linear, or any integration |
| **`adk-docs`** | Documentation standards, creation, review, and maintenance | Writing or updating docs for your bot |
## Slash commands
Skills come with slash commands for Claude Code. Type the command instead of describing what you need:
| Command | What it does |
| ------------------ | ------------------------------------------------------- |
| `/adk-init` | Scaffold a new ADK project |
| `/adk-debug` | Debug bot issues using traces, logs, and the debug loop |
| `/adk-eval` | Write, run, or debug evals |
| `/adk-frontend` | Build frontend apps that integrate with ADK bots |
| `/adk-integration` | Discover, add, and configure integrations |
| `/adk-doc-create` | Create documentation for a feature |
| `/adk-doc-review` | Review project docs for accuracy |
| `/adk-doc-update` | Update docs after code changes |
| `/adk-doc-sync` | Check if docs are in sync with code |
| `/adk-doc-search` | Search project documentation |
## MCP server
Skills are the recommended way to give AI assistants ADK knowledge. The ADK also ships an MCP (Model Context Protocol) server that gives assistants live access to your running project, kept here for reference.
Generate the MCP configuration files:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk mcp:init --all
```
This writes config for Claude Code (`.mcp.json`), VS Code (`.vscode/mcp.json`), and Cursor (`.cursor/mcp.json`). See [`adk mcp:init`](/docs/adk/cli-reference#adk-mcpinit) for all flags.
The server exposes these tools:
| Tool | What it does |
| ------------------------- | ------------------------------------------------------------------ |
| `adk_get_agent_info` | Get project structure and primitives |
| `adk_search_integrations` | Search the Botpress Hub |
| `adk_get_integration` | Get detailed integration info |
| `adk_add_integration` | Add an integration to the project |
| `adk_send_message` | Send a test message to the running bot |
| `adk_query_traces` | Query trace spans for debugging |
| `adk_get_dev_logs` | Get dev server logs and errors |
| `adk_list_workflows` | List available workflows |
| `adk_start_workflow` | Start a workflow or get its input schema |
| `adk_init_project` | Scaffold a new ADK project (only available outside an ADK project) |
# CLI reference
Source: https://botpress.com/docs/adk/cli-reference
All commands and flags available with the ADK CLI.
The `adk` CLI is how you scaffold, run, deploy, and debug ADK agents. Run `adk --help` for the top-level command list, or `adk --help` for flags on a specific command.
## Global flags
These flags work with every command:
| Flag | Description |
| --------------------- | ----------------------------------------------------------------------------------------------------- |
| `--help`, `-h` | Show help information |
| `--version`, `-V` | Show version number |
| `--no-cache` | Disable caching for integration lookups |
| `--profile ` | Credentials profile to use (overrides the `ADK_PROFILE` environment variable and the current profile) |
Most commands also accept `--format json` for machine-readable output. The following commands don't: `dev`, `login`, `profiles list`, `profiles set`, `upgrade`, `remove`, `self-upgrade`, `telemetry`, `theme`, `mcp`, `mcp:init`, `run`, `assets pull`.
## Project
These commands manage an agent project from scaffold to deploy:
| Command | Description |
| ----------------- | --------------------------------------------------------- |
| `adk init [name]` | Initialize a new project |
| `adk dev` | Start development mode with hot reloading |
| `adk build` | Build the agent for production |
| `adk deploy` | Deploy the agent to Botpress Cloud |
| `adk check` | Validate project structure and config (no login required) |
| `adk status` | Show project status, integrations, and server state |
| `adk link` | Link local agent to a workspace and bot |
### `adk init`
Scaffold a new agent project. Pass a name, or omit it to be prompted:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk init my-agent
adk init my-agent --template hello-world
adk init --list-templates
```
| Flag | Description |
| --------------------------- | ---------------------------------- |
| `-t, --template ` | Template to use (default: `blank`) |
| `-y, --yes`, `--defaults` | Skip prompts, use defaults |
| `--skip-link` | Skip the linking step |
| `--list-templates` | List available templates and exit |
### `adk dev`
Start the dev server with hot reload:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk dev
adk dev --port 3000 --port-console 3001
```
| Flag | Description | Default |
| ----------------------- | ------------------------------------------------------ | ------- |
| `-p, --port ` | Bot server port | `3000` |
| `--port-console ` | Dev console port | `3001` |
| `--otlp` | Enable OTLP export to external collector (port `4318`) | |
| `--port-otlp ` | Override the OTLP collector endpoint port | |
| `-v, --verbose` | Show additional details | |
| `--non-interactive` | Emit structured NDJSON events to stdout | |
### `adk deploy`
Deploy the built agent to Botpress Cloud:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk deploy
adk deploy -y
```
| Flag | Description | Default |
| ------------------------- | ------------------------------ | ------------ |
| `-e, --env ` | Deployment environment | `production` |
| `-y, --yes` | Auto-approve preflight changes | |
### `adk link`
Link the local agent to a workspace and bot. Writes to `agent.json`, or to `agent.local.json` with `--local`:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk link
adk link --workspace wkspace_123 --bot bot_456
```
| Flag | Description |
| ------------------ | ---------------------------------------------------------------- |
| `--workspace ` | Workspace ID |
| `--bot ` | Bot ID to link to |
| `--dev ` | Dev bot ID |
| `--api-url ` | Botpress API URL |
| `-f, --force` | Overwrite existing `agent.json` |
| `--local` | Write to gitignored `agent.local.json` (for multi-dev workflows) |
## Integrations
These commands add, inspect, and manage the integrations your agent depends on:
| Command | Description |
| --------------------------- | --------------------------------------------------------- |
| `adk add ` | Add an integration or interface (aliases: `i`, `install`) |
| `adk remove [resource]` | Remove an integration, interface, or plugin (alias: `rm`) |
| `adk upgrade [integration]` | Upgrade integration(s) to latest version (alias: `up`) |
| `adk search ` | Search the Botpress Hub |
| `adk list` | List installed integrations |
| `adk info ` | Show detailed integration info |
### `adk add`
Add an integration or interface to your agent. Accepts a name, `workspace/name`, or a specific version:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk add webchat
adk add slack@latest
adk add slack@0.5.0
adk add my-workspace/custom@1.0.0
adk add interface:translator@1.0.0
adk add webchat --alias custom-webchat
```
| Flag | Description |
| ----------------- | ----------------------------- |
| `--alias ` | Custom alias for the resource |
### `adk search`
Search the Botpress Hub for integrations:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk search crm
adk search slack --limit 5
```
| Flag | Description | Default |
| ------------------ | --------------------- | ------- |
| `--limit ` | Max results to return | `20` |
### `adk list`
List integrations in your project, or all available ones on the Hub:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk list
adk list --available
```
| Flag | Description | Default |
| ------------- | ---------------------------------------------------- | ------- |
| `--available` | List all available integrations (not just installed) | |
| `--limit ` | Max results | `50` |
### `adk info`
Show details for a specific integration. Filter by a single facet or show the full spec:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk info slack
adk info slack --actions
adk info slack --full
```
| Flag | Description |
| ------------ | ------------------ |
| `--actions` | Show only actions |
| `--channels` | Show only channels |
| `--events` | Show only events |
| `--full` | Show all details |
## Configuration and secrets
These commands manage config values and secrets:
| Command | Description |
| ------------------------------ | ----------------------------------------------------- |
| `adk config` | Validate and fill missing config values interactively |
| `adk config:get ` | Get a configuration value |
| `adk config:set ` | Set a configuration value |
| `adk secret` | Show declared secrets and their status |
| `adk secret:set ` | Set a secret value |
| `adk secret:delete ` | Delete a secret |
| `adk models` | List available LLM models |
All configuration and secret commands accept `--prod` to target the production environment instead of dev.
## Chat and testing
These commands let you send messages to your agent and run eval suites:
| Command | Description |
| ------------------------ | -------------------------------- |
| `adk chat` | Interactive chat with your agent |
| `adk evals [name]` | Run eval suites |
| `adk evals runs [runId]` | List or show eval run history |
### `adk chat`
Open an interactive chat, or send a single message with `--single`. Requires `adk dev` to be running:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk chat
adk chat --single "What's the status of order 12345?"
adk chat --single "Follow up" --conversation-id
```
| Flag | Description | Default |
| ------------------------ | ------------------------- | ------- |
| `--single ` | Send one message and exit | |
| `--conversation-id ` | Continue a conversation | |
| `--timeout ` | Max wait duration | `60s` |
### `adk evals`
Run eval suites. With no arguments, runs all evals; pass a name to run just one:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk evals
adk evals greeting
adk evals --tag smoke
adk evals --type regression
adk evals -v
```
| Flag | Description | Default |
| ----------------------- | ------------------------------------------- | ----------------------- |
| `--tag ` | Run only evals with this tag | |
| `--type ` | Run only `capability` or `regression` evals | |
| `--judge-model ` | Model for `llm_judge` assertions | |
| `-v, --verbose` | Show full details for all evals | |
| `--server ` | Dev server URL | `http://localhost:3001` |
### `adk evals runs`
List past eval runs, or show the details of a specific one:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk evals runs
adk evals runs --latest
adk evals runs -v
```
| Flag | Description | Default |
| --------------- | ------------------- | ------- |
| `--latest` | Show the latest run | |
| `--limit ` | Max runs to list | `10` |
| `-v, --verbose` | Show full details | |
## Workflows
These commands discover and run workflows against the local dev server:
| Command | Description |
| ------------------------------------ | -------------------------------------- |
| `adk workflows` | List all discovered workflows |
| `adk workflows inspect ` | Inspect a workflow schema and metadata |
| `adk workflows run [payload]` | Run a workflow |
### `adk workflows run`
Run a workflow with a JSON payload. Add `--wait` to block until it finishes:
```bash theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
adk workflows run onboarding '{"userId":"123"}'
adk workflows run onboarding '{"userId":"123"}' --wait --timeout 30s
```
| Flag | Description |
| ---------------------- | ------------------------------------ |
| `--wait` | Wait for the workflow to finish |
| `--timeout ` | Max wait duration (implies `--wait`) |
## Debugging
These commands help you inspect what your agent is doing:
| Command | Description |
| ---------------------------- | -------------------------------------------- |
| `adk logs [tokens...]` | Query dev server logs |
| `adk traces [tokens...]` | Query trace data |
| `adk run