Skip to main content

Definition

A micro-agent is a highly focused AI agent with 1-3 steps designed to accomplish a single, well-defined task. Unlike traditional monolithic agents that try to handle entire workflows, micro-agents embrace the Unix philosophy: “do one thing and do it well.”

Core Architecture

Traditional Agent (Monolithic):
┌─────────────────────────────────┐
│  Research + Analyze + Report    │  ← 10-15 steps, complex logic
│  (All in one agent)             │  ← High context usage
└─────────────────────────────────┘

Micro-Agent Chain:
┌─────────┐     ┌─────────┐     ┌─────────┐
│Research │ --> │ Analyze │ --> │ Report  │  ← 2-3 steps each
│ Agent   │     │ Agent   │     │ Agent   │  ← Focused context
└─────────┘     └─────────┘     └─────────┘

How chaining actually works

1. Agent creation phase

// Agent 1: Data Collector
{
  name: "daily-sales-collector",
  steps: [
    {
      description: "Connect to Salesforce and pull today's sales data",
      requiresVerification: false
    },
    {
      description: "Format data into structured JSON with key metrics",
      requiresVerification: false
    },
    {
      description: "Run the 'sales-analyzer' agent with the formatted data",
      requiresVerification: false
    }
  ]
}

2. Runtime execution

  • Step 1 & 2 execute normally using available tools
  • Step 3 triggers findAndRunAgent tool internally
  • The AI recognizes “Run the X agent” pattern and converts to tool call
  • New chat is created for the downstream agent
  • Context is passed via the instructions parameter

3. Context flow

Agent 1 Output: {sales: $45K, leads: 23, conversions: 5}

Agent 2 receives this as initial context

Agent 2 Output: {trend: "up 15%", anomalies: [...]}

Agent 3 receives cumulative insights

Benefits over monolithic agents

AspectMonolithicMicro-Agent Chain
Token UsageHigh (full context)Low (scoped context)
Failure RecoveryRestart entire flowRestart single agent
DebuggingComplex tracesIsolated logs
Human ReviewOverwhelmingFocused chunks
ReusabilityLimitedHigh (mix & match)
CostHigher40-60% lower

Implementation patterns

Sequential chain

[Extract] → [Transform] → [Load] → [Validate]

Branching chain

            ┌→ [Email Report]
[Analyze] ──┤
            └→ [Slack Alert]

Convergent chain

[Source A] ─┐
            ├→ [Aggregate] → [Report]
[Source B] ─┘

Technical implementation details

When an agent step contains text like “run the X agent”, the system:
  1. Pattern Recognition: The AI model identifies agent execution intent
  2. Tool Invocation: Calls findAndRunAgent with:
    • agentName: Extracted from the step description
    • instructions: Output from current agent’s execution
    • addContext: Set to true to include recent messages
  3. Chat Creation: New chat is spawned with:
    • Title: “Execution of [Agent Name] - triggered by [Parent Agent]”
    • Initial context: Instructions + any passed data
  4. Execution: Child agent runs in isolation with its own:
    • Token budget
    • Tool access
    • Execution logs
    • Error handling

Best practices for micro-agent design

  1. Single Responsibility: Each agent should have ONE clear purpose
  2. Clear Naming: Use descriptive names like “invoice-validator” not “agent-1”
  3. Explicit Outputs: Define what data the agent produces
  4. Error Handling: Include fallback steps for common failures
  5. Idempotency: Agents should be safe to re-run

Example: complete sales pipeline

Micro-Agent 1: lead-scraper
  Step 1: Search LinkedIn for matching prospects
  Step 2: Extract contact information
  Step 3: Run 'lead-enricher' with the contact list

Micro-Agent 2: lead-enricher  
  Step 1: Look up company information for each lead
  Step 2: Score leads based on ICP criteria
  Step 3: Run 'outreach-drafter' with qualified leads

Micro-Agent 3: outreach-drafter
  Step 1: Generate personalized email for each lead
  Step 2: Schedule emails in outreach tool
  Step 3: Run 'campaign-tracker' to monitor opens

Micro-Agent 4: campaign-tracker
  Step 1: Check email open/click rates hourly
  Step 2: Flag hot leads for immediate follow-up
  Step 3: Generate daily performance report
Each agent is reusable - you could swap ‘outreach-drafter’ for ‘linkedin-messenger’ without touching the other agents.
Need help implementing micro-agent chains? Check our agent creation guide or contact support.
I