GPT Researcher

The pioneering open-source autonomous AI agent that conducts deep, multi-source research and produces citation-backed reports exceeding 2,000 words — faster and more reliably than any human researcher.

28.1Kstars
3.8Kforks
Apache License 2.0
Python

GPT Researcher is the first open-source autonomous research agent purpose-built to overcome the core weaknesses of LLM-based research: hallucination, token limits, shallow sourcing, and selective bias. Rather than querying a single source, it dispatches parallelized planner and executor agents that query 20+ web sources, scrape JavaScript-rendered pages, ingest local documents, and aggregate findings through RAG and Plan-and-Solve pipelines into a single, coherent, citation-backed report.

The system ships as both a Python pip package for programmatic integration and a full-stack application with a FastAPI backend, WebSocket-driven real-time streaming, and two frontend options: a lightweight HTML/CSS/JS interface and a production-ready Next.js frontend. Reports can be exported as PDF, Word, Markdown, JSON, or CSV, making it adaptable to journalistic, academic, enterprise, and developer workflows.

Version 3.x introduced Deep Research, a recursive tree-exploration mode that fans out into subtopics with configurable depth and breadth, spending roughly five minutes and $0.40 per investigation to produce genuinely comprehensive coverage. Alongside it, MCP (Model Context Protocol) integration enables research against GitHub repositories, databases, and custom APIs alongside conventional web search, and inline AI image generation via Google Gemini embeds contextually appropriate illustrations directly in the output report.

With over 27,000 GitHub stars, 70+ releases, and 200+ contributors, GPT Researcher has become the de facto reference implementation for autonomous research agents, used as both a standalone tool and as a research backend embedded in multi-agent systems built with LangGraph, AG2, and Claude.

What You Get

  • Autonomous Research Pipeline - A planner agent generates research sub-queries from your topic, executor agents independently scrape and summarize each source, and a publisher agent aggregates all findings into a single factual report with inline citations — no manual intervention required.
  • Deep Research Mode - A recursive tree-exploration workflow fans out into subtopics with configurable depth and breadth parameters, spending approximately five minutes per session to produce comprehensive coverage that rivals a professional research brief.
  • MCP Data Source Integration - Connect to GitHub repositories, SQL databases, and custom APIs alongside standard web search via Model Context Protocol, enabling hybrid research that combines internal data sources with public web information in the same report.
  • Local Document Research - Point the agent at a local directory of PDFs, Word documents, Excel spreadsheets, CSVs, Markdown files, and PowerPoint presentations to conduct research entirely from your own document corpus, with the same citation-tracking machinery.
  • AI-Generated Inline Images - Automatically generate and embed contextually relevant infographic illustrations in reports using Google Gemini’s image generation models, with dark-mode teal styling that matches the application UI.
  • Multi-Format Export - Export completed reports as PDF (via WeasyPrint), Microsoft Word (.docx), Markdown, JSON, and CSV for direct use in presentations, publications, or downstream data pipelines.
  • Real-Time Streaming Interface - A WebSocket layer streams research progress logs, source discovery events, and partial report drafts to the frontend in real time, giving visibility into the agent’s reasoning as it works.
  • Pluggable LLM and Retriever Backends - Configure any of 25+ LLM providers (OpenAI, Anthropic, Groq, Ollama, Mistral, Cohere, Google Gemini, Fireworks, Together AI, xAI, DeepSeek, LiteLLM, and more) and 16+ retriever engines (Tavily, Bing, Google, DuckDuckGo, Exa, arXiv, PubMed, Semantic Scholar, and more) via environment variables, with no code changes required.

Common Use Cases

  • Competitive Intelligence Analysts - Configure GPT Researcher with domain filters pointing to competitor websites and industry news sources, generate weekly deep-research reports on market movements, and export to Word for distribution to leadership teams.
  • Academic Researchers - Use the local document research mode to synthesize a corpus of PDFs and exported academic papers into a literature review draft, then validate citations against the original sources before incorporating into a manuscript.
  • AI Agent Developers - Embed GPT Researcher as the research skill within a larger LangGraph or AG2 multi-agent system, calling researcher.conduct_research() and researcher.write_report() asynchronously from a supervisor agent to handle any information-gathering subtask.
  • Investigative Journalists - Trigger a deep research run on a breaking story topic, letting the agent aggregate sources from news sites, government documents, and social media within five minutes, then use the citation-backed draft as the research brief for a follow-up article.
  • Enterprise Knowledge Workers - Combine the MCP GitHub integration with web search to research unfamiliar codebases or technical standards, producing reports that reference both public documentation and internal repository content simultaneously.
  • Developer Tool Builders - Expose the GPT Researcher MCP Server (gptr-mcp) to Claude or other AI assistants, allowing the assistant to trigger deep research runs as a tool call and receive structured, cited results directly in the conversation.

Under The Hood

