Skip to content
Joe Curlee (w4ffl35) edited this page Nov 29, 2025 · 1 revision

Agent Management System

The agents component provides tools for creating, configuring, and managing custom AI agents with specialized capabilities.

Overview

Custom agents allow users to create specialized AI assistants with:

  • Custom System Prompts - Define agent behavior and personality
  • Tool Sets - Select which tools the agent can use
  • Templates - Pre-configured agents for common tasks
  • Persistence - Agents stored in database for reuse

Agent Templates

Pre-configured templates for common use cases:

Template Description Tools
coding Software development assistant File operations, code execution
research Information gathering and analysis Web search, document search
creative Content creation and storytelling Text generation
calendar Scheduling and event management Calendar tools
custom User-defined configuration User-selected

Creating Agents

Via LLM Tool

The LLM can create agents using the create_agent tool:

User: "Create a coding assistant that helps with Python"
AI: [calls create_agent(
    name="python_helper",
    system_prompt="You are an expert Python developer...",
    tools=["read_file", "write_file", "run_command"],
    template="coding"
)]

Via API

from airunner.components.agents.tools import AGENT_TOOLS

create_tool = AGENT_TOOLS[0]  # CreateAgentTool
result = create_tool._run(
    name="code_helper",
    system_prompt="You are an expert Python developer",
    tools=["read_file", "write_file", "run_command"],
    template="coding"
)

Agent Tools

create_agent

Create a new custom agent.

Parameters:

  • name (str): Unique agent identifier
  • system_prompt (str): Custom system prompt
  • description (str, optional): Agent description
  • tools (list[str], optional): List of tool names
  • template (str, default="custom"): Template to use

configure_agent

Modify existing agent configuration.

Parameters:

  • agent_id (int): ID of agent to modify
  • name (str, optional): New name
  • description (str, optional): New description
  • system_prompt (str, optional): New system prompt
  • tools (list[str], optional): New tool list

list_agents

List all available agents with filtering.

Parameters:

  • template (str, optional): Filter by template type
  • include_disabled (bool): Include disabled agents

delete_agent

Remove an agent from the system.

Parameters:

  • agent_id (int): ID of agent to delete

Using Agents

Switching Agents

User: "Switch to my research agent"
AI: [calls switch_agent(name="research_agent")]

Agent Conversations

Each agent maintains its own conversation context:

# Agent-specific conversation
agent.chat("Help me write a Python script")

# Switch context
agent_manager.switch_to("research_agent")

Database Storage

Agents are persisted in the SQLite database:

CREATE TABLE agents (
    id INTEGER PRIMARY KEY,
    name VARCHAR(255) UNIQUE,
    description TEXT,
    system_prompt TEXT,
    template VARCHAR(50),
    tools JSON,
    enabled BOOLEAN DEFAULT TRUE,
    created_at DATETIME,
    updated_at DATETIME
);

See Also

Clone this wiki locally