Skip to main content
An autonomous research agent that investigates topics using Parallel’s AI-optimized web search, synthesizes findings from multiple sources, and produces comprehensive research reports with citations.

What You’ll Learn

ConceptDescription
Web SearchUsing Parallel’s AI-optimized search API
Content ExtractionExtracting clean content from any URL
Source EvaluationAssessing credibility of sources
Multi-Source SynthesisCombining findings with citations

Prerequisites

  • Python 3.12+
  • OpenAI API key
  • Parallel API key (for web search)

Setup

1

Clone the repository

git clone https://github.com/agno-agi/agno.git
cd agno
2

Create and activate virtual environment

uv venv --python 3.12
source .venv/bin/activate
3

Install dependencies

uv pip install -r cookbook/01_showcase/01_agents/research_agent/requirements.in
4

Set environment variables

export OPENAI_API_KEY=your-openai-key
export PARALLEL_API_KEY=your-parallel-api-key
Get a Parallel API key at parallel.ai.

Run the Agent

Quick Research

Fast overview with 3-5 sources:
python cookbook/01_showcase/01_agents/research_agent/examples/quick_research.py
Demonstrates:
  • Using the research_topic helper function
  • Quick depth for fast results
  • Accessing structured report fields

Deep Research

Comprehensive investigation with 10-15 sources:
python cookbook/01_showcase/01_agents/research_agent/examples/deep_research.py
Demonstrates:
  • Comprehensive research depth
  • Multiple search iterations
  • Source credibility evaluation

Comparative Research

Compare multiple topics or technologies:
python cookbook/01_showcase/01_agents/research_agent/examples/comparative.py

Agent Configuration

research_agent = Agent(
    name="Research Agent",
    model=OpenAIResponses(id="gpt-5.2"),
    system_message=SYSTEM_MESSAGE,
    output_schema=ResearchReport,
    tools=[
        ParallelTools(
            max_results=10,
            enable_search=True,
            enable_extract=True,
        ),
        ReasoningTools(add_instructions=True),
    ],
    add_datetime_to_context=True,
    add_history_to_context=True,
    num_history_runs=5,
    enable_agentic_memory=True,
    markdown=True,
)
ParameterPurpose
modelGPT-5.2 for research synthesis
output_schemaStructured report with findings and sources
ParallelToolsAI-optimized web search and extraction
max_resultsMaximum sources per search (varies by depth)
enable_extractExtract full content from URLs
ReasoningToolsPlan research approach before searching

How It Works

Research Workflow

1. Analyze research question
2. Generate search objective and queries
3. Execute AI-optimized search via Parallel
4. Extract full content from top sources
5. Synthesize findings across sources
6. Identify gaps, iterate if needed
7. Compile final report with citations

Research Depth

DepthSourcesUse Case
quick3-5Fast overview, simple questions
standard5-10Balanced research, most questions
comprehensive10-15Thorough investigation, complex topics

Source Credibility

RatingSource Types
HighOfficial docs, academic papers, established publications
MediumWell-known blogs, industry sites, verified experts
LowPersonal blogs, forums, unverified sources

Troubleshooting

Ensure you’ve exported your Parallel API key:
export PARALLEL_API_KEY=your-api-key
Get a key at parallel.ai.
For specialized topics, the agent will report limited sources in the gaps field and suggest alternative search approaches.
When sources disagree, the agent notes the contradiction, includes confidence level for each claim, and cites sources for both perspectives.

Source Code