<!-- source: https://deepwiki.com/MervinPraison/PraisonAI/2.2-specialized-agent-types -->

# Specialized Agent Types

- README.md
- api.md
- src/praisonai/README.md

This document covers specialized agent classes that extend the base `Agent` for domain-specific tasks. These agents provide pre-configured capabilities for media processing, research automation, code analysis, and interactive interfaces.

For general agent functionality and the base `Agent` class, see [Agent Class](/MervinPraison/PraisonAI/2.1-agent-class). For automatic agent generation from prompts, see [AutoAgents](/MervinPraison/PraisonAI/2.7-autoagents). For multi-agent coordination patterns, see [Multi-Agent Orchestration](/MervinPraison/PraisonAI/2.5-multi-agent-orchestration).

## Agent Type Hierarchy

PraisonAI provides specialized agent types that extend or complement the base `Agent` class with domain-specific capabilities. All specialized agents inherit the core agent features (LLM integration, tools, memory, planning) while adding specialized functionality.

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py193-224](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L193-L224) [README.md318-332](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L318-L332)

## Media Processing Agents

Media processing agents provide specialized capabilities for working with images, video, audio, and visual content. Each agent includes dedicated configuration classes and processing pipelines.

### ImageAgent

Handles image generation and processing tasks. Uses vision-capable models to analyze images and generate new images.

**Key Features:**

- Image generation from text descriptions
- Image analysis and captioning
- Image-to-image transformations
- Vision model integration

**Usage:**

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py193](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L193-L193) [README.md339](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L339-L339)

### VideoAgent and VideoConfig

Processes and analyzes video content, extracting frames, transcribing audio, and understanding video semantics.

**Configuration Class:** `VideoConfig`

**Key Features:**

- Video frame extraction
- Audio transcription from video
- Video content analysis
- Multi-modal video understanding

**Usage:**

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py195-196](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L195-L196) [README.md341](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L341-L341)

### AudioAgent and AudioConfig

Handles audio processing, transcription, and audio generation tasks.

**Configuration Class:** `AudioConfig`

**Key Features:**

- Audio transcription (speech-to-text)
- Audio generation (text-to-speech)
- Audio analysis and classification
- Multiple audio format support

**Usage:**

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py197-198](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L197-L198)

### VisionAgent and VisionConfig

Specialized for vision tasks including object detection, image classification, and visual question answering.

**Configuration Class:** `VisionConfig`

**Key Features:**

- Object detection and recognition
- Image classification
- Visual question answering
- Scene understanding

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py217-218](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L217-L218)

### OCRAgent and OCRConfig

Extracts text from images and documents using optical character recognition.

**Configuration Class:** `OCRConfig`

**Key Features:**

- Text extraction from images
- Document parsing
- Multi-language OCR support
- Layout analysis

**Usage:**

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py199-200](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L199-L200)

### Media Processing Pipeline

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py193-200](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L193-L200) [README.md335-344](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L335-L344)

## Research and Intelligence Agents

Research agents automate information gathering, query optimization, and prompt engineering tasks.

### DeepResearchAgent

Performs automated research using OpenAI, Gemini, or LiteLLM deep research APIs. Supports real-time streaming, web search, code execution, and structured citations.

**Key Classes:**

- DeepResearchAgent - Main agent class
- DeepResearchResponse - Response with report and citations
- Provider - Enum for provider selection (OpenAI, Gemini, LiteLLM)
- ReasoningStep , WebSearchCall , CodeExecutionStep , MCPCall , FileSearchCall - Execution step types

**Multi-Provider Architecture:**

```

```

**Usage:**

```

```

**CLI Usage:**

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py202-209](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L202-L209) [README.md580-616](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L580-L616) [README.md1592-1623](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L1592-L1623)

### QueryRewriterAgent

Transforms user queries to improve RAG retrieval quality using multiple rewriting strategies.

**Key Classes:**

- QueryRewriterAgent - Main agent class
- RewriteStrategy - Enum of strategies (BASIC, HYDE, STEP_BACK, SUB_QUERIES, MULTI_QUERY, CONTEXTUAL, AUTO)
- RewriteResult - Result with primary query and alternative queries

**Rewriting Strategies:**

**Usage:**

```

```

**CLI Usage:**

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py210-212](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L210-L212) [README.md618-651](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L618-L651) [README.md1580-1590](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L1580-L1590)

### PromptExpanderAgent

