Agent loop
The agent runs a multi-turn tool-use loop with up to 10 iterations (configurable viaAGENT_MAX_ITERATIONS). Each iteration:
- The agent receives the conversation context and available tools
- It decides whether to call a tool or finish processing
- Tool results are fed back for the next iteration
- The loop ends when the agent calls the
donetool or hits the iteration limit
Decision outcomes
The agent classifies each conversation into one of four outcomes:Available tools
The agent has access to these tools during processing:Task tools
Contact tools
Control tools
Deduplication
The agent uses adedupe_key system to prevent duplicate tasks. Each key follows the format:
backend::fix::login-timeout or design::create::new-landing-page.
Before creating a task, the agent searches for existing tasks with similar dedupe keys and descriptions using vector similarity. If a likely duplicate is found, the agent updates the existing task instead.
Conversation context
The agent receives:- The channel name and type (Slack, WhatsApp, etc.)
- Recent messages in the conversation with sender information
- The linked contact profiles for known senders
- A system prompt that defines the agent’s behavior and available tools