Skip to content

docs(adk): create State and Configuration concept pages#449

Open
jacksonyzj wants to merge 8 commits intomasterfrom
feat/adk-new-concept-pages
Open

docs(adk): create State and Configuration concept pages#449
jacksonyzj wants to merge 8 commits intomasterfrom
feat/adk-new-concept-pages

Conversation

@jacksonyzj
Copy link
Copy Markdown

@jacksonyzj jacksonyzj commented Apr 6, 2026

Summary

Two new concept pages for State and Configuration, filling gaps in the ADK documentation.

Tickets

# Ticket Page
1 ADK-304 State
2 ADK-303 Configuration

State page covers

  • Three state scopes: bot (global), user (per-user), conversation (per-conversation)
  • Defining schemas in agent.config.ts and Conversation definitions
  • Reading/writing state in handlers (clarified: only inside runtime context)
  • Tags definition and read/write for bot, user, conversation
  • State references with Reference.Workflow()
  • bot.id and user.id identity accessors

Configuration page covers

  • Full defineConfig reference with all options (including evals)
  • configuration runtime import (read-only proxy)
  • adk config / config:get / config:set with --prod flag (with real CLI output)
  • Environment variables (process.env in agent.config.ts)
  • Note: no dedicated secrets API; integration secrets via dashboard
  • Note: adk config is separate from integration configuration
  • Note: config:get reads persisted values only, not schema defaults
  • Default models, custom events, dependencies

Test plan

  • Preview via Mintlify staging deployment
  • Live tested adk config, config:set, config:get on real bot
  • Verified all internal links resolve

@mintlify
Copy link
Copy Markdown

mintlify bot commented Apr 6, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
botpress 🟢 Ready View Preview Apr 6, 2026, 2:49 PM

@jacksonyzj jacksonyzj marked this pull request as ready for review April 6, 2026 15:52
@jacksonyzj jacksonyzj requested review from a team and aj-botpress April 6, 2026 15:52

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

Choose a reason for hiding this comment

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

Suggested change
description: "An AI agent built with Botpress ADK",
description: "An AI agent built with the Botpress ADK",

Comment on lines +47 to +48
apiKey: z.string(),
maxRetries: z.number().default(3),
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.

Comment on lines +54 to +55
chat: { version: "chat@0.7.7", enabled: true },
webchat: { version: "webchat@0.3.0", enabled: true },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same as above.

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

export default defineConfig({
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We're missing the evals section

Custom event definitions. Each key is an event name, with an optional schema and description.
</ResponseField>
<ResponseField name="evals" type="object">
Optional evaluation settings.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Most settings are optional, so unless we start mentioning it across the board, I don't think we need it here.

```

<Note>
There is no dedicated secrets API in the ADK. For integration-specific credentials (like OAuth tokens), configure them in `agent.config.ts` under `dependencies` or via the Botpress dashboard. See [Managing Integrations](/adk/managing-integrations) for details.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Same comment as before.

Comment on lines +274 to +276
chat: { version: "chat@0.7.7", enabled: true },
webchat: { version: "webchat@0.3.0", enabled: true },
slack: { version: "slack@1.0.0", enabled: true },
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This is also outdated according to the latest beta release.


### User state

Import `user` from `@botpress/runtime` to access per-user state inside any handler, action, tool, or workflow:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Import `user` from `@botpress/runtime` to access per-user state inside any handler, action, tool, or workflow:
Import `user` from `@botpress/runtime` to access current-user state inside any handler, action, tool, or workflow:

user.tags.role = "admin";
```

Conversation tags are accessed via the `conversation` instance in handlers:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Conversation tags are accessed via the `conversation` instance in handlers:
Conversation tags are accessed via a `conversation` instance:

since you can also do Conversation.get(<id>)


### Conversation state

Conversation state is accessed via the `state` parameter in the handler:
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
Conversation state is accessed via the `state` parameter in the handler:
Conversation state is accessed via the `state` parameter in the handler or on a Conversation instance:

title: State
---

State lets your agent persist data across conversations, users, and the entire bot. The ADK provides three state scopes, each with different lifetimes and access patterns.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
State lets your agent persist data across conversations, users, and the entire bot. The ADK provides three state scopes, each with different lifetimes and access patterns.
State lets your agent store and reuse data across conversations, users, and the entire bot. The ADK provides three types of states, depending on how long you need the data and who should have access to it.

Suggesting a less technical heavy sentence but can reword to fit what you mean

| Scope | Lifetime | Access | Defined in |
|-------|----------|--------|------------|
| Bot | Global, shared across all users and conversations | `bot.state` | `agent.config.ts` |
| User | Per-user, persists across all of a user's conversations | `user.state` | `agent.config.ts` |
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
| User | Per-user, persists across all of a user's conversations | `user.state` | `agent.config.ts` |
| User | Per-user, available across all of a user's conversations | `user.state` | `agent.config.ts` |


Define bot and user state schemas in `agent.config.ts`:

```typescript highlight={8-11, 14-18}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not completely sure what you're highlighting, I think this is off


Conversation state is accessed via the `state` parameter in the handler:

```typescript
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

can use a highlight here to show what you mean

```

<Note>
State changes are automatically tracked and persisted. You don't need to call a save method: just mutate the state object directly.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
State changes are automatically tracked and persisted. You don't need to call a save method: just mutate the state object directly.
State changes are handled automatically. You don't need to call a save method, just update the state object directly.


Define tag schemas in `agent.config.ts`:

```typescript highlight={5-11}
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

highlight looks off

```

<Note>
System tags (set by integrations, containing `:` in the key) are read-only. You can read them but any writes are silently ignored.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think an example code would help here instead of using a note


## State references

You can store references to workflow instances in state. They are automatically serialized when saved and loaded back as full instances when read:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Suggested change
You can store references to workflow instances in state. They are automatically serialized when saved and loaded back as full instances when read:
You can store workflow instances in state. They are saved automatically and loaded back as full instances when read:

Unless serialized is an important term, this just needs to be reworded


You can store references to workflow instances in state. They are automatically serialized when saved and loaded back as full instances when read:

```typescript
Copy link
Copy Markdown
Collaborator

@chloequijano-botpress chloequijano-botpress Apr 6, 2026

Choose a reason for hiding this comment

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

instead of commenting in the code, can highlight whats relevant

},
```

See [Managing Integrations](/adk/managing-integrations) for details on adding, removing, and configuring integrations.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the managing integration page is mentioned like 3 times in this guide. Could limit it to one and maybe cut how often we mention it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants