gpt-researcher

GPT Researcher Development Skill

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "gpt-researcher" with this command: npx skills add assafelovic/gpt-researcher/assafelovic-gpt-researcher-gpt-researcher

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

Need Primary File Key Classes

Main orchestrator gpt_researcher/agent.py

GPTResearcher

Research logic gpt_researcher/skills/researcher.py

ResearchConductor

Report writing gpt_researcher/skills/writer.py

ReportGenerator

All prompts gpt_researcher/prompts.py

PromptFamily

Configuration gpt_researcher/config/config.py

Config

Config defaults gpt_researcher/config/variables/default.py

DEFAULT_CONFIG

API server backend/server/app.py

FastAPI app

Search engines gpt_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)

  • Config → Add to gpt_researcher/config/variables/default.py

  • Provider → Create in gpt_researcher/llm_provider/my_feature/

  • Skill → Create in gpt_researcher/skills/my_feature.py

  • Agent → Integrate in gpt_researcher/agent.py

  • Prompts → Update gpt_researcher/prompts.py

  • WebSocket → Events via stream_output()

  • Frontend → Handle events in useWebSocket.ts

  • 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_VAR

config.my_var (lowercased)

Editing pip-installed package pip install -e .

Forgetting async/await All research methods are async

websocket.send_json() on None Check if websocket: first

Not registering retriever Add to retriever.py match statement

Reference Documentation

Topic File

System architecture & diagrams references/architecture.md

Core components & signatures references/components.md

Research flow & data flow references/flows.md

Prompt system references/prompts.md

Retriever system references/retrievers.md

MCP integration references/mcp.md

Deep research mode references/deep-research.md

Multi-agent system references/multi-agents.md

Adding features guide references/adding-features.md

Advanced patterns references/advanced-patterns.md

REST & WebSocket API references/api-reference.md

Configuration variables references/config-reference.md

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

arxiv-paper-writer

Use this skill whenever the user wants Claude Code to write, scaffold, compile, debug, or review an arXiv-style academic paper, especially survey papers with LaTeX, BibTeX citations, TikZ figures, tables, and PDF output. This skill should trigger for requests like writing a full paper, creating an arXiv paper project, turning a research topic into a LaTeX manuscript, reproducing the Paper-Write-Skill-Test agent-survey workflow, or setting up a Windows/Linux Claude Code paper-writing loop.

Archived SourceRecently Updated
Coding

cli-proxy-troubleshooting

排查 CLI Proxy API(codex-api-proxy)的配置、认证、模型注册和请求问题。适用场景包括:(1) AI 请求报错 unknown provider for model, (2) 模型列表中缺少预期模型, (3) codex-api-key/auth-dir 配置不生效, (4) CLI Proxy 启动后 AI 无法调用, (5) 认证成功但请求失败或超时。包含源码级排查方法:模型注册表架构、认证加载链路、 SanitizeCodexKeys 规则、常见错误的真实根因。

Archived SourceRecently Updated
Coding

visual-summary-analysis

Performs AI analysis on input video clips/image content and generates a smooth, natural scene description. | 视觉摘要智述技能,对传入的视频片段/图片内容进行AI分析,生成一段通顺自然的场景描述内容

Archived SourceRecently Updated
Coding

frontend-skill

全能高级前端研发工程师技能。擅长AI时代前沿技术栈(React最新 + shadcn/ui + Tailwind CSS v4 + TypeScript + Next.js),精通动效库与交互特效开发。采用Glue Code风格快速实现代码,强调高质量产品体验与高度友好的UI视觉规范。在组件调用、交互特效、全局Theme上保持高度规范:绝不重复造轮子,相同逻辑出现两次即封装为组件。具备安全意识,防范各类注入攻击。开发页面具有高度自适应能力,响应式设计贯穿始终。当用户无特殊技术栈要求时,默认采用主流前沿技术栈。

Archived SourceRecently Updated