Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
b7fcda1
docs(adk): create State and Configuration concept pages (ADK-304, ADK…
jacksonyzj Apr 6, 2026
2caa13c
docs(adk): fix default models to match adk init output
jacksonyzj Apr 6, 2026
ae3222a
docs(adk): add real CLI output, clarify adk config vs integration config
jacksonyzj Apr 6, 2026
89ebacc
docs(adk): add env variables section, evals config option (ADK-303)
jacksonyzj Apr 6, 2026
ae07f2a
docs(adk): minor wording fixes in state and configuration pages
jacksonyzj Apr 6, 2026
f076eb2
docs(adk): improve env variables section with practical API key example
jacksonyzj Apr 6, 2026
279df58
docs(adk): add state references section (ADK-304)
jacksonyzj Apr 6, 2026
448ce44
docs(adk): fix state context wording, Reference.Workflow example, con…
jacksonyzj Apr 6, 2026
04e5c87
docs(adk): apply review fixes — description wording, current-user, co…
jacksonyzj Apr 7, 2026
57cc715
docs(adk): update integration config to string shorthand, settings in…
jacksonyzj Apr 7, 2026
be41fb7
docs(adk): remove redundant 'optional' from evals description
jacksonyzj Apr 7, 2026
c16c816
docs(adk): move config:get defaults note to Note block
jacksonyzj Apr 7, 2026
6094fd8
docs(adk): remove environment variables section
jacksonyzj Apr 7, 2026
f7164f9
docs(adk): simplify state intro and user state wording
jacksonyzj Apr 7, 2026
54140fb
docs(adk): fix highlights, simplify state tracking note
jacksonyzj Apr 7, 2026
a978f11
docs(adk): remove highlights from state examples
jacksonyzj Apr 7, 2026
0a0ebcc
docs(adk): reduce Managing Integrations mentions to one
jacksonyzj Apr 7, 2026
6ca5431
docs(adk): fix all highlight line numbers in state examples
jacksonyzj Apr 7, 2026
620a360
docs(adk): system tags code example, simplify state references, fix h…
jacksonyzj Apr 7, 2026
32ba3cf
docs(adk): add lead-in text before tags example
jacksonyzj Apr 7, 2026
c7fbcb8
docs(adk): remove unshipped conversation instance state, add .describ…
jacksonyzj Apr 7, 2026
5594929
docs(adk): fix conversation state highlight off by one
jacksonyzj Apr 7, 2026
9e2e922
docs(adk): remove highlight from tags example
jacksonyzj Apr 7, 2026
b1cdb0c
docs(adk): fix state references highlight lines
jacksonyzj Apr 7, 2026
19e9f0a
docs(adk): reduce Note blocks in managing configuration section
jacksonyzj Apr 7, 2026
e4d5111
docs(adk): rename Interactive configuration to Validate configuration
jacksonyzj Apr 7, 2026
890b19c
docs(adk): add Managing Integrations link to config note
jacksonyzj Apr 7, 2026
be79b7f
docs(adk): remove unnecessary highlight from custom events example
jacksonyzj Apr 7, 2026
b4798d3
Merge branch 'master' into feat/adk-new-concept-pages
adkah Apr 7, 2026
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
250 changes: 250 additions & 0 deletions adk/concepts/configuration.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,250 @@
---
title: Configuration
---

Configuration defines your agent's identity, models, state schemas, dependencies, and runtime settings. Everything is centralized in `agent.config.ts`.

## `agent.config.ts`

The main configuration file uses `defineConfig` from `@botpress/runtime`:

```typescript
import { z, defineConfig } from "@botpress/runtime";

export default defineConfig({
name: "my-agent",
description: "An AI agent built with the Botpress ADK",

defaultModels: {
autonomous: "cerebras:gpt-oss-120b",
zai: "cerebras:gpt-oss-120b",
},

bot: {
state: z.object({}),
tags: {},
},

user: {
state: z.object({}),
tags: {},
},

conversation: {
tags: {},
},

message: {
tags: {},
},

workflow: {
tags: {},
},

configuration: {
schema: z.object({
apiKey: z.string(),
maxRetries: z.number().default(3),
Comment on lines +47 to +48
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

suggestion: If this snippet is meant to show only the structure of the config file, we should avoid showing specific schemas.

}),
},

dependencies: {
integrations: {
chat: "chat@0.7.7",
webchat: "webchat@0.3.0",
},
},
});
```

## Config options

<Expandable title="defineConfig options">
<ResponseField name="name" type="string">
Agent name. Used to identify your agent in the Botpress dashboard.
</ResponseField>
<ResponseField name="description" type="string">
Optional description of your agent.
</ResponseField>
<ResponseField name="defaultModels" type="object">
Default LLM models for your agent.
<Expandable title="properties">
<ResponseField name="autonomous" type="string">
Model used for `execute()` calls in conversations and workflows.
</ResponseField>
<ResponseField name="zai" type="string">
Model used for Zai operations (`zai.extract()`, `zai.check()`, etc.).
</ResponseField>
</Expandable>
</ResponseField>
<ResponseField name="bot" type="object">
Bot-level state schema and tags. See [State](/adk/concepts/state).
</ResponseField>
<ResponseField name="user" type="object">
User-level state schema and tags. See [State](/adk/concepts/state).
</ResponseField>
<ResponseField name="conversation" type="object">
Conversation-level tags.
</ResponseField>
<ResponseField name="message" type="object">
Message-level tags.
</ResponseField>
<ResponseField name="workflow" type="object">
Workflow-level tags.
</ResponseField>
<ResponseField name="configuration" type="object">
Runtime configuration schema. Values are set via `adk config` and accessed at runtime via the `configuration` import.
<Expandable title="properties">
<ResponseField name="schema" type="z.ZodObject" required>
A Zod object schema defining the configuration fields. Must be `z.object()`.
</ResponseField>
</Expandable>
</ResponseField>
<ResponseField name="dependencies" type="object">
Integration and interface dependencies. See [Managing Integrations](/adk/managing-integrations).
</ResponseField>
<ResponseField name="events" type="object">
Custom event definitions. Each key is an event name, with an optional schema and description.
</ResponseField>
<ResponseField name="evals" type="object">
Evaluation settings.
<Expandable title="properties">
<ResponseField name="idleTimeout" type="number">
Timeout in seconds for idle eval conversations.
</ResponseField>
<ResponseField name="judgePassThreshold" type="number">
Pass threshold for LLM judge assertions (1-5).
</ResponseField>
<ResponseField name="judgeModel" type="string">
Model to use for LLM judge assertions (e.g., `"openai:gpt-4o"`).
</ResponseField>
</Expandable>
</ResponseField>
</Expandable>

## Accessing configuration at runtime

Import `configuration` from `@botpress/runtime` to access your agent's configuration values:

```typescript
import { configuration } from "@botpress/runtime";

const apiKey = configuration.apiKey;
const maxRetries = configuration.maxRetries;
```

Configuration values are defined by the `configuration.schema` in `agent.config.ts` and set via the `adk config` command or the Botpress dashboard.

<Note>
Configuration is read-only at runtime. Attempting to set a value will throw an error.
</Note>

## Managing configuration

### Validate configuration

Run `adk config` to validate all configuration values and set any that are missing:

```bash
adk config
```

```txt
📝 Configuration (development)

✓ Configuration validated successfully
```

This validates your values against the schema and prompts for any missing or invalid fields. Requires a `configuration.schema` in your `agent.config.ts`.

### Get and set values

Set and retrieve individual configuration values. Note that `config:get` reads persisted values only and does not resolve schema defaults:

```bash
adk config:set supportEmail "help@mycompany.com"
```

```txt
✓ Configuration updated (development)
supportEmail = help@mycompany.com
```

```bash
adk config:get supportEmail
```

```txt
📝 Configuration value (development)

Key: supportEmail
Value: help@mycompany.com
```

### Production configuration

Use the `--prod` flag to manage production configuration separately from development:

```bash
adk config --prod
adk config:set supportEmail "help@mycompany.com" --prod
adk config:get supportEmail --prod
```

<Note>
Agent configuration (`adk config`) is separate from integration configuration. Integration settings like API keys are managed in the Control Panel during `adk dev`. See [Managing Integrations](/adk/managing-integrations) for details.
</Note>

## Default models

The `defaultModels` field sets which LLM models your agent uses:

```typescript
defaultModels: {
autonomous: "cerebras:gpt-oss-120b",
zai: "cerebras:gpt-oss-120b",
},
```

- **`autonomous`**: used by `execute()` in conversations and workflows
- **`zai`**: used by Zai operations like `zai.extract()`, `zai.check()`, `zai.text()`

You can override the model per-call using the `model` prop on `execute()`.

## Custom events

Define custom events that your agent can emit and listen to:

```typescript
export default defineConfig({
name: "my-agent",
events: {
orderPlaced: {
description: "Fired when an order is placed",
schema: z.object({
orderId: z.string(),
total: z.number(),
}),
},
},
});
```

Custom events can be subscribed to in [Triggers](/adk/concepts/triggers) and [Conversations](/adk/concepts/conversations) (via the `events` prop).

## Dependencies

The `dependencies` field declares which integrations your agent uses:

```typescript
dependencies: {
integrations: {
chat: "chat@0.7.7",
webchat: "webchat@0.3.0",
slack: "slack@1.0.0",
},
},
```

Integration settings (API keys, tokens, etc.) are configured in the Control Panel during `adk dev`, not in `agent.config.ts`.
Loading
Loading