Use the Agent API deep-research preset for comprehensive, multi-step research tasks — synchronous usage, batch concurrency, result processing, and production patterns
Use this file to discover all available pages before exploring further.
This guide shows how to use the Agent API’s deep-research 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 deep-research 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.
Use the deep-research preset for comprehensive research queries.
from perplexity import Perplexityclient = Perplexity()response = client.responses.create( preset="deep-research", input=( "Provide a comprehensive analysis of the current state of nuclear fusion research. " "Cover the main approaches (tokamak, stellarator, inertial confinement, laser-driven), " "key milestones achieved in the past 2 years, major private companies involved, " "and realistic timelines for commercial fusion power." ),)print(f"Model: {response.model}")print(f"\n{response.output_text}")
The deep-research 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.
Combine deep research with domain filters for focused, authoritative research.
from perplexity import Perplexityclient = Perplexity()# Deep research restricted to government and academic sourcesresponse = client.responses.create( model="openai/gpt-5.2", input=( "Analyze the current regulatory landscape for AI in healthcare. " "Cover FDA guidance, EU AI Act implications, and recent enforcement actions." ), tools=[{ "type": "web_search", "filters": { "search_domain_filter": [".gov", ".europa.eu", "who.int", "nature.com", ".edu"], }, }], instructions=( "Conduct thorough research using only government and academic sources. " "Provide specific regulatory references, dates, and policy details." ),)print(response.output_text)
Run multiple deep research queries concurrently using asyncio and the Perplexity SDK.
import asyncioimport timefrom perplexity import AsyncPerplexityasync def single_research(client: AsyncPerplexity, query: str) -> dict: """Run a single deep research query.""" start = time.time() try: response = await client.responses.create( preset="deep-research", input=query, ) return { "query": query, "content": response.output_text, "model": response.model, "elapsed": time.time() - start, } except Exception as e: return {"query": query, "error": str(e), "elapsed": time.time() - start}async def batch_research(queries: list[str], max_concurrent: int = 3) -> list[dict]: """Run multiple deep research queries with concurrency limits.""" semaphore = asyncio.Semaphore(max_concurrent) async def limited_research(client, query): async with semaphore: return await single_research(client, query) async with AsyncPerplexity() as client: tasks = [limited_research(client, q) for q in queries] return await asyncio.gather(*tasks)if __name__ == "__main__": queries = [ "What are the latest advances in room-temperature superconductors?", "What is the current state of quantum error correction?", "What are the most promising approaches to carbon capture and storage?", ] print(f"Starting batch research: {len(queries)} queries\n") results = asyncio.run(batch_research(queries, max_concurrent=3)) for r in results: status = "OK" if "content" in r else f"FAILED ({r.get('error')})" word_count = len(r.get("content", "").split()) if "content" in r else 0 print(f" [{r['elapsed']:.0f}s] {r['query'][:60]}... → {status} ({word_count} words)")
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.