Architecture GPT Researcher implements a three-layer agent architecture consisting of planner, executor, and publisher components that separates concerns cleanly and enables horizontal parallelism. The planner LLM generates a set of targeted sub-queries from the user’s research task; independent executor agents each handle one sub-query by calling a retriever, scraping the returned URLs, and summarizing findings into context chunks; the publisher agent then applies RAG over all accumulated context to synthesize a final report. A top-level GPTResearcher class acts as the orchestration root, composing skills via constructor injection — ResearchConductor, ContextManager, SourceCurator, ReportGenerator, DeepResearchSkill, ImageGenerator, and BrowserManager — keeping each skill independently testable. The deep research mode wraps this pipeline in a LangGraph state machine that performs recursive tree exploration, branching into configurable depth and breadth of subtopics with automatic context management and JSON-repair for resilient LLM output parsing.

Tech Stack The backend is Python 3.11+ powered by FastAPI and Uvicorn, with LangChain and LangGraph as the agent orchestration layer across all LLM providers. Dependencies are managed by Poetry with a comprehensive pyproject.toml specifying over 100 pinned packages. The MCP layer uses the official mcp SDK with langchain-mcp-adapters for protocol bridging. Headless web scraping uses a mix of BeautifulSoup4, PyMuPDF, nodriver (a Chromium-based async scraper), and configurable backends including Playwright, Selenium, Scrapy, and Firecrawl. The frontend ships in two forms: a plain HTML/CSS/JS single-page interface and a production-ready Next.js plus Tailwind CSS application communicating over REST and WebSocket. Infrastructure is Docker Compose with separate services for the Python backend, Next.js frontend, and a test runner, with shared volume mounts for document input and report output.

Code Quality The codebase has comprehensive test coverage with dedicated test files for agent discovery, cost tracking, deep research parsing, LLM token limits, LLM usage tracking, logging, MCP integration, multi-agent plan revisions, quick search, research conductor retrieval, security, and WebSocket management — roughly 20 test modules in total. All major classes carry Google-style docstrings with explicit Args and Attributes sections, and core modules include module-level documentation strings. Error handling is explicit throughout, with bare-except clauses recently replaced by typed except-Exception catches as part of active maintenance. The project enforces asyncio_mode strict in pytest configuration, requiring correct async fixture patterns. Loguru provides structured logging with both file output and WebSocket streaming for real-time diagnostics.

What Makes It Unique GPT Researcher’s primary differentiator is the combination of parallel multi-agent execution with recursive deep research in a single, self-contained Python package. Most LLM research tools query a single search API and summarize the top results; GPT Researcher dispatches independent executor agents per sub-query, applies context compression with URL deduplication to avoid redundant scraping, and optionally recurses into a configurable-depth subtopic tree — capabilities borrowed from academic Plan-and-Solve and RAG papers. The MCP client integration is architecturally notable: rather than treating MCP as an output channel, GPT Researcher uses it as an input retriever, placing GitHub repositories and databases on equal footing with web search engines in the research pipeline. The agent discovery endpoint also positions GPT Researcher as a first-class AI agent service that other agents can discover and call programmatically, reflecting a deliberate design for the multi-agent ecosystem.

Self-Hosting

GPT Researcher is released under the Apache License 2.0, a permissive open-source license that allows unrestricted commercial use, modification, distribution, and private use without requiring derivative works to be open-sourced. The sole obligations are preserving copyright notices and the license file when distributing the software. There are no copyleft implications for self-hosters: you can run a modified version internally, integrate it into a proprietary product, or offer it as a service without any obligation to publish your changes.

Running GPT Researcher yourself requires Python 3.11+ and a non-trivial set of API credentials: at minimum an LLM provider API key (OpenAI is the default) and a web search retriever key (Tavily is the default, though DuckDuckGo works without a key). For document processing at scale, Chromium or Geckodriver is needed for JavaScript-enabled scraping, and WeasyPrint must be installed for PDF export. Docker Compose is the recommended deployment path and handles service orchestration cleanly, but you are responsible for secrets management, uptime monitoring, dependency updates, and scaling the FastAPI backend under concurrent research requests. Because each research session can make dozens of LLM and search API calls, operational costs are variable and tied directly to your API usage.

There is no official managed or SaaS tier for GPT Researcher itself, though gptr.dev hosts documentation and a demo. The hosted MCP server is maintained as a separate repository (gptr-mcp) with its own deployment lifecycle. Self-hosters give up the convenience of a zero-ops deployment and must manage their own LangSmith or logging setup for observability. In exchange, they get full control over which LLM provider and model they use, including local Ollama models for air-gapped environments, the ability to restrict research to internal document stores, and no per-seat or per-query pricing beyond their chosen API providers.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack

No spam. Unsubscribe anytime.

Join 750+ subscribers
No spam. Unsubscribe anytime.

Search