Expands short prompts into detailed, actionable prompts for better task execution.

**Key Classes:**

- PromptExpanderAgent - Main agent class
- ExpandStrategy - Enum of strategies (BASIC, DETAILED, STRUCTURED, CREATIVE, AUTO)
- ExpandResult - Result with expanded prompt

**Strategies:**

**Usage:**

```

```

**CLI Usage:**

```

```

**Key Difference:**

- --query-rewrite : Optimizes queries for search/retrieval (RAG)
- --expand-prompt : Expands prompts for detailed task execution

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py213-215](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L213-L215) [README.md2209-2245](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L2209-L2245)

### Research Agent Workflow

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py202-215](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L202-L215) [README.md584-651](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L584-L651) [README.md2209-2245](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L2209-L2245)

## Code and Context Agents

Agents specialized for code analysis, execution, and context management.

### CodeAgent and CodeConfig

Executes code in sandboxed environments and provides code interpretation capabilities.

**Configuration Class:** `CodeConfig`

**Key Features:**

- Safe code execution in sandbox
- Multiple language support
- Code analysis and debugging
- Integration with code interpreter tools

**Usage:**

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py223-224](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L223-L224) [README.md259](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L259-L259)

### ContextAgent and create_context_agent

Manages code context for large codebases using FastContext for rapid parallel search.

**Factory Function:** `create_context_agent()` - Helper to create pre-configured context agents

**Key Features:**

- Fast parallel code search (10-20x faster than sequential)
- Repository structure analysis
- Symbol and reference tracking
- Context window optimization

**Usage:**

```

```

**CLI Usage:**

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py201](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L201-L201) [README.md1869-1876](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L1869-L1876) [README.md385](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L385-L385)

### EmbeddingAgent and EmbeddingConfig

Generates and manages embeddings for semantic search and similarity tasks.

**Configuration Class:** `EmbeddingConfig`

**Key Features:**

- Text embedding generation
- Semantic similarity search
- Multiple embedding model support
- Batch embedding processing

**Usage:**

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py219-220](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L219-L220)

### Code Context Pipeline

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py201-224](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L201-L224) [README.md385](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L385-L385) [README.md1869-1876](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L1869-L1876)

## Interactive Agents

### RealtimeAgent and RealtimeConfig

Provides real-time voice interaction capabilities with streaming audio input/output.

**Configuration Class:** `RealtimeConfig`

**Key Features:**

- Real-time voice interaction
- Streaming audio processing
- Low-latency communication
- Voice activity detection

**Usage:**

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py221-222](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L221-L222) [README.md7](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L7-L7)

## RAG Optimization Agents

### AutoRagAgent

Automatically decides when to retrieve context from knowledge bases versus direct chat, based on query heuristics.

**Key Classes:**

- AutoRagAgent - Main wrapper class
- AutoRagConfig - Configuration for retrieval behavior
- RagRetrievalPolicy (alias: RetrievalPolicy ) - Enum: auto , always , never

**Retrieval Decision Logic:**

```

```

**Usage:**

```

```

**CLI Usage:**

```

```

**Retrieval Policies:**

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py229-232](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L229-L232) [README.md2944-2999](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L2944-L2999)

## Configuration Patterns

All specialized agents share common configuration patterns inherited from the base `Agent` class. Specialized configuration classes (`VideoConfig`, `AudioConfig`, etc.) extend the base configuration with domain-specific parameters.

### Common Configuration Parameters

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py193-232](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L193-L232)

### Agent Instantiation Patterns

All specialized agents follow consistent instantiation patterns:

**Pattern 1: Direct Instantiation**

```

```

**Pattern 2: Inline Configuration**

```

```

**Pattern 3: Factory Functions**

```

```

**Pattern 4: Wrapper Pattern**

```

```

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py193-232](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L193-L232) [README.md584-2999](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/README.md?plain=1#L584-L2999)

### Lazy Loading Architecture

All specialized agents are lazy-loaded to minimize import time and memory footprint. The lazy loading system uses `__getattr__` to load agents only when accessed.

**Lazy Loading Map:**

```

```

This architecture reduces package import time from ~3500ms to ~20ms for applications that don't use all specialized agent types.

**Sources:** [src/praisonai-agents/praisonaiagents/__init__.py122-384](https://github.com/MervinPraison/PraisonAI/blob/ab80807b/src/praisonai-agents/praisonaiagents/__init__.py#L122-L384)
