SSkilltecabyclaudinhocode
Enviar skill
← Voltar para o catálogo

deep-research

Pesquisa e Web

Async deep research via Gemini Interactions API (no Gemini CLI dependency). RAG-ground queries on local files (--context), preview costs (--dry-run), structured JSON output, adaptive polling. Universal skill for 30+ AI agents including Claude Code, Amp, Codex, and Gemini CLI.

4estrelas
Ver no GitHub ↗Autor: 24601Licença: MIT

Deep Research Skill

Perform deep research powered by Google Gemini's deep research agent. Upload documents to file search stores for RAG-grounded answers. Manage research sessions with persistent workspace state.

For AI Agents

Get a full capabilities manifest, decision trees, and output contracts:

uv run {baseDir}/scripts/onboard.py --agent

See AGENTS.md for the complete structured briefing.

CommandWhat It Does
uv run {baseDir}/scripts/research.py start "question"Launch deep research
uv run {baseDir}/scripts/research.py start "question" --context ./path --dry-runEstimate cost
uv run {baseDir}/scripts/research.py start "question" --context ./path --output report.mdRAG-grounded research
uv run {baseDir}/scripts/store.py query <name> "question"Quick Q&A against uploaded docs

Security & Transparency

Credentials: This skill requires a Google/Gemini API key (one of GOOGLE_API_KEY, GEMINI_API_KEY, or GEMINI_DEEP_RESEARCH_API_KEY). The key is read from environment variables and passed to the google-genai SDK. It is never logged, written to files, or transmitted anywhere other than the Google Gemini API.

File uploads: The --context flag uploads local files to Google's ephemeral file search stores for RAG grounding. Sensitive files are automatically excluded: .env*, credentials.json, secrets.*, private keys (.pem, .key), and auth tokens (.npmrc, .pypirc, .netrc). Binary files are rejected by MIME type filtering. Build directories (node_modules, __pycache__, .git, dist, build) are skipped. The ephemeral store is auto-deleted after research completes unless --keep-context is specified. Use --dry-run to preview what would be uploaded without sending anything. Only files you explicitly point --context at are uploaded -- no automatic scanning of parent directories or home folders.

Non-interactive mode: When stdin is not a TTY (agent/CI use), confirmation prompts are automatically skipped. This is by design for agent integration but means an autonomous agent with file system access could trigger uploads. Restrict the paths agents can access, or use --dry-run and --max-cost guards.

No obfuscation: All code is readable Python with PEP 723 inline metadata. No binary blobs, no minified scripts, no telemetry, no analytics. The full source is auditable at github.com/24601/agent-deep-research.

Local state: Research session state is written to .gemini-research.json in the working directory. This file contains interaction IDs, store mappings, and upload hashes -- no credentials or research content. Use state.py gc to clean up orphaned stores from crashed runs.

Prerequisites

  • A Google API key (GOOGLE_API_KEY or GEMINI_API_KEY environment variable)
  • uv installed (see uv install docs)

Quick Start

# Run a deep research query
uv run {baseDir}/scripts/research.py "What are the latest advances in quantum computing?"

# Check research status
uv run {baseDir}/scripts/research.py status <interaction-id>

# Save a completed report
uv run {baseDir}/scripts/research.py report <interaction-id> --output report.md

# Research grounded in local files (auto-creates store, uploads, cleans up)
uv run {baseDir}/scripts/research.py start "How does auth work?" --context ./src --output report.md

# Export as HTML or PDF
uv run {baseDir}/scripts/research.py start "Analyze the API" --context ./src --format html --output report.html

# Auto-detect prompt template based on context files
uv run {baseDir}/scripts/research.py start "How does auth work?" --context ./src --prompt-template auto --output report.md

Environment Variables

Set one of the following (checked in order of priority):

VariableDescription
GEMINI_DEEP_RESEARCH_API_KEYDedicated key for this skill (highest priority)
GOOGLE_API_KEYStandard Google AI key
GEMINI_API_KEYGemini-specific key

Optional model configuration:

VariableDescriptionDefault
GEMINI_DEEP_RESEARCH_MODELModel for file search queriesgemini-3.1-pro-preview
GEMINI_MODELFallback model namegemini-3.1-pro-preview
GEMINI_DEEP_RESEARCH_AGENTDeep research agent identifierdeep-research-pro-preview-12-2025

Research Commands

Start Research

uv run {baseDir}/scripts/research.py start "your research question"
FlagDescription
--report-format FORMATOutput structure: executive_summary, detailed_report, comprehensive
--store STORE_NAMEGround research in a file search store (display name or resource ID)
--no-thoughtsHide intermediate thinking steps
--follow-up IDContinue a previous research session
--output FILEWait for completion and save report to a single file
--output-dir DIRWait for completion and save structured results to a directory (see below)
--timeout SECONDSMaximum wait time when polling (default: 1800 = 30 minutes)
--no-adaptive-pollDisable history-adaptive polling; use fixed interval curve instead
--context PATHAuto-create ephemeral store from a file or directory for RAG-grounded research
--context-extensions EXTFilter context uploads by extension (e.g. py,md or .py .md)
--keep-contextKeep the ephemeral context store after research completes (default: auto-delete)
--dry-runEstimate costs without starting research (prints JSON cost estimate)
--format {md,html,pdf}Output format for the report (default: md; pdf requires weasyprint)
--prompt-template {typescript,python,general,auto}Domain-specific prompt prefix; auto detects from context file extensions
--depth {quick,standard,deep}Research depth: quick (~2-5min), standard (~5-15min), deep (~15-45min)
--max-cost USDAbort if estimated cost exceeds this limit (e.g. --max-cost 3.00)
--input-file PATHRead the research query from a file instead of positional argument
--no-cacheSkip research cache and force a fresh run

The start subcommand is the default, so research.py "question" and research.py start "question" are equivalent.

Important: When --output or --output-dir is used, the command blocks until research completes (2-10+ minutes). Do not background it with &. Use non-blocking mode (omit --output) to get an ID immediately, then poll with status and save with report.

Check Status

uv run {baseDir}/scripts/research.py status <interaction-id>

Returns the current status (in_progress, completed, failed) and outputs if available.

Save Report

uv run {baseDir}/scripts/research.py report <interaction-id>
FlagDescription
--output FILESave report to a specific file path (default: report-<id>.md)
--output-dir DIRSave structured results to a directory

Structured Output (--output-dir)

When --output-dir is used, results are saved to a structured directory:

<output-dir>/
  research-<id>/
    report.md          # Full final report
    metadata.json      # Timing, status, output count, sizes
    interaction.json   # Full interaction data (all outputs, thinking steps)
    sources.json       # Extracted source URLs/citations

A compact JSON summary (under 500 chars) is printed to stdout:

{
  "id": "interaction-123",
  "status": "completed",
  "output_dir": "research-output/research-interaction-1/",
  "report_file": "research-output/research-interaction-1/report.md",
  "report_size_bytes": 45000,
  "duration_seconds": 154,
  "summary": "First 200 chars of the report..."
}

This i

Como adicionar

/plugin marketplace add 24601/agent-deep-research

O comando exato pode variar conforme o repositório. Confira o README no GitHub.

Comentários · Nenhum comentário

Entre para comentar. Entrar

  • Ainda não há comentários. Seja o primeiro.