GPT Researcher: Self-Hosted AI Deep Research Agent

Generate cited research reports from websites and local files with your choice of AI models and control over the depth of research.

GPT Researcher is an open-source AI deep research agent that turns a question into a detailed report with citations. It gathers information from the web, your own documents, or both.

The agent breaks a research question into smaller investigations and runs them in parallel. In deep research mode, it uses early findings to pursue new questions.

GPT Researcher runs on your own computer or server with cloud or local AI models. You decide how deeply it explores a subject.

Key Features

  • Investigate related questions in parallel and follow new leads automatically.
  • Generate focused briefings, detailed reports with multiple sections, or in-depth investigations.
  • Research websites, academic papers, local documents, and external data through the Model Context Protocol (MCP).
  • Track research progress, explore sources, and ask follow-up questions in the web app.
  • Customize reports by language, tone, citation style, and length.
  • Download reports in PDF, Word, or Markdown format.
  • Choose cloud or local AI models and your preferred search provider.
  • Integrate the research engine into your own applications.

How GPT Researcher Works

Suppose you want to find the best ways to reduce the cost of running large language models in production. GPT Researcher could break your question into topics such as model selection, prompt caching, batch processing, and local inference.

The research agents investigate these topics at the same time. They search for relevant information, open web pages, and collect useful passages. GPT Researcher filters the collected material so the writing model receives the information most relevant to the question.

The agent brings the findings together in a report with inline citations and a reference list. Follow the citations to examine the evidence behind a recommendation or conclusion.

Three research modes

The report type determines how GPT Researcher approaches your question:

Report typeHow it worksBest for
Research reportInvestigates a question and compiles the findings into one report.Quick research and focused briefings
Detailed reportPlans a report outline and researches each section.Market analysis and technical comparisons
Deep researchGenerates new questions based on earlier findings and investigates them in successive rounds.Open-ended questions where early findings lead to new questions

The breadth and depth settings control the scope of a deep research task. Breadth determines how many paths the agent explores at each level, and depth determines how far it follows those paths.

In the LLM cost example, a branch on prompt caching might examine which providers offer it, how they charge for cached tokens, and which workloads benefit most.

An optional multi-agent workflow assigns agents to research individual sections, review drafts, and revise them. You can approve or revise the outline before the agents begin researching each section.

Research the web and your own documents

GPT Researcher works with search providers such as Tavily, Brave Search, Google, Bing, Exa, and DuckDuckGo. Options for finding academic papers include arXiv, OpenAlex, Semantic Scholar, and PubMed Central.

Provide a list of URLs to research specific websites or use documents from your computer as sources. The agent reads PDF, Word, PowerPoint, Excel, CSV, Markdown, and plain text files.

Hybrid research combines your documents with online information. For example, a market analysis might draw on your company’s product specifications and competitors’ current features and pricing.

Customize, review, and export reports

Set the report’s language, tone, target length, and citation style to match the type of work you’re doing. For example, use APA citations for a literature review or set a shorter report length for an executive briefing.

The web app displays research progress and links to the sources. Once the report is ready, ask follow-up questions in the chat panel.

You can then export the report as a PDF to share, a Word document to edit, or Markdown to add to a knowledge base.

How to Install and Use GPT Researcher

The project offers a web app, a command-line tool, and a Python package. Start with the web app if you want to enter research questions and read reports in your browser.

The default setup uses OpenAI for AI models and Tavily for web search. You’ll need API keys from the OpenAI API platform and Tavily.

Clone the repository with Git:

git clone https://github.com/assafelovic/gpt-researcher.git
cd gpt-researcher

Create a file named .env in the project folder and add your keys:

OPENAI_API_KEY=your_openai_api_key
TAVILY_API_KEY=your_tavily_api_key

Run with Docker

Open a terminal in the project folder and run:

docker compose up --build

Once the services start, open http://localhost:3000 in your browser. Enter a research question, select a report type, and start the investigation.

The app displays research progress and makes the finished report available for download.

Run directly with Python

For a lightweight web UI or command-line research, install Python and create a virtual environment in the project:

python -m venv .venv

Activate it with source .venv/bin/activate on macOS or Linux, or .\.venv\Scripts\Activate.ps1 in Windows PowerShell.

