ScavioScavio
ProductPricingDocs
Sign InGet Started
  1. Home
  2. Tutorials
  3. How to Build a Multi-Source Research Agent
Tutorial

How to Build a Multi-Source Research Agent

Build an agent that searches Google, Reddit, and YouTube for a topic via a single API, combines results, and generates a structured research brief.

Get Free API KeyAPI Docs

A multi-source research agent searches Google, Reddit, and YouTube for a topic using the Scavio search API's platform parameter, combines the results into a unified context, and generates a research brief using an LLM.

Prerequisites

  • Python 3.9+
  • Scavio API key
  • anthropic SDK

Walkthrough

Step 1: Define per-platform search functions

Each platform call uses the same endpoint with a different platform value.

Python
import requests

API_KEY = "your-scavio-api-key"

def search(query: str, platform: str = "google", n: int = 5) -> list:
    r = requests.post(
        "https://api.scavio.dev/api/v1/search",
        json={"query": query, "platform": platform, "num_results": n},
        headers={"x-api-key": API_KEY},
        timeout=15
    )
    r.raise_for_status()
    return r.json().get("organic_results", [])

search_google  = lambda q, n=5: search(q, "google", n)
search_reddit  = lambda q, n=5: search(q, "reddit", n)
search_youtube = lambda q, n=5: search(q, "youtube", n)

Step 2: Gather multi-source results

Run three searches in parallel using ThreadPoolExecutor.

Python
from concurrent.futures import ThreadPoolExecutor, as_completed

def gather_sources(topic: str) -> dict:
    sources = {}
    tasks = {
        "google":  (topic + " overview",),
        "reddit":  (topic + " discussion",),
        "youtube": (topic + " tutorial",)
    }
    with ThreadPoolExecutor(max_workers=3) as executor:
        futures = {
            executor.submit(search, query, platform): platform
            for platform, (query,) in tasks.items()
        }
        for future in as_completed(futures):
            platform = futures[future]
            try:
                sources[platform] = future.result()
            except Exception as e:
                sources[platform] = []
                print(f"{platform} search failed: {e}")
    return sources

Step 3: Format and generate research brief

Combine results into a context block and prompt Claude for a structured brief.

Python
import anthropic

ANTHROPIC_KEY = "your-anthropic-key"

def format_sources(sources: dict) -> str:
    lines = []
    for platform, results in sources.items():
        lines.append(f"\n### {platform.upper()}")
        for r in results[:3]:
            lines.append(f"- {r.get('title')}\n  {r.get('snippet','')[:150]}")
    return "\n".join(lines)

def research_brief(topic: str) -> str:
    sources = gather_sources(topic)
    context = format_sources(sources)
    prompt = f"""Based on these multi-source search results about '{topic}', write a research brief with:
1. Key findings (3 bullets)
2. Community sentiment from Reddit
3. Top learning resources from YouTube

{context}

Brief:"""
    client = anthropic.Anthropic(api_key=ANTHROPIC_KEY)
    msg = client.messages.create(model="claude-sonnet-4-6", max_tokens=1024,
                                  messages=[{"role": "user", "content": prompt}])
    return msg.content[0].text

print(research_brief("vector databases 2026"))

Python Example

Python
import requests
import anthropic
from concurrent.futures import ThreadPoolExecutor, as_completed

SCAVIO_KEY = "your-scavio-api-key"
ANTHROPIC_KEY = "your-anthropic-key"

def search(query, platform="google", n=5):
    r = requests.post("https://api.scavio.dev/api/v1/search",
                      json={"query": query, "platform": platform, "num_results": n},
                      headers={"x-api-key": SCAVIO_KEY}, timeout=15)
    r.raise_for_status()
    return r.json().get("organic_results", [])

def gather(topic):
    tasks = {"google": f"{topic} overview", "reddit": f"{topic} discussion", "youtube": f"{topic} tutorial"}
    results = {}
    with ThreadPoolExecutor(max_workers=3) as ex:
        futures = {ex.submit(search, q, p): p for p, q in tasks.items()}
        for f in as_completed(futures):
            p = futures[f]
            results[p] = f.result() if not f.exception() else []
    return results

def format_ctx(sources):
    parts = []
    for p, items in sources.items():
        parts.append(f"\n### {p.upper()}")
        parts.extend(f"- {i.get('title')}\n  {i.get('snippet','')[:120]}" for i in items[:3])
    return "\n".join(parts)

