Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
24601 avatar

Agent Deep Research

  • 1 installs
  • 6 repo stars
  • Updated June 22, 2026
  • 24601/agent-deep-research

agent-deep-research is a Claude Code skill that runs deep research and RAG-grounded document Q&A through Google Gemini's deep research agent via the Interactions API.

About

agent-deep-research is a Claude Code skill that performs deep research using Google Gemini's deep research agent. It can RAG-ground queries on local files by uploading them to ephemeral file-search stores, preview costs with --dry-run, and output structured JSON reports. It manages research sessions with persistent workspace state and cleans up orphaned stores. A developer uses it to run long-form research or grounded Q&A over a codebase or document set, exporting reports as Markdown, HTML, or PDF.

  • Runs async deep research via the Google Gemini Interactions API with adaptive polling and structured JSON output
  • RAG-grounds queries on local files with --context, auto-deleting the ephemeral file-search store after the run
  • Includes --dry-run cost preview, --max-cost guards, and sensitive-file exclusion (.env, keys, credentials)

Agent Deep Research by the numbers

  • 1 all-time installs (skills.sh)
  • Ranked #14,102 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Jul 28, 2026 (Skillselion catalog sync)
At a glance

agent-deep-research capabilities & compatibility

Free skill; requires a user-supplied Google/Gemini API key and bills Gemini usage. Includes --dry-run cost preview and --max-cost guards.

Capabilities
deep research · rag grounding · document qa · cost estimation
Works with
openai
Use cases
research · web search · documentation
Pricing
Bring your own API key
From the docs

What agent-deep-research says it does

Perform deep research powered by Google Gemini's deep research agent. Upload documents to file search stores for RAG-grounded answers.
SKILL.md
npx skills add https://github.com/24601/agent-deep-research --skill agent-deep-research

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs1
repo stars6
Last updatedJune 22, 2026
Repository24601/agent-deep-research

What it does

A developer runs a deep research query grounded on local source files and exports a cited report as Markdown or PDF.

Who is it for?

Developers who want async deep research or document-grounded Q&A from an agent, with cost preview and structured output

Skip if: Users without a Google/Gemini API key or uv, or those needing offline research

When should I use this skill?

The user wants deep research on a topic, or RAG-grounded answers over a set of local files

What you get

A deep research report grounded in the topic or supplied files, with previewed cost and auto-deleted ephemeral stores.

  • deep research report (Markdown, HTML or PDF)
  • structured JSON output
  • grounded Q&A answers over uploaded documents

By the numbers

  • version 2.1.3
  • universal skill for 30+ AI agents
  • 3 export formats (Markdown, HTML, PDF)

Files

SKILL.mdMarkdownGitHub ↗

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.