Insert API keys into your .env file, install the dependencies, and start the web server:

python -m pip install -r requirements.txt
python -m uvicorn main:app --reload

Visit http://localhost:8000 to run your first research task. To research your own files, place them in the project’s my-docs folder, add DOC_PATH=./my-docs to .env, and select My Documents as the report source.

For command-line research, run the following command in the project folder with the same Python environment active:

python cli.py "How do vector databases handle hybrid search?" --report_type research_report

Find the generated Markdown report in the outputs folder.

Use Local or Cloud AI Models

Choose models from providers such as OpenAI, Anthropic, Google, and Mistral, or run local models through Ollama. You’re allowed to assign different models to research planning and report writing to balance quality and cost.

To use a local model with the direct Python installation above, install Ollama, start it, and download a model.

For example, use Llama 3 and install the Ollama integration in your Python environment:

ollama pull llama3
python -m pip install langchain-ollama

Replace the default cloud configuration in .env with these settings:

OLLAMA_BASE_URL=http://localhost:11434
FAST_LLM=ollama:llama3
SMART_LLM=ollama:llama3
STRATEGIC_LLM=ollama:llama3
CONTEXT_FILTER=keyword
RETRIEVER=duckduckgo

Restart the Python web server to run research with your local model and DuckDuckGo.

Cloud models receive relevant excerpts from your documents during research. For confidential files, use the local model and keyword filter with My Documents selected. Leave external MCP connections and cloud image generation disabled.

Integrate GPT Researcher into Your Own Apps

Use the Python package to automate recurring research, such as a weekly briefing on new AI tools, or add cited reports to an existing application.

Install GPT Researcher and store your OpenAI and Tavily API keys in a .env file next to your script.

python -m pip install gpt-researcher

Save the following code as research.py:

import asyncio
from pathlib import Path
from dotenv import load_dotenv
from gpt_researcher import GPTResearcher
load_dotenv()
async def main():
    researcher = GPTResearcher(
        query="How does prompt caching reduce LLM API costs?",
        report_type="research_report",
    )
    await researcher.conduct_research()
    report = await researcher.write_report()
    Path("report.md").write_text(report, encoding="utf-8")
if __name__ == "__main__":
    asyncio.run(main())

Run python research.py from the script’s folder. The agent saves the report as report.md. Change report_type to deep for a recursive investigation.

To build a JavaScript research UI, use the npm package to send research requests to a running GPT Researcher backend and receive progress updates.

Connect MCP servers to bring information from GitHub repositories, private databases, and other sources into your research. The GPT Researcher MCP server also enables other AI assistants to request and receive research reports within their own workflows.

Is GPT Researcher Free?

GPT Researcher is free to download, self-host, and modify. The GitHub project uses the Apache 2.0 license. Running costs depend on your choice of AI models and search services.

The project’s November 2026 benchmarks used the default OpenAI models and Tavily search. Here’s what a typical report cost in those tests, including the estimated pay-as-you-go search fees:

Report typeAI model costTotal with paid searchSample run time
Research report$0.08$0.12About 1 minute
Detailed report$0.34$0.482–2.5 minutes
Deep research$1.30$1.677–12 minutes

Tavily offers 1,000 free credits per month. Basic searches use one credit each, and pay-as-you-go costs $0.008 per credit.

For ordinary reports, a less expensive writing model or a shorter report can reduce costs. For deep research, reducing the number of research paths or levels has a greater impact.

Frequently Asked Questions

Do I need a ChatGPT subscription to use GPT Researcher?

No. OpenAI API usage is billed independently of a ChatGPT subscription. GPT Researcher also works with other model providers and local models.

Can I limit the research to specific websites?

Yes. In Python, pass your list of URLs as source_urls when creating a GPTResearcher instance. Set complement_source_urls=False to use only those websites, or True to let the agent search for additional sources.

Is GPT Researcher an alternative to Perplexity or ChatGPT Deep Research?

Yes. GPT Researcher is a self-hosted alternative for generating research reports with citations. You control the research engine, models, and data sources, including your own files. Perplexity and ChatGPT Deep Research run as managed services.

Alternatives & Related Resources

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the latest & top AI tools sent directly to your email.

Subscribe now to explore the latest & top AI tools and resources, all in one convenient newsletter. No spam, we promise!