CLI Compare
The--compare flag allows you to compare different CLI modes side-by-side, helping you understand the trade-offs between speed, accuracy, and capabilities.
Quick Start
Available Modes
| Mode | Description | Use Case |
|---|---|---|
basic | Direct agent response | Simple questions, fast responses |
tools | Agent with tool access | Tasks requiring external data |
research | Deep research mode | Comprehensive research tasks |
planning | Planning-enabled agent | Complex multi-step tasks |
memory | Memory-enabled agent | Context-aware conversations |
router | Smart model selection | Automatic model optimization |
web_search | Native web search | Real-time information |
web_fetch | URL content retrieval | Specific webpage analysis |
query_rewrite | Query optimization | Improved search results |
expand_prompt | Prompt expansion | Detailed prompts from brief input |
Usage Examples
Basic Comparison
Research Comparison
With Model Override
Save Results
Python API
Result Structure
ModeResult
Each mode comparison returns aModeResult with:
| Field | Type | Description |
|---|---|---|
mode | str | Mode name |
output | str | Agent output |
execution_time_ms | float | Execution time in milliseconds |
model_used | str | Model used for generation |
tokens | dict | Token usage (input/output) |
cost | float | Estimated cost |
tools_used | list | Tools called during execution |
error | str | Error message if failed |
CompareResult
The overall comparison returns aCompareResult with:
| Field | Type | Description |
|---|---|---|
query | str | Original query |
comparisons | list | List of ModeResult objects |
timestamp | str | ISO timestamp |
get_summary()- Returns summary statisticsto_dict()- Convert to dictionaryto_json()- Convert to JSON string
Best Practices
When to Use Compare
- Evaluating Approaches: Test different modes before production use
- Performance Tuning: Find the fastest mode for your use case
- Cost Optimization: Compare token usage across modes
- Quality Assessment: Compare output quality for different tasks
Mode Selection Guide
| Task Type | Recommended Modes |
|---|---|
| Simple Q&A | basic |
| Current events | web_search, research |
| Complex analysis | planning, research |
| Code generation | basic, tools |
| Multi-step tasks | planning |
CLI Reference
Examples
Compare All Research Modes
Quick Performance Check
Production Evaluation
Related Features
- Deep Research - Comprehensive research mode
- Planning - Planning-enabled execution
- Web Search - Native web search
- Tools - Tool integration
- Evaluation - Agent evaluation framework

