deep-research
Skill8 starsChanged 10 months agoMITView on GitHub
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.
- Reads credentials
187 other projects use a version of this.
Adopted by
Most recently taken up by
- 5dive-ai/skillstheir own version, first seen Oct 5, 2026
- SkillMedev/ai-engineer-toolkittheir own version, first seen Oct 5, 2026
- HanksChen0110/skillstheir own version, first seen Oct 3, 2026
- davidondrej/skillstheir own version, first seen Oct 3, 2026
- TraX22/HydraOps-Skillstheir own version, first seen Oct 2, 2026
- CatCatUncle/openworkbuddytheir own version, first seen Oct 2, 2026
Used with
Projects with it also use academic-paper-reviewer, academic-pipeline and 10 more.
Other files people use alongside this one.
Files found in the same public projects as a version of this one, more often than they turn up anywhere else. Each project counts once, large collections count for less, and this file's own repository is left out.
zebbernSkillacademic-paper-reviewer
Simulates academic peer review, evaluating papers across Originality, Methodology, Results, and Writing to provide Major/Minor Revision recommendations with actionable feedback. Triggers when a user asks to \"review my paper,\" \"simulate peer review,\" or \"give my paper a peer review.
Also in 9 projects that use this
W-MoorerSkillacademic-pipeline
Orchestrator for the full academic research pipeline: research -> write -> integrity check -> review -> revise -> re-review -> re-revise -> final integrity check -> finalize. Coordinates deep-research, academic-paper, and academic-paper-reviewer into a seamless 10-stage workflow with mandatory integrity verification, two-stage peer review, and reproducible quality gates. Triggers on: academic pipeline, research to paper, full paper workflow, paper pipeline, end-to-end paper, research-to-publication, complete paper workflow.
Also in 8 projects that use this
W-MoorerSkillacademic-paper
12-agent academic paper writing pipeline. 10 modes (full/plan/outline/revision/revision-coach/abstract/lit-review/format-convert/citation-check/disclosure). 6 paper types, 5 citation formats, bilingual abstracts, LaTeX/DOCX-via-Pandoc/PDF output. Style Calibration + Writing Quality Check + Anti-Patterns with IRON RULE markers. Triggers: write paper, academic paper, guide my paper, parse reviews, AI disclosure, 寫論文, 學術論文, 引導我寫論文, 審查意見.
Also in 8 projects that use this
nicepkgSkillcommunity-led-growth
Expert in community-led growth (CLG) - leveraging user communities to drive acquisition, retention, and expansion. Covers building developer communities, user groups, ambassador programs, and turning customers into advocates. Knows the difference between community as a feature vs community as a growth engine, and how to measure community ROI. Use when "community-led, CLG, ambassador program, champion program, user community, developer community, word of mouth, user group, " mentioned.
Also in 3 projects that use this
nicepkgSkillfinancial-unit-economics
Use when evaluating business model viability, analyzing profitability per customer/product/transaction, validating startup metrics (CAC, LTV, payback period), making pricing decisions, assessing scalability, comparing business models, or when user mentions unit economics, CAC/LTV ratio, contribution margin, customer profitability, break-even analysis, or needs to determine if a business can be profitable at scale.
Also in 3 projects that use this
daymadeSkillgithub-review-pr
Reviews or re-reviews a contributor PR as repository maintainer — a closed PR reconsidered, or a sweep of open PRs — against the live base with immutable snapshots and three-way merges. Use for a PR URL/number, "main changed, review again", "review all open PRs", "fix the rest ourselves?", or merge readiness. Not for GitHub CRUD (use github-ops), your own PR (use github-contributor), or merging without fresh review.
Also in 3 projects that use this
- +4 more from nicepkg
Other versions187 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 187
- bytedance/deer-flow★ 83ksame name
- Imbad0202/academic-research-skills★ 50ksame name
- HKUSTDial/Supervisor-Skills★ 8.1ksame name
- davidondrej/skills★ 4.1ksame name
- jordan-gibbs/hyperresearch★ 3.8ksame name
- MaxMiksa/Auto-Company★ 3.1ksame name
- feiskyer/claude-code-settings★ 1.7ksame name
- daymade/claude-code-skills★ 1.4ksame name
- 199-biotechnologies/claude-deep-research-skill★ 1.2ksame name
- coreyhaines31/makerskills★ 840same name
177 more not listed
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
The file
Show its rules and text
We split this skill into the rules it gives an agent
13 rules. 0 are common, 5 are distinctive, and 8 are very specific to this project.
0
Common
Most of the 165 edited versions we read keep these.
5
Distinctive
This author's own choices. Worth a look.
8
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 66
No obfuscation: All code is readable Python with PEP 723 inline metadata.
- Very specific: line 146
Important: When --output or --output-dir is used, the command blocks until research completes (2-10+ minutes).
- Very specific: line 169
When --output-dir is used, results are saved to a structured directory:
- Very specific: line 198
When --output or --output-dir is used, the script polls the Gemini API until research completes.
- Distinctive: line 201
When 3+ matching data points exist, the poll interval is tuned to the historical distribution:
- Distinctive: line 202
Before any research has ever completed: slow polling (30s)
- Distinctive: line 206
All intervals are clamped to [2s, 120s] as a fail-safe.
- Very specific: line 208
When history is insufficient (<3 data points) or --no-adaptive-poll is passed, a fixed escalating curve is used: 5s (first 30s), 10s …
- Very specific: line 220
After research completes with --output-dir, the metadata.json file includes a usage key with post-run cost estimates based on actual output …
- Very specific: line 254
Use --force to skip the confirmation prompt.
- Very specific: line 301
Add --json to any state subcommand to output structured JSON to stdout:
- Very specific: line 319
All confirmation prompts (store.py delete, state.py clear) are automatically skipped when stdin is not a TTY.
- Distinctive: line 353
All scripts follow a dual-output pattern:
“Common” is measured: kept by at least 6 in 10 of the 165 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 --agentSee AGENTS.md for the complete structured briefing.
| Command | What It Does |
uv run {baseDir}/scripts/research.py start "question" | Launch deep research |
uv run {baseDir}/scripts/research.py start "question" --context ./path --dry-run | Estimate cost |
uv run {baseDir}/scripts/research.py start "question" --context ./path --output report.md | RAG-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_KEYorGEMINI_API_KEYenvironment 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.mdEnvironment Variables
Set one of the following (checked in order of priority):
| Variable | Description |
GEMINI_DEEP_RESEARCH_API_KEY | Dedicated key for this skill (highest priority) |
GOOGLE_API_KEY | Standard Google AI key |
GEMINI_API_KEY | Gemini-specific key |
Optional model configuration:
| Variable | Description | Default |
GEMINI_DEEP_RESEARCH_MODEL | Model for file search queries | gemini-3.1-pro-preview |
GEMINI_MODEL | Fallback model name | gemini-3.1-pro-preview |
GEMINI_DEEP_RESEARCH_AGENT | Deep research agent identifier | deep-research-pro-preview-12-2025 |
Research Commands
Start Research
uv run {baseDir}/scripts/research.py start "your research question"| Flag | Description |
--report-format FORMAT | Output structure: executive_summary, detailed_report, comprehensive |
--store STORE_NAME | Ground research in a file search store (display name or resource ID) |
--no-thoughts | Hide intermediate thinking steps |
--follow-up ID | Continue a previous research session |
--output FILE | Wait for completion and save report to a single file |
--output-dir DIR | Wait for completion and save structured results to a directory (see below) |
--timeout SECONDS | Maximum wait time when polling (default: 1800 = 30 minutes) |
--no-adaptive-poll | Disable history-adaptive polling; use fixed interval curve instead |
--context PATH | Auto-create ephemeral store from a file or directory for RAG-grounded research |
--context-extensions EXT | Filter context uploads by extension (e.g. py,md or .py .md) |
--keep-context | Keep the ephemeral context store after research completes (default: auto-delete) |
--dry-run | Estimate 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 USD | Abort if estimated cost exceeds this limit (e.g. --max-cost 3.00) |
--input-file PATH | Read the research query from a file instead of positional argument |
--no-cache | Skip 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>| Flag | Description |
--output FILE | Save report to a specific file path (default: report-<id>.md) |
--output-dir DIR | Save 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/citationsA 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.jsonunderresearchHistory(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+).
Cost Estimation (--dry-run)
Preview estimated costs before running research:
uv run {baseDir}/scripts/research.py start "Analyze security architecture" --context ./src --dry-runOutputs a JSON cost estimate to stdout with context upload costs, research query costs, and a total. Estimates are heuristic-based (the Gemini API does not return token counts or billing data) and clearly labeled as such.
After research completes with --output-dir, the metadata.json file includes a usage key with post-run cost estimates based on actual output size and duration.
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 listQuery a Store
uv run {baseDir}/scripts/store.py query <store-name> "What does the auth module do?"| Flag | Description |
--output-dir DIR | Save 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| Flag | Description |
--smart-sync | Skip 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 showShow Research Sessions Only
uv run {baseDir}/scripts/state.py researchShow Stores Only
uv run {baseDir}/scripts/state.py storesJSON 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 storesClear Session State
uv run {baseDir}/scripts/state.py clearUse -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-outputOutput 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.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

