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:
DecisionDescription
CREATENew task created from the conversation
UPDATEExisting task updated with new information
ACK_REQUESTERAcknowledged the requester without creating a task
IGNOREConversation doesn’t contain an actionable task

Available tools

The agent has access to these tools during processing:

Task tools

ToolDescription
search_tasksHybrid search across existing tasks (BM25 + semantic + LLM reranking)
create_taskCreate a new task after confirming no duplicates exist
update_taskAppend to description, add labels, or change priority
close_taskMark a resolved task as done

Contact tools

ToolDescription
lookup_contactSearch for known contacts by name or identity
upsert_contactCreate or update a contact profile
link_contact_identityLink a new channel identity to an existing contact
merge_contactsConsolidate duplicate contact records

Control tools

ToolDescription
doneSignal processing is complete and return a summary

Deduplication

The agent uses a dedupe_key system to prevent duplicate tasks. Each key follows the format:
area::intent::object
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