Skip to main content
The LLM agent is the brain of OpenBunny. It analyzes conversation context and uses tools to create tasks, update existing ones, manage contacts, and detect duplicates.

Agent loop

The agent runs a multi-turn tool-use loop with up to 10 iterations (configurable via AGENT_MAX_ITERATIONS). Each iteration:
  1. The agent receives the conversation context and available tools
  2. It decides whether to call a tool or finish processing
  3. Tool results are fed back for the next iteration
  4. The loop ends when the agent calls the done tool 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 a dedupe_key system to prevent duplicate tasks. Each key follows the format:
For example: 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