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

How chaining actually works

1. Agent creation phase

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

Benefits over monolithic agents

Implementation patterns

Sequential chain

Branching chain

Convergent chain

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

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.