New to Claude Skills? Learn how to install them →

assafelovic on GitHub

GPT Researcher

Free

An autonomous agent for deep research and reporting.

Get this skill

Free · Opens the source repo

What GPT Researcher does

GPT Researcher is an advanced autonomous agent designed for conducting extensive web and local research. It utilizes a planner-executor-publisher pattern, allowing it to process multiple sub-queries in parallel for enhanced speed and reliability. This makes it particularly useful for developers and researchers who need to gather detailed information quickly and efficiently. The agent can generate various types of reports, including research reports, detailed reports, and outline reports, tailored to the user's needs.

The core functionality revolves around the GPTResearcher class, which orchestrates the research process. Users can initiate a research query, specify the type of report they need, and choose the source of information, whether web-based, local, or a hybrid approach. The agent's ability to aggregate data and produce well-cited reports makes it an invaluable tool for anyone looking to deepen their understanding of complex topics.

For developers integrating this skill, the provided architecture and configuration details are crucial. The skill allows for significant customization, including adding new features or retrievers, which can be done by following the documented patterns. This flexibility ensures that the tool can evolve alongside the user's research needs, making it suitable for a range of applications from academic research to practical software development tasks.

In summary, GPT Researcher empowers users to automate and streamline their research processes, producing comprehensive reports that can aid in decision-making, development, and further exploration of topics. Its structured approach to research and reporting positions it as a must-have tool for developers and researchers alike.

When to use it

Use GPT Researcher when you need to conduct thorough research and generate structured reports quickly.

When not to use it

This skill may not be suitable for simple queries or when real-time interaction is required, as it focuses on generating reports rather than providing immediate answers.

What you can build with it

Conducting Academic Research

Use GPT Researcher to automate the process of gathering literature and generating comprehensive reports for academic papers.

Integrating with Development Projects

Leverage GPT Researcher to assist in understanding and documenting complex software systems by generating detailed reports.

Customizing Research Workflows

Developers can use GPT Researcher to create tailored research workflows that integrate specific data sources and reporting formats.

How to install GPT Researcher

View source

1. Install with the skills CLI

npx skills add assafelovic/gpt-researcher/.claude --agent claude-code

2. Or install it manually

Download the skill folder and drop it into ~/.claude/skills/ for all projects, or .claude/skills/ to scope it to one repo. Restart Claude Code so it picks up the new skill.

Anthropic's agentic coding CLI, and the reference implementation of Agent Skills. Drop a skill folder into ~/.claude/skills and Claude Code loads it automatically whenever a task matches the skill's description. Claude Code docs

Inside SKILL.md

Written by assafelovic

GPT Researcher Development Skill

GPT Researcher is an LLM-based autonomous agent using a planner-executor-publisher pattern with parallelized agent work for speed and reliability.

Quick Start

Basic Python Usage

from gpt_researcher import GPTResearcher
import asyncio

async def main():
    researcher = GPTResearcher(
        query="What are the latest AI developments?",
        report_type="research_report",  # or detailed_report, deep, outline_report
        report_source="web",            # or local, hybrid
    )
    await researcher.conduct_research()
    report = await researcher.write_report()
    print(report)

asyncio.run(main())

Run Servers

# Backend
python -m uvicorn backend.server.server:app --reload --port 8000

# Frontend
cd frontend/nextjs && npm install && npm run dev

Key File Locations

NeedPrimary FileKey Classes
Main orchestratorgpt_researcher/agent.pyGPTResearcher
Research logicgpt_researcher/skills/researcher.pyResearchConductor
Report writinggpt_researcher/skills/writer.pyReportGenerator
All promptsgpt_researcher/prompts.pyPromptFamily
Configurationgpt_researcher/config/config.pyConfig
Config defaultsgpt_researcher/config/variables/default.pyDEFAULT_CONFIG
API serverbackend/server/app.pyFastAPI app
Search enginesgpt_researcher/retrievers/Various retrievers

Architecture Overview

