> ## Documentation Index
> Fetch the complete documentation index at: https://docs.artaios.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agent Types

> Understand different agent types and when to use each

AMAS provides different agent types, each optimized for specific use cases and interaction patterns. This guide helps you choose the right agent type for your needs.

## Available Agent Types

### LLM Agent

**Type identifier**: `llm_agent`

The most basic agent type, powered by a large language model. Best for conversational interactions and tasks that don't require external tools or complex reasoning patterns.

> **Best For**
>
> * Conversational assistants
> * Content generation
> * Question answering
> * Text summarization
> * General chat interactions

> **Capabilities**
>
> * ✅ Streaming support
> * ✅ Knowledge base integration
> * ✅ Memory support
> * ❌ No tool calling
> * Configurable LLM parameters
> * Multi-turn conversations

#### Configuration Example

```yaml theme={null}
agents:
  - name: "assistant"
    agent_type: "llm_agent"
    description: "A helpful conversational assistant"
    
    prompt_config:
      system_prompt: |
        You are a helpful AI assistant. Provide clear, accurate, 
        and friendly responses to user questions.
    
    llm_config:
      model: "gpt-4o"
      temperature: 0.7
      max_tokens: 1000
    
    streaming_config:
      enable_streaming: true
      show_output_to_user: true
```

#### When to Use

> [!TIP]
>
> Use LLM agents when you need straightforward conversational interactions without external tool access

> [!TIP]
>
> Ideal for customer support, content creation, or general Q\&A scenarios

***

### ReAct Agent

**Type identifier**: `react_agent`

Implements the ReAct (Reasoning + Acting) pattern, enabling agents to use tools and external resources. The agent reasons about what actions to take, executes tools, and incorporates results into its responses.

> **Best For**
>
> * Web search and research
> * Data retrieval and analysis
> * Multi-step problem solving
> * Tasks requiring external information
> * Any task needing tool integration

> **Capabilities**
>
> * ✅ **Tool calling and execution**
> * ✅ Knowledge base integration
> * ✅ Memory support
> * ❌ Streaming disabled
> * Iterative reasoning loops
> * Thought process visibility

#### Configuration Example

```yaml theme={null}
agents:
  - name: "research_assistant"
    agent_type: "react_agent"
    description: "AI assistant with research and analysis capabilities"
    
    prompt_config:
      system_prompt: |
        You are a research assistant with access to web search and calculation tools.
        
        When solving problems:
        1. Break down the task into steps
        2. Use tools to gather information
        3. Analyze the results
        4. Provide a comprehensive answer
    
    tools:
      - "tavily_search"
      - "tavily_extract"
      - "calculator"
    
    max_iterations: 10
    
    llm_config:
      model: "gpt-4o"
      temperature: 0.1
      max_tokens: 2000
    
    streaming_config:
      enable_streaming: true
      show_output_to_user: true
      show_reasoning: true
      show_tool_to_user: true
```

#### ReAct Pattern Flow

```
User Query → Agent Reasoning → Tool Selection → Tool Execution → 
Result Analysis → More Tools? → Final Response
```

#### When to Use

> [!TIP]
>
> Use ReAct agents when tasks require external information or computations

> [!TIP]
>
> Perfect for research, data analysis, fact-checking, or complex problem-solving

> [!WARNING]
>
> Set appropriate `max_iterations` to prevent infinite reasoning loops. Recommended: 5-15 iterations.

***

### Supervisor Agent

**Type identifier**: `supervisor`

Coordinates multiple specialized worker agents, routing tasks to the most appropriate agent and managing multi-agent workflows. Acts as an intelligent orchestrator.

> **Best For**
>
> * Multi-domain systems
> * Complex workflows
> * Task delegation
> * Team coordination
> * Specialized agent teams

> **Capabilities**
>
> * ✅ Streaming support
> * ✅ Tool calling (for handoffs)
> * ✅ Memory support
> * Dynamic agent routing
> * Agent handoffs
> * Workflow coordination

#### Configuration Example

```yaml theme={null}
agents:
  - name: "team_supervisor"
    agent_type: "supervisor"
    description: "Coordinates specialized team members"
    
    # Define which agents this supervisor manages
    supervised_agents: 
      - "research_agent"
      - "analysis_agent"
      - "writer_agent"
    
    # Control coordination flow
    return_to_supervisor: true
    max_handoffs: 15
    
    prompt_config:
      system_prompt: |
        You are a team supervisor coordinating specialized agents.
        
        Your team:
        - research_agent: Gathers information via web search
        - analysis_agent: Analyzes data and identifies patterns
        - writer_agent: Creates polished written content
        
        INSTRUCTIONS:
        - Immediately delegate tasks to the appropriate specialist
        - Use transfer tools to hand off work
        - Provide clear context when transferring
        - Evaluate results and decide next steps
    
    streaming_config:
      enable_streaming: true
      show_output_to_user: true
```

#### Supervisor Coordination Patterns

**Iterative Coordination** (`return_to_supervisor: true`, the default):

```
User → Supervisor → Worker 1 → Supervisor → Worker 2 → Supervisor → User
```

Supervisor evaluates each step and orchestrates multi-agent workflows.