Prerequisites

  • A Google API key (GOOGLE_API_KEY or GEMINI_API_KEY environment variable)
  • uv installed (curl -LsSf https://astral.sh/uv/install.sh | sh)

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

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 queriesmodels/gemini-flash-latest
GEMINI_MODELFallback model namemodels/gemini-flash-latest
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

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

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 is the recommended pattern for AI agent integration -- the agent receives a small JSON payload while the full report is written to disk.

Adaptive Polling

When --output or --output-dir is used, the script polls the Gemini API until research completes. By default, it uses history-adaptive polling that learns from past research completion times:

  • Completion times are recorded in .gemini-research.json under researchHistory (last 50 entries, separate curves for grounded vs non-grounded research).
  • When 3+ matching data points exist, the poll interval is tuned to the historical distribution:
  • Before any research has ever completed: slow polling (30s)
  • In the likely completion window (p25-p75): aggressive polling (5s)
  • In the tail (past p75): moderate polling (15-30s)
  • Unusually long runs (past 1.5x the longest ever): slow polling (60s)
  • All intervals are clamped to [2s, 120s] as a fail-safe.

When history is insufficient (<3 data points) or --no-adaptive-poll is passed, a fixed escalating curve is used: 5s (first 30s), 10s (30s-2min), 30s (2-10min), 60s (10min+).

File Search Store Commands

Manage file search stores for RAG-grounded research and Q&A.

Create a Store

uv run {baseDir}/scripts/store.py create "My Project Docs"

List Stores

uv run {baseDir}/scripts/store.py list

Query a Store

uv run {baseDir}/scripts/store.py query <store-name> "What does the auth module do?"
FlagDescription
--output-dir DIRSave response and metadata to a directory

Delete a Store

uv run {baseDir}/scripts/store.py delete <store-name>

Use --force to skip the confirmation prompt. When stdin is not a TTY (e.g., called by an AI agent), the prompt is automatically skipped.

File Upload

Upload files or entire directories to a file search store.

uv run {baseDir}/scripts/upload.py ./src fileSearchStores/abc123
FlagDescription
--smart-syncSkip files that haven't changed (hash comparison)
--extensions EXT [EXT ...]File extensions to include (comma or space separated, e.g. py,ts,md or .py .ts .md)

Hash caches are always saved on successful upload, so a subsequent --smart-sync run will correctly skip unchanged files even if the first upload did not use --smart-sync.

MIME Type Support

36 file extensions are natively supported by the Gemini File Search API. Common programming files (JS, TS, JSON, CSS, YAML, etc.) are automatically uploaded as text/plain via a fallback mechanism. Binary files are rejected. See references/file_search_guide.md for the full list.

File size limit: 100 MB per file.

Session Management

Research IDs and store mappings are cached in .gemini-research.json in the current working directory.

Show Session State

uv run {baseDir}/scripts/state.py show

Show Research Sessions Only

uv run {baseDir}/scripts/state.py research

Show Stores Only

uv run {baseDir}/scripts/state.py stores

JSON Output for Agents

Add --json to any state subcommand to output structured JSON to stdout:

uv run {baseDir}/scripts/state.py --json show
uv run {baseDir}/scripts/state.py --json research
uv run {baseDir}/scripts/state.py --json stores

Clear Session State

uv run {baseDir}/scripts/state.py clear

Use -y to skip the confirmation prompt. When stdin is not a TTY (e.g., called by an AI agent), the prompt is automatically skipped.

Non-Interactive Mode

All confirmation prompts (store.py delete, state.py clear) are automatically skipped when stdin is not a TTY. This allows AI agents and CI pipelines to call these commands without hanging on interactive prompts.

Workflow Example

A typical grounded research workflow:

# 1. Create a file search store
STORE_JSON=$(uv run {baseDir}/scripts/store.py create "Project Codebase")
STORE_NAME=$(echo "$STORE_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['name'])")

# 2. Upload your documents
uv run {baseDir}/scripts/upload.py ./docs "$STORE_NAME" --smart-sync

# 3. Query the store directly
uv run {baseDir}/scripts/store.py query "$STORE_NAME" "How is authentication handled?"

# 4. Start grounded deep research (blocking, saves to directory)
uv run {baseDir}/scripts/research.py start "Analyze the security architecture" \
  --store "$STORE_NAME" --output-dir ./research-output --timeout 3600

# 5. Or start non-blocking and check later
RESEARCH_JSON=$(uv run {baseDir}/scripts/research.py start "Analyze the security architecture" --store "$STORE_NAME")
RESEARCH_ID=$(echo "$RESEARCH_JSON" | python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")

# 6. Check progress
uv run {baseDir}/scripts/research.py status "$RESEARCH_ID"

# 7. Save the report when completed
uv run {baseDir}/scripts/research.py report "$RESEARCH_ID" --output-dir ./research-output

Output Convention

All scripts follow a dual-output pattern:

  • stderr: Rich-formatted human-readable output (tables, panels, progress bars)
  • stdout: Machine-readable JSON for programmatic consumption

This means 2>/dev/null hides the human output, and piping stdout gives clean JSON.

Related skills

FAQ

What API key does it require?

One of GOOGLE_API_KEY, GEMINI_API_KEY, or GEMINI_DEEP_RESEARCH_API_KEY, read from environment variables and passed to the google-genai SDK.

Does it upload my whole project?

No. Only files you point --context at are uploaded, sensitive files like .env and private keys are excluded, and the ephemeral store is auto-deleted after the run.

AI & Agent Buildingresearchagentsllm

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.