def research_brief(topic):
    sources = gather(topic)
    ctx = format_ctx(sources)
    prompt = f"Research brief for '{topic}':\n\n{ctx}\n\nWrite: 1) Key findings 2) Reddit sentiment 3) YouTube resources"
    client = anthropic.Anthropic(api_key=ANTHROPIC_KEY)
    msg = client.messages.create(model="claude-sonnet-4-6", max_tokens=1024,
                                  messages=[{"role": "user", "content": prompt}])
    return msg.content[0].text

if __name__ == "__main__":
    print(research_brief("vector databases 2026"))

JavaScript Example

JavaScript
const SCAVIO_KEY = 'your-scavio-api-key';

async function search(query, platform = 'google', n = 5) {
  const res = await fetch('https://api.scavio.dev/api/v1/search', {
    method: 'POST',
    headers: { 'Content-Type': 'application/json', 'x-api-key': SCAVIO_KEY },
    body: JSON.stringify({ query, platform, num_results: n })
  });
  const data = await res.json();
  return data.organic_results ?? [];
}

async function gatherSources(topic) {
  const [google, reddit, youtube] = await Promise.all([
    search(`${topic} overview`, 'google'),
    search(`${topic} discussion`, 'reddit'),
    search(`${topic} tutorial`, 'youtube')
  ]);
  return { google, reddit, youtube };
}

const sources = await gatherSources('vector databases 2026');
for (const [platform, results] of Object.entries(sources)) {
  console.log(`\n${platform.toUpperCase()}:`);
  for (const r of results.slice(0, 2)) console.log(`  - ${r.title}`);
}

Expected Output

JSON
Research Brief: vector databases 2026

**Key Findings**
- Pinecone and Weaviate dominate production deployments; Qdrant gaining share for performance-sensitive use cases
- pgvector usage increased significantly as teams prefer staying in PostgreSQL
- Hybrid search (vector + keyword) is now standard; pure vector search is declining

**Reddit Sentiment**
Reddit discussions show frustration with vendor lock-in. r/MachineLearning and r/LocalLLaMA prefer self-hosted options (Qdrant, Chroma). Cost is the top concern.

**YouTube Resources**
- "Vector Databases Explained" by Fireship (2.3M views)
- "Qdrant Tutorial 2026" by TechWithTim (890K views)

Related Tutorials

  • How to Set Up RAG with Search Instead of Vectors
  • How to Connect Scavio to LangChain RAG
  • How to Integrate a Search API with CrewAI

Frequently Asked Questions

Most developers complete this tutorial in 15 to 30 minutes. You will need a Scavio API key (free tier works) and a working Python or JavaScript environment.

Python 3.9+. Scavio API key. anthropic SDK. A Scavio API key gives you 50 free credits on signup.

Yes. The free tier includes 50 credits on signup, which is more than enough to complete this tutorial and prototype a working solution.

Scavio has a native LangChain package (langchain-scavio), an MCP server, and a plain REST API that works with any HTTP client. This tutorial uses the raw REST API, but you can adapt to your framework of choice.

Related Resources

Use Case

Pi Coding Agent Multi-Platform Search

Read more
Best Of

Best Multi-Platform Data APIs for Agent Grounding in May 2026

Read more
Best Of

Best Search API for Deep Research Agents in 2026

Read more
Use Case

LangGraph Multi-Source Research Agent

Read more
Solution

Add Multi-Platform Search to AI Agents

Read more
Solution

Feed Six Platforms Into Your Agent for Fresh Data

Read more

Start Building

Build an agent that searches Google, Reddit, and YouTube for a topic via a single API, combines results, and generates a structured research brief.

Get Free API KeyRead the Docs
ScavioScavio

Real-time search API for AI agents. Search every platform, not just Google.

Product

  • Features
  • Pricing
  • Dashboard
  • Affiliates

Developers

  • Documentation
  • API Reference
  • Quickstart
  • MCP Integration
  • Python SDK

Alternatives

  • Tavily Alternative
  • SerpAPI Alternative
  • Firecrawl Alternative
  • Exa Alternative

Tools

  • JSON Formatter
  • cURL to Code
  • Token Counter
  • All Tools

© 2026 Scavio. All rights reserved.

Featured on TAAFT
Terms of ServicePrivacy Policy