Skip to main content
ADK projects follow a consistent structure that organizes your agent’s code, configuration, and dependencies.

Directory structure

src
agent.config.ts
agent.json
package.json
tsconfig.json

Configuration files

agent.config.ts

The main agent configuration file. Defines your agent’s name, description, default models, state schemas, tags, configuration schema, and integration dependencies.

agent.json

Links the agent to a bot in your Workspace:

package.json

Standard Node.js package configuration. Includes scripts for dev, build, and deploy commands.

Source directories

src/conversations/

Conversation handlers that respond to messages from users. Each file exports a Conversation instance that handles messages for specific channels.

src/workflows/

Long-running processes that execute background tasks or handle complex multi-step operations. Each file exports a Workflow instance that defines the logic to execute when the Workflow is called.

src/actions/

Callable functions that can be invoked by workflows, conversations, or other actions.

src/tools/

Tools that the AI model can call during conversations. Tools are provided to the execute() function.

src/tables/

Table schemas that define data storage structures. Tables are automatically synced with Botpress Cloud.

src/triggers/

Event subscriptions that respond to external events or scheduled triggers.

src/knowledge/

Knowledge base sources that provide context to your agent’s AI models.

Global state and configuration

The ADK provides exports for accessing global state and configuration throughout your agent.

Bot state

Access and modify bot-level state that persists across all conversations:

User state

Access and modify user-level state that persists for each user:

Configuration

Access your agent’s configuration values (defined in agent.config.ts):
State schemas are defined in agent.config.ts under bot.state and user.state. The configuration schema is defined under configuration.schema.

Generated files

The ADK generates TypeScript types in .adk/bot/.botpress:
  • .botpress/types/ - Type definitions for integrations and interfaces
  • .botpress/dist/ - Compiled output (created during build)
Don’t edit files in the .botpress directory manually. They are automatically generated and will be overwritten.

Next steps

Conversations

Learn about conversation handlers

Workflows

Create long-running processes