Skip to main content

Role-Based Agent

Agents created with explicit, fixed roles that constrain how they think — planning, executing, reviewing, critiquing — rather than what domain they operate in. Each role is a behavioral boundary enforced through system prompts and tool access.


Structure

A router assigns work to role-specific agents. Each agent operates within its behavioral constraints and writes to shared state. The separation ensures no single agent conflates planning with execution or evaluation.


Memory / State / Context

  • Each role maintains its own session memory
  • Optional shared read-only knowledge base across roles
  • Memory scoped to role prevents cross-contamination
  • Long-term memory per role for learning within that function

Key Characteristics

  • Cognitive separation — each agent focuses on one type of thinking
  • Reduced reasoning interference — planning doesn't pollute execution
  • Improved safety — reviewer can't be influenced by the executor's reasoning
  • Composable — roles can be added, removed, or swapped independently
  • Higher cost — multiple LLM calls per task

When to Use

  • Tasks benefit from separated planning, execution, and review phases
  • You need independent quality control or critique
  • Single-agent reasoning suffers from conflating different cognitive modes
  • Safety or compliance requires separation of concerns
  • The task has a natural multi-phase structure (think → do → check)