GPT Researcher: Building Multi-Source Research Agents That Actually Cite Their Work
Hook
Most RAG systems hallucinate citations or cherry-pick the first three search results. GPT Researcher scrapes 20+ sources in parallel, scores relevance with a learned filter that beats embeddings by 59%, and produces reports with proper attribution—solving the 'garbage in, garbage out' problem that plagues autonomous research agents.
Context
If you've tried building an LLM-powered research tool, you've hit the same wall: LangChain agents that hallucinate sources, AutoGPT workflows that take 30 minutes to produce shallow summaries, or RAG pipelines that regurgitate the top three Google results without verifying quality. The core problem isn't the language model—it's the orchestration layer. Sequential execution bottlenecks on I/O. Semantic embeddings retrieve topically similar content that's actually irrelevant to the specific question. And single-source answers inherit the bias of whatever blog post ranked first.
GPT Researcher tackles this as an engineering problem, not a prompt problem. Created by Assaf Elovic and now at 30k+ GitHub stars, it's an autonomous research pipeline that decomposes queries into sub-questions, scrapes sources concurrently, filters chunks with a custom relevance scorer called Jev, and synthesizes findings into structured reports with inline citations. The architecture explicitly prioritizes multi-source aggregation and bias reduction—pulling from 20+ sources by default instead of the 3-5 chunks typical RAG systems use. It's designed for practitioners who need comprehensive, cited research reports: data journalists investigating claims, consultants surveying market landscapes, or strategy teams synthesizing competitive intelligence.
Technical Insight
GPT Researcher's architecture is a four-stage pipeline: planning, execution, filtering, and synthesis. The planner agent takes your research query and uses an LLM to decompose it into sub-questions. For 'What are the latest advancements in solar panel efficiency?', it might generate: 'What is the current efficiency record for solar cells?', 'Which companies are leading in perovskite solar research?', 'What cost reductions have been achieved in 2024?'. Each sub-question spawns a parallel execution agent that queries a retriever backend (Tavily for web search by default, but supports MCP servers for custom data sources like GitHub repos or databases).
The magic happens in the filtering layer. Instead of using semantic embeddings to rank relevance—which retrieve topically similar content that doesn't actually answer the question—GPT Researcher uses Jev, a learned relevance scorer. Jev is a lightweight API that takes a question and a scraped chunk as input and returns a 0-1 relevance score. According to the project's benchmarks on 28 tasks, it achieves 73% relevance accuracy compared to 14% for raw embeddings, while matching cost and latency. The system gracefully falls back to BM25 keyword ranking if the Jev API key is missing. Here's the relevance filtering flow:
# Simplified from gpt_researcher/context/filters.py
async def filter_contexts(sub_question: str, scraped_chunks: list[str]) -> list[str]:
"""Score and filter chunks by relevance to sub-question."""
if JEV_API_KEY:
# Use learned relevance scorer
scores = await asyncio.gather(*[
jev_client.score(question=sub_question, context=chunk)
for chunk in scraped_chunks
])
ranked = sorted(zip(scraped_chunks, scores), key=lambda x: x[1], reverse=True)
return [chunk for chunk, score in ranked if score > 0.6]
else:
# Fallback to BM25 keyword matching
return bm25_rank(sub_question, scraped_chunks, top_k=10)
This filtering step is what separates GPT Researcher from naive RAG systems. Semantic embeddings fail at relevance because they measure topical similarity, not answer-ability. A chunk about 'solar panel manufacturing challenges' has high cosine similarity to a question about efficiency records, but doesn't actually contain the answer. Jev is trained to predict whether a human would mark a chunk as directly relevant to answering the question—a classification task, not a similarity task.
The execution layer uses async/await throughout for I/O parallelization. When you run a research job, GPT Researcher fans out HTTP requests to scrape 20+ URLs concurrently, processes them through the filter in parallel, and sends batches to the LLM for summarization. This is why it generates 2000-word reports in ~5 minutes instead of the 30+ minutes AutoGPT-style sequential agents take. Here's the concurrent scraping pattern:
# Simplified from gpt_researcher/agents/researcher.py
async def research_sub_question(sub_q: str, retriever) -> ResearchResult:
"""Execute research for a single sub-question."""
# Retrieve URLs from search API
urls = await retriever.search(sub_q, max_results=20)
# Scrape all URLs concurrently
scrape_tasks = [scrape_url(url) for url in urls]
raw_contents = await asyncio.gather(*scrape_tasks, return_exceptions=True)
# Filter for relevance
relevant_chunks = await filter_contexts(sub_q, raw_contents)
# Summarize with LLM, preserving source attribution
summary = await llm.summarize(
question=sub_q,
contexts=relevant_chunks,
instruction="Cite sources as [1], [2] inline"
)
return ResearchResult(summary=summary, sources=urls)
The publisher agent aggregates findings from all sub-questions, deduplicates insights, and structures them into sections (Introduction, Key Findings, Conclusion). It supports Markdown, PDF, and DOCX exports with inline citations. The LangGraph integration enables 'deep research' mode, where each sub-question recursively spawns its own research tree—configurable by depth and breadth parameters. This lets you do systematic exploration: breadth-first for surveys, depth-first for drilling into specific aspects.
One architectural detail worth noting: GPT Researcher decouples retrievers (search), filters (relevance), synthesis (LLM), and exporters. You can swap Tavily for Metaphor.ai for academic sources, replace Jev with your own embeddings model, or add custom MCP servers to pull from proprietary databases. The MCP client integration is particularly clever—it positions the tool as middleware between LLMs and private data sources, not just a web scraper. You can mix web search with GitHub repo retrieval in a single research run, something pure RAG tools don't handle gracefully.
Gotcha
The cost model assumes you're okay with $0.40+ per research run. That's using Gemini or GPT-4o-mini, but deep research mode with recursive trees can easily hit $5-10 for complex topics. There's no cost estimation UI before you hit 'run', which makes budget control challenging. If you're building a high-volume application—say, generating 100 reports daily—you're looking at $40-1000/day in LLM costs, not counting retriever API fees (Tavily charges per search). This is designed for quality over cost.
The 20-source aggregation sounds impressive, but there's no source diversity verification. If Tavily returns 15 URLs from the same news site, GPT Researcher will happily scrape all 15 and treat them as independent sources. You're trusting the retriever to return diverse results. Also, the Jev benchmark is self-reported on 28 undisclosed tasks with no public dataset. The 73% relevance claim is compelling, but you can't reproduce it without re-running their eval scripts on your own data. Relevant chunks also don't guarantee useful reports—a chunk can be perfectly relevant but low-quality (SEO spam, outdated data).
Context window management is implicit. For deep research trees that generate 100k+ tokens of intermediate findings, there's no explicit chunking or summarization strategy shown in the code. You're relying on the LLM's context window to fit everything during final synthesis, which risks truncation or relevance loss. And local document research (DOC_PATH for PDFs/DOCX) is file-glob based with no vector indexing—it'll underperform on large corpora compared to LlamaIndex or pgvector-backed RAG systems.
Verdict
Use if: You're a data journalist, consultant, or researcher who needs comprehensive, cited reports and can justify $0.40-5 per research run. The multi-source aggregation, Jev filtering, and parallel execution deliver legitimately better results than LangChain agents you'd cobble together yourself. The MCP integration makes it valuable as middleware between LLMs and proprietary data. You want opinionated workflows and production-ready frontends (Docker Compose with React UI + Python backend) out of the box. Skip if: You're doing retrieval over large private knowledge bases—vector databases with proper chunking handle that better. You need sub-second response times—this is a minutes-long batch process. You're cost-sensitive and need to generate hundreds of reports daily—the per-run cost adds up fast. You want granular control over embedding models, chunking strategies, or reranking—the abstraction hides those details. For quick lookups, use Perplexity. For private docs, use LlamaIndex with vector stores. For bespoke agent workflows, use LangChain's primitives. For multi-source, cited research reports with bias reduction, use GPT Researcher.