Skip to main content
This guide shows how to use the Agent API’s medium preset for comprehensive, multi-step research tasks. Deep research performs extended web research, following chains of sources and synthesizing detailed answers. You will learn how to run deep research queries, process results, handle long-running requests, and run batch research workflows.
The medium preset on the Agent API performs multi-step web research, following chains of sources and synthesizing comprehensive answers. It automatically selects the best model and configures tools for deep research. For more on presets, see the Agent API Presets docs.

Prerequisites

Install the Perplexity SDK:
If you don’t have an API key yet:

Get your Perplexity API Key

Navigate to the API Keys tab in the API Portal and generate a new key.
Then export your API key as an environment variable:

Basic Deep Research

Use the medium preset for comprehensive research queries.
The medium preset automatically selects the best model and configures tools for multi-step research. You don’t need to specify a model or tools when using presets.

Processing Deep Research Results

Extract and format the key parts of a deep research response.

Deep Research with Domain Filtering

Combine deep research with domain filters for focused, authoritative research.

Batch Research with Concurrency

Run multiple deep research queries concurrently using asyncio and the Perplexity SDK.
Deep research queries consume significant compute resources. Keep concurrent requests to 3-5 to stay within rate limits and avoid throttling. Check your rate limits for specific thresholds.

Tips and Best Practices

  1. Use the medium preset for the simplest integration. It automatically selects the best model and configures tools.
  2. Combine with domain filters when you need authoritative sources. Use search_domain_filter to restrict to specific domains.
  3. Use instructions to guide the depth and focus of research. Be specific about what aspects to cover.
  4. Limit concurrency. Running too many deep research queries simultaneously may trigger rate limits. Use a semaphore to cap concurrent requests to 3-5.
  5. Use the async client for batch workflows. AsyncPerplexity enables concurrent requests without blocking.
  6. Set max_output_tokens for cost control when you need shorter summaries rather than exhaustive reports.

Next Steps

Agent API Presets

Full reference for available presets including medium.

Agent API Quickstart

Get started with the Agent API for multi-provider access and tools.

Domain Filtering

Control which domains the search includes or excludes.

Rate Limits

Understand rate limits for research and batch workflows.