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
- 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
- Shared job state lives outside agents — plans, artifacts, progress
- Each agent reads and writes to its designated state slice
- State transitions are explicit — planner outputs feed executor inputs
- Progress tracked externally, not inside any single agent
- Each agent receives role-specific context only
- Planner sees goals and constraints, not execution details
- Executor sees the plan and tools, not review criteria
- Reviewer sees outputs and quality standards, not planning rationale
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)