TheDocumentation Index
Fetch the complete documentation index at: https://docs.swarms.world/llms.txt
Use this file to discover all available pages before exploring further.
ReasoningDuo class implements a dual-agent reasoning system that combines a reasoning agent and a main agent to provide well-thought-out responses to complex tasks. This architecture separates the reasoning process from the final response generation.
Architecture
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
model_name | str | "reasoning-agent-01" | Name identifier for the reasoning agent |
description | str | "A highly intelligent..." | Description of the reasoning agent’s capabilities |
model_names | list[str] | ["claude-sonnet-4-6", "gpt-5.4"] | Model names for reasoning and main agents |
system_prompt | str | "You are a helpful..." | System prompt for the main agent |
Methods
| Method | Parameters | Returns | Description |
|---|---|---|---|
run | task: str | str | Processes a single task through both agents |
batched_run | tasks: List[str] | List[str] | Processes multiple tasks sequentially |
Quick Start
Examples
Mathematical Analysis
Financial Analysis
Customizing Agent Behavior
Batch Processing
Best Practices
- Task Formulation: Be specific and clear in task descriptions. Include relevant context and constraints.
- Performance Optimization: Use
batched_runfor multiple related tasks. Monitor agent outputs for consistency. - Model Selection: Adjust model parameters based on task complexity.