User Query → GPTResearcher.__init__()
                │
                ▼
         choose_agent() → (agent_type, role_prompt)
                │
                ▼
         ResearchConductor.conduct_research()
           ├── plan_research() → sub_queries
           ├── For each sub_query:
           │     └── _process_sub_query() → context
           └── Aggregate contexts
                │
                ▼
         [Optional] ImageGenerator.plan_and_generate_images()
                │
                ▼
         ReportGenerator.write_report() → Markdown report

For detailed architecture diagrams: See references/architecture.md


Core Patterns

Adding a New Feature (8-Step Pattern)

  1. Config → Add to gpt_researcher/config/variables/default.py
  2. Provider → Create in gpt_researcher/llm_provider/my_feature/
  3. Skill → Create in gpt_researcher/skills/my_feature.py
  4. Agent → Integrate in gpt_researcher/agent.py
  5. Prompts → Update gpt_researcher/prompts.py
  6. WebSocket → Events via stream_output()
  7. Frontend → Handle events in useWebSocket.ts
  8. Docs → Create docs/docs/gpt-researcher/gptr/my_feature.md

For complete feature addition guide with Image Generation case study: See references/adding-features.md

Adding a New Retriever

# 1. Create: gpt_researcher/retrievers/my_retriever/my_retriever.py
class MyRetriever:
    def __init__(self, query: str, headers: dict = None):
        self.query = query
    
    async def search(self, max_results: int = 10) -> list[dict]:
        # Return: [{"title": str, "href": str, "body": str}]
        pass

# 2. Register in gpt_researcher/actions/retriever.py
case "my_retriever":
    from gpt_researcher.retrievers.my_retriever import MyRetriever
    return MyRetriever

# 3. Export in gpt_researcher/retrievers/__init__.py

For complete retriever documentation: See references/retrievers.md


Configuration

Config keys are lowercased when accessed:

# In default.py: "SMART_LLM": "gpt-4o"
# Access as: self.cfg.smart_llm  # lowercase!

Priority: Environment Variables → JSON Config File → Default Values

For complete configuration reference: See references/config-reference.md


Common Integration Points

WebSocket Streaming

class WebSocketHandler:
    async def send_json(self, data):
        print(f"[{data['type']}] {data.get('output', '')}")

researcher = GPTResearcher(query="...", websocket=WebSocketHandler())

MCP Data Sources

researcher = GPTResearcher(
    query="Open source AI projects",
    mcp_configs=[{
        "name": "github",
        "command": "npx",
        "args": ["-y", "@modelcontextprotocol/server-github"],
        "env": {"GITHUB_TOKEN": os.getenv("GITHUB_TOKEN")}
    }],
    mcp_strategy="deep",  # or "fast", "disabled"
)

For MCP integration details: See references/mcp.md

Deep Research Mode

researcher = GPTResearcher(
    query="Comprehensive analysis of quantum computing",
    report_type="deep",  # Triggers recursive tree-like exploration
)

For deep research configuration: See references/deep-research.md


Error Handling

Always use graceful degradation in skills:

async def execute(self, ...):
    if not self.is_enabled():
        return []  # Don't crash
    
    try:
        result = await self.provider.execute(...)
        return result
    except Exception as e:
        await stream_output("logs", "error", f"⚠️ {e}", self.websocket)
        return []  # Graceful degradation

Critical Gotchas

❌ Mistake✅ Correct
config.MY_VARconfig.my_var (lowercased)
Editing pip-installed packagepip install -e .
Forgetting async/awaitAll research methods are async
websocket.send_json() on NoneCheck if websocket: first
Not registering retrieverAdd to retriever.py match statement

Reference Documentation

TopicFile
System architecture & diagramsreferences/architecture.md
Core components & signaturesreferences/components.md
Research flow & data flowreferences/flows.md
Prompt systemreferences/prompts.md
Retriever systemreferences/retrievers.md
MCP integrationreferences/mcp.md
Deep research modereferences/deep-research.md
Multi-agent systemreferences/multi-agents.md
Adding features guidereferences/adding-features.md
Advanced patternsreferences/advanced-patterns.md
REST & WebSocket APIreferences/api-reference.md
Configuration variablesreferences/config-reference.md

Frequently asked questions about GPT Researcher

Similar skills