Agents and Jobs

Agents are the workers in Atlas, and jobs define how they work together. Let’s explore both concepts and how they interact.

Agents: Your AI Workers

Agents are autonomous AI entities that perform specific tasks. Think of them as specialized team members, each with their own expertise.

Types of Agents

1. LLM Agents 🤖
  • Powered by language models (Claude, GPT-4, etc.)
  • Handle natural language tasks
  • Can use tools and reason through problems
2. System Agents ⚙️
  • Built-in agents provided by Atlas
  • Examples: ConversationAgent, MemoryAgent
  • Optimized for specific platform tasks
3. Remote Agents 🌐
  • External agents accessed via protocols (ACP, REST)
  • Integrate third-party AI services
  • Enable distributed architectures

Defining an Agent

Here’s a simple LLM agent:
agents:
  researcher:
    type: "llm"
    model: "claude-3-5-sonnet-20241022"
    purpose: "Research and analyze information"
    prompts:
      system: |
        You are a research specialist. Your role is to:
        - Find accurate, relevant information
        - Analyze data and identify patterns
        - Provide clear, evidence-based insights
        - Cite sources when possible
    config:
      temperature: 0.3  # Lower = more focused
      max_tokens: 2000

Jobs: Orchestrating Agent Work

Jobs define workflows - how agents work together to accomplish tasks. They’re triggered by signals and executed by agents.

Job Structure

jobs:
  analyze-data:
    name: "Data Analysis Pipeline"
    description: "Research, analyze, and report on data"
    
    triggers:
      - signal: "analyze-request"
        condition:
          # Only run for CSV files
          - type: "json_logic"
            logic:
              "==": [{"var": "fileType"}, "csv"]
    
    execution:
      strategy: "sequential"  # or "parallel"
      agents:
        - id: "researcher"
          input_source: "signal"
          task: "Analyze the provided data"
        
        - id: "reporter"
          input_source: "previous"
          task: "Create a summary report"

Execution Strategies

Sequential 📝
  • Agents run one after another
  • Each agent can use the previous agent’s output
  • Good for: pipelines, step-by-step processes
Parallel
  • Agents run simultaneously
  • Faster but no data sharing between agents
  • Good for: independent tasks, gathering multiple perspectives

Input Sources

Agents can receive input from:
  • signal - The triggering signal’s data
  • previous - The previous agent’s output
  • context - Shared session context
  • combined - Combination of sources

How Agents and Jobs Work Together

Here’s the flow:
  1. Signal triggers job → “analyze-request” signal received
  2. Job starts session → SessionSupervisor created
  3. Agents activated → Each agent in the job is prepared
  4. Execution begins → Agents work according to strategy
  5. Results collected → Outputs gathered and returned

Practical Example: Customer Support

Let’s build a customer support system:
agents:
  # Understands customer intent
  intent-analyzer:
    type: "llm"
    model: "claude-3-5-haiku-20241022"
    purpose: "Analyze customer support requests"
    prompts:
      system: "Categorize support requests and extract key information"
  
  # Provides solutions
  solution-provider:
    type: "llm"
    model: "claude-3-5-sonnet-20241022"
    purpose: "Provide detailed solutions"
    prompts:
      system: "You are a technical support expert..."
  
  # Handles conversations
  support-chat:
    type: "system"
    agent: "conversation"
    config:
      model: "claude-3-5-sonnet-20241022"
      system_prompt: "You are a friendly support agent..."

jobs:
  # Automated ticket handling
  handle-ticket:
    triggers:
      - signal: "new-ticket"
    execution:
      strategy: "sequential"
      agents:
        - id: "intent-analyzer"
          input_source: "signal"
        - id: "solution-provider"
          input_source: "previous"
  
  # Interactive support
  live-support:
    triggers:
      - signal: "start-chat"
    execution:
      strategy: "single"
      agents:
        - id: "support-chat"
          input_source: "signal"

Agent Capabilities

Tools

Agents can use tools to extend their capabilities:
agents:
  researcher:
    type: "llm"
    tools: ["web-search", "calculator", "file-reader"]

Memory

Agents can access workspace memory:
agents:
  assistant:
    type: "llm"
    config:
      memory_enabled: true
      context_window: 10  # Recent memories

Best Practices

1. Single Responsibility

Each agent should have one clear purpose. Create multiple specialized agents rather than one do-everything agent.

2. Right Model for the Task

  • Use smaller, faster models (Haiku) for simple tasks
  • Use larger models (Sonnet, Opus) for complex reasoning
  • Use system agents for platform operations

3. Clear Task Definitions

When agents work in sequence, provide clear task instructions:
agents:
  - id: "analyzer"
    task: "Extract the top 3 issues from the data"
  - id: "solver"
    task: "Propose solutions for each issue identified"

4. Error Handling

Plan for failures:
jobs:
  robust-pipeline:
    config:
      timeout: "300s"
      retry_on_failure: true
      max_retries: 3

Next Steps