**One-Way Delegation** (`return_to_supervisor: false`):

```
User → Supervisor → Worker Agent → User
```

Simple routing where workers respond directly to users.

#### When to Use

> [!TIP]
>
> Use supervisors when you have multiple specialized agents that need coordination

> [!TIP]
>
> Ideal for complex systems requiring task decomposition and delegation

> [!TIP]
>
> Combine different agent types under a supervisor: use ReAct agents for research, LLM agents for synthesis.

***

## Agent Type Comparison

| Feature | LLM Agent | ReAct Agent | Supervisor |
| - | - | - | - |
| **Tool Calling** | ❌ No | ✅ Yes | ✅ Yes (handoffs) |
| **Streaming** | ✅ Yes | ❌ No | ✅ Yes |
| **Knowledge Base** | ✅ Yes | ✅ Yes | ✅ Yes |
| **Memory** | ✅ Yes | ✅ Yes | ✅ Yes |
| **Reasoning Loop** | ❌ Single pass | ✅ Iterative | ✅ Coordination |
| **Multi-Agent** | ❌ No | ❌ No | ✅ Yes |
| **Complexity** | Low | Medium | High |
| **Best Use Case** | Chat | Research | Orchestration |

## Choosing the Right Agent Type

### Decision Tree

**1. Do you need multiple specialized agents?**

**Yes** → Use **Supervisor Agent**

**No** → Continue to next question

**2. Do you need external tools or data?**

**Yes** → Use **ReAct Agent**

**No** → Continue to next question

**3. Do you need basic conversation?**

**Yes** → Use **LLM Agent**

### Use Case Examples

> **Customer Support Chatbot**
>
> **Recommended**: `llm_agent`
>
> Simple conversational interface for answering common questions. No external tools needed.

> **Research Assistant**
>
> **Recommended**: `react_agent`
>
> Needs web search, knowledge base access, and multi-step reasoning to gather and synthesize information.

> **Content Creation Team**
>
> **Recommended**: `supervisor` + multiple `llm_agent` workers
>
> Supervisor coordinates research, writing, and editing agents for comprehensive content creation.

> **Data Analysis System**
>
> **Recommended**: `react_agent` with calculator and database tools
>
> Performs calculations, queries databases, and generates insights from data.

> **Multi-Domain Expert System**
>
> **Recommended**: `supervisor` + specialized `react_agent` workers
>
> Routes technical, business, or creative questions to domain-specific agents with appropriate tools.

## Configuration Best Practices

### LLM Agent Best Practices

> [!TIP]
>
> **Temperature**: Use 0.7-1.0 for creative tasks, 0.1-0.3 for factual responses

> [!TIP]
>
> **System Prompt**: Be specific about tone, style, and response format

### ReAct Agent Best Practices

> [!TIP]
>
> **Max Iterations**: Set to 5-10 for most tasks. Higher values (15+) only for complex research.

> [!TIP]
>
> **Tool Selection**: Only include tools the agent actually needs. More tools = more complexity.

> [!TIP]
>
> **Show Reasoning**: Enable `show_reasoning: true` during development to debug tool usage patterns.

### Supervisor Best Practices

> [!TIP]
>
> **Clear Delegation**: Write explicit instructions in `prompt_config.system_prompt` about when to use each worker.

> [!TIP]
>
> **Return Strategy**: Use `return_to_supervisor: true` (the default) for quality control and multi-step workflows. Set to `false` for simple one-way delegation.

> [!WARNING]
>
> **Max Handoffs**: Set reasonable limits (10-20) to prevent infinite coordination loops.

## Advanced Patterns

### Hybrid Teams

Combine multiple agent types for sophisticated systems:

```yaml theme={null}
agents:
  # Supervisor coordinates the team
  - name: "supervisor"
    agent_type: "supervisor"
    supervised_agents: ["researcher", "analyst", "writer"]
  
  # ReAct agent for research
  - name: "researcher"
    agent_type: "react_agent"
    tools: ["tavily_search", "tavily_extract"]
  
  # ReAct agent for analysis
  - name: "analyst"
    agent_type: "react_agent"
    tools: ["calculator"]
  
  # LLM agent for final synthesis
  - name: "writer"
    agent_type: "llm_agent"
    llm_config:
      temperature: 0.8  # More creative for writing
```

### Specialized Workers

Create domain-specific agents by customizing system prompts:

```yaml theme={null}
- name: "technical_expert"
  agent_type: "react_agent"
  prompt_config:
    system_prompt: |
      You are a senior software engineer specializing in Python and system architecture.
      Provide technical, detailed responses with code examples.
  tools: ["tavily_search"]

- name: "business_expert"
  agent_type: "llm_agent"
  prompt_config:
    system_prompt: |
      You are a business strategy consultant with MBA-level expertise.
      Focus on ROI, market analysis, and strategic recommendations.
```

## Next Steps

> **[YAML Configuration](https://docs.artaios.ai/amas/yaml-configuration.md)**
>
> Learn the complete YAML configuration syntax

> **[Agent Capabilities](https://docs.artaios.ai/amas/agent_config/agent-capabilities.md)**
>
> Explore tools, streaming, and other capabilities


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.