Skip to main content
Conversations are how your agent receives and responds to user messages. Each conversation file defines a handler that runs when a message arrives on a matching channel.

Creating a conversation

Create a file in src/conversations/ that exports a Conversation:
This is the simplest possible conversation. It matches all channels and hands every message to the AI model with a system instruction. You can test your conversation using the Chat page in the dev console. This requires the webchat integration, so install it first with adk add webchat.
Chat page in dev console

Channel matching

The channel field determines which integration channels this conversation handles:
When you use "*", the handler runs for any channel, but message and event are typed as unknown. Specifying a channel gives you strict types on message payloads, event payloads, and the conversation instance:
If multiple conversation files match the same channel, the most specific match wins. A conversation with channel: "webchat.channel" takes priority over one with channel: "*" for webchat messages.

Multiple conversations

You can create separate conversation files for different channels or use cases:
Each file exports a Conversation with its own channel, handler, and configuration. The ADK discovers them all automatically.

Handler types

Your handler receives different types of requests. Check the type field to determine what you’re handling:
Most conversations only need to handle "message". The other types become relevant as you add workflows, lifecycle management, and events.

Handler parameters

Every handler type receives these common parameters: When type is "message", you also get message with the message payload. When type is "event", you get event with the event payload.

Listening to events

By default, conversations only receive messages. To listen to integration events or custom events, add the events prop:
Events use the format "integration:eventName" for integration events, or just the event name for custom events defined in agent.config.ts.

Conversation state

Each conversation can declare its own state schema, separate from the bot and user state in agent.config.ts:
Conversation state is automatically persisted between handler calls.
For more information about state scopes (conversation vs. bot vs. user), check out our guide on managing states.
Last modified on April 27, 2026