Skip to content

Configurable Agents

The platform provides a flexible system for creating and configuring agents to handle specific tasks. This guide covers how to define and customize agents.

Predefined Agents

The system comes with several preconfigured agents defined in agents.json:

Core Agents

  • RouterAgent: Routes requests to appropriate specialized agents
  • ResearchAssistant: Conducts web research and information gathering
  • ResearchManager: Manages and coordinates research activities
  • ContentManager: Manages content creation and organization
  • ContentWriter: Writes and generates content
  • ProjectManager: Manages projects and coordinates tasks
  • OnboardingConsultant: Handles user onboarding processes
  • SolverAgent: Solves problems and provides solutions

Agent Configuration

Each agent in agents.json has these properties:

{
    "className": "AgentClassName",
    "sourcePath": "../agents/agentPath",
    "userId": "unique-agent-id",
    "handle": "@agentname",
    "description": "Agent purpose and capabilities",
    "enabled": true,
    "config": {
        // Agent-specific configuration
    }
}

Creating New Agents

  1. Define the Agent Class
  2. Extend ConfigurableAgent or StepBasedAgent
  3. Implement required methods
  4. Add custom behavior
export class MyCustomAgent extends ConfigurableAgent {
    constructor(params: AgentConstructorParams) {
        super(params);
        this.setPurpose('My agent purpose');
    }

    protected async initializeFromConfig(config: any) {
        // Initialize from configuration
    }
}
  1. Add to agents.json
  2. Create new entry with unique ID
  3. Set source path to agent file
  4. Define configuration options
"MyCustomAgent": {
    "className": "MyCustomAgent",
    "sourcePath": "../agents/myCustomAgent",
    "userId": "unique-id",
    "handle": "@custom",
    "description": "Handles custom tasks",
    "enabled": true,
    "config": {
        "option1": "value1",
        "option2": "value2"
    }
}
  1. Configure Default Channels
  2. Add channel mapping in defaultChannels
  3. Specify which channel the agent should monitor
"defaultChannels": {
    "custom": "channel-id"
}

Agent Configuration Options

Common configuration options include:

  • maxSearches: Maximum web searches per request
  • maxDepth: Maximum search depth
  • timeout: Request timeout in milliseconds
  • model: LLM model to use
  • temperature: LLM temperature setting

Best Practices

  1. Clear Purpose
  2. Define a specific purpose for each agent
  3. Avoid overlapping responsibilities

  4. Modular Design

  5. Break complex tasks into smaller steps
  6. Use step executors for reusable components

  7. Configuration

  8. Make frequently changed settings configurable
  9. Provide sensible defaults
  10. Validate configuration values

  11. Error Handling

  12. Implement robust error handling
  13. Provide meaningful error messages
  14. Include fallback behaviors

Example Workflow

  1. Define agent class:

    export class DataAnalyzer extends ConfigurableAgent {
        constructor(params: AgentConstructorParams) {
            super(params);
            this.setPurpose('Analyze and visualize data');
        }
    }
    

  2. Add to agents.json:

    "DataAnalyzer": {
        "className": "DataAnalyzer",
        "sourcePath": "../agents/dataAnalyzer",
        "userId": "data-analyzer-id",
        "handle": "@analyzer",
        "description": "Analyzes and visualizes data",
        "enabled": true,
        "config": {
            "maxRows": 1000,
            "chartTypes": ["bar", "line", "pie"]
        }
    }
    

  3. Configure default channel:

    "defaultChannels": {
        "analysis": "channel-id-for-analysis"
    }
    

  4. Use in conversations:

    [You] @analyzer Can you visualize this data?
    [DataAnalyzer] Sure! What type of chart would you like?