Autonomous research agent that breaks questions into parallel sub-queries, searches each independently, and synthesizes a cited report.
Before you start
Python 3.11+ and pip. API keys for your chosen LLM provider (OpenAI, Anthropic, etc.) and a web search provider (Tavily recommended). Run pip install gpt-researcher to install.
Install via pip and set your API keys as environment variables. GPT-Researcher uses a .env file by default. Copy the sample from the repo and fill in your keys. Tavily provides the best search quality for research tasks; the free tier covers initial testing.
Pass a research question and a report type. RESEARCH_REPORT is the standard full report with citations. DETAILED_REPORT produces a longer, more comprehensive output. SUBTOPIC_REPORT covers a narrow aspect in depth. Start with RESEARCH_REPORT and a question you know well so you can evaluate accuracy.
Set DOC_PATH in your .env to point to a folder of local documents. GPT-Researcher will search only those files instead of the web, useful for internal docs, research papers, or any corpus you cannot send to a search API.
GPT-Researcher ships a FastAPI server for integration into pipelines. Start the server with `python -m gptr`, then POST your query to the endpoint. The API returns the same report types as the Python library, making it easy to call from any language.
Write the report to a markdown file and reference it in subsequent Claude sessions. A report with citations is a first-class context artifact. Pass it to Claude Code alongside your task to ground its answers in real sources.
Key GPT-Researcher commands, report types, and configuration options.
| Command / Skill | What it does | When to use it |
|---|---|---|
python -m gptr | Start the FastAPI REST server for pipeline and multi-language integration | Integrating GPT-Researcher into a larger pipeline or calling from a non-Python service |
--query | The research question, passed as the first argument or query param | Every research run, be specific about domain, constraints, and what you want to compare |
--report_type | Controls report format: research_report, detailed_report, or subtopic_report | Choose based on depth needed: research_report for broad summaries, detailed_report for deep dives |
RESEARCH_REPORT | Standard output: multi-section report with cited sources, covering the question from multiple angles | Default choice for most research tasks, balanced depth and breadth |
DETAILED_REPORTadvanced | Extended report with deeper sub-topic coverage and more citations | Complex questions where you need exhaustive coverage before making a decision |
SUBTOPIC_REPORTadvanced | Narrow focused report on a specific aspect of a broader topic | Follow-up research on a specific claim or aspect from a prior RESEARCH_REPORT |
DOC_PATH (local docs mode)advanced | Set in .env to point at a folder, GPT-Researcher searches only those documents | Private corpora, internal docs, research papers, or any content you cannot send to a web search API |