Build a research assistant with multi-query search, result aggregation, and deep search.
This example builds a research assistant that searches multiple related queries, deduplicates and aggregates the results, and uses deep search for thorough coverage.
Multi-query via JSON array returns combined results in a single response. The sequential approach above gives you per-query control and deduplication, but uses more API calls.
Focus research on academic or authoritative sources:
research_data = research( queries=["quantum computing applications"], depth="deep", limit=20,)# Post-filter by domainacademic_results = [ r for r in research_data["results"] if any(d in r["source"] for d in ["arxiv.org", "nature.com", "ieee.org", "acm.org"])]
Or use includeDomains to restrict at the API level:
Combine results with an LLM for a synthesized report:
# Gather context from researchcontext_parts = []for result in research_data["results"][:15]: text = result["desc"] if result.get("extracts"): text = " ".join(result["extracts"]) context_parts.append(f"[{result['title']}]({result['link']})\n{text}")context = "\n\n".join(context_parts)prompt = f"""Write a research summary based on these search results.Organize by theme. Cite sources with URLs.{context}"""# Send to your LLM of choice