# GPT Researcher

> Autonomous research agent that writes long, cited reports from web and local sources

- Category: Agents & Automation / Agent Frameworks & Builders
- Language: Python
- Licence: Apache-2.0
- Repository: https://github.com/assafelovic/gpt-researcher
- Website: https://gptr.dev
- Canonical page: https://ai-tldr.dev/tools/gpt-researcher/

## In short

GPT Researcher is an open-source autonomous agent designed to conduct in-depth research on any topic, then return a long-form report with citations. It sits in the Agent Frameworks & Builders category of the Agents & Automation tools and is open-source, written in Python and licensed Apache-2.0. To get started: install the package.

## Overview

GPT Researcher is an open-source autonomous agent designed to conduct in-depth research on any topic, then return a long-form report with citations. Instead of asking the LLM to answer from memory, it plans the research, scrapes and reads a set of sources, and synthesises them into a structured document — addressing common LLM problems like outdated training data and hallucinated facts.

Under the hood the agent runs multiple sub-agents in parallel to speed up gathering and improve coverage. It can pull from the open web (with JavaScript-enabled scraping and image filtering) and from local documents in formats like PDF, DOCX, CSV, Markdown and PowerPoint, and exports the final report to PDF, Word or Markdown. A Deep Research mode explores a topic as a tree of sub-questions, and an MCP integration lets the agent reach domain-specific data sources.

GPT Researcher works with hosted models such as OpenAI and Google Gemini, but also with local runtimes via Ollama, so the same agent loop can run end-to-end on a developer machine. The project ships with both a lightweight HTML/CSS/JS frontend and a production-grade Next.js frontend on top of the Python core.

## What it does

- Plans the research, fans out parallel sub-agents, and aggregates 20+ sources per task
- Generates 2,000+ word reports with inline citations and exports to PDF, DOCX or Markdown
- Reads local files: PDF, text, CSV, Excel, Markdown, PowerPoint and Word
- JavaScript-enabled web scraping with smart image filtering
- Deep Research mode that recursively explores a topic as a tree of sub-questions
- Works with OpenAI, Google Gemini, Ollama and other LLM providers via a pluggable config

## Getting started

Install the Python package, set the LLM and search API keys it needs, then call the GPTResearcher class to plan, research and write a report.

1. Install the package

   Available on PyPI as gpt-researcher.

```bash
pip install gpt-researcher
```

2. Configure your API keys

   Export the model and search provider keys the agent should use (the README walks through each provider).

```bash
export OPENAI_API_KEY=sk-...
export TAVILY_API_KEY=tvly-...
```

3. Run a research task

   Instantiate GPTResearcher with a query, call conduct_research to gather sources, then write_report to produce the final document.

```python
import asyncio
from gpt_researcher import GPTResearcher

async def main():
    researcher = GPTResearcher(query="State of small language models in 2026")
    await researcher.conduct_research()
    report = await researcher.write_report()
    print(report)

asyncio.run(main())
```

## When to use it

- Generate a long, cited report on a fast-moving topic (markets, technology, policy) instead of getting a paragraph from a chatbot
- Run research over your own corpus of PDFs and spreadsheets without sending them to a third-party service
- Stand up a self-hosted research assistant for a team using local models via Ollama
- Use Deep Research mode to map out an unfamiliar field as a tree of sub-questions before deciding what to read
