Skip to main content
The Advanced Research API provides a sophisticated multi-agent research system that combines director and worker agents to conduct comprehensive research tasks. The system leverages external search capabilities and supports both single and batch processing modes.
The Advanced Research system uses a director-worker architecture for coordinated, comprehensive research with external search integration.

Quick Start

  • Python
  • JavaScript
  • cURL
import requests
import os

API_KEY = os.getenv("SWARMS_API_KEY")
BASE_URL = "https://swarms-api-285321057562.us-east1.run.app"

headers = {
    "x-api-key": API_KEY,
    "Content-Type": "application/json"
}

payload = {
    "config": {
        "name": "AI Ethics Research",
        "description": "Research on AI ethics and responsible AI development",
        "worker_model_name": "gpt-4o-mini",
        "director_model_name": "gpt-4o",
        "max_loops": 1,
        "exa_search_num_results": 3
    },
    "task": "What are the key ethical considerations in developing AI systems?"
}

response = requests.post(
    f"{BASE_URL}/v1/advanced-research/completions",
    headers=headers,
    json=payload
)

result = response.json()
print(result['outputs'])

Key Features

Multi-Agent Architecture

  • Director Agent: Orchestrates the research process and synthesizes results
  • Worker Agents: Execute specific research tasks and gather information
  • External Search: Integrates with Exa search for web research capabilities

Configurable Models

  • Support for multiple LLM providers (OpenAI, Anthropic, etc.)
  • Separate models for director and worker agents
  • Customizable token limits and loops

Cost Tracking

  • Transparent token usage reporting
  • Real-time cost calculation
  • Credit system integration

Use Cases

  • Academic Research: Comprehensive literature reviews and analysis
  • Market Research: Competitive analysis and trend identification
  • Technical Documentation: In-depth analysis of technical topics
  • Policy Research: Analysis of regulations and their implications
  • Innovation Research: Exploring emerging technologies and their applications

Batch Processing

Process multiple research tasks in parallel:
batch_payload = {
    "input_schemas": [
        {
            "config": {
                "name": "Healthcare AI",
                "description": "AI in healthcare research",
                "worker_model_name": "gpt-4o-mini",
                "director_model_name": "gpt-4o"
            },
            "task": "How is AI transforming healthcare?"
        },
        {
            "config": {
                "name": "Sustainable Energy",
                "description": "Renewable energy research",
                "worker_model_name": "gpt-4o-mini",
                "director_model_name": "gpt-4o"
            },
            "task": "What are the latest breakthroughs in sustainable energy?"
        }
    ]
}

response = requests.post(
    f"{BASE_URL}/v1/advanced-research/batch/completions",
    headers=headers,
    json=batch_payload
)

results = response.json()
for result in results:
    print(f"Research: {result['name']}")
    print(f"Results: {result['outputs']}")

Configuration Options

ParameterTypeDefaultDescription
worker_model_namestring”gpt-4.1”Model for worker agents
director_model_namestring”gpt-4.1”Model for director agent
max_loopsinteger1Number of research iterations
director_max_tokensinteger8000Token limit for director
exa_search_num_resultsinteger2Number of search results
exa_search_max_charactersinteger100Characters per search result

Best Practices

  1. Task Specificity: Provide clear, specific research questions
  2. Model Selection: Use more capable models for complex research tasks
  3. Loop Configuration: Increase loops for deeper analysis (2-3 loops recommended)
  4. Search Parameters: Adjust search results based on research scope
  5. Cost Monitoring: Monitor token usage for budget management
I