A local CLI and web client for Google's Gemini Deep Research API. Conduct AI-powered research with streaming output, iterative revisions, and persistent versioned reports.
This project uses uv for dependency management.
-
Install uv (if not already installed):
-
Install dependencies:
uv sync- Set up your Gemini API key via direnv:
export GEMINI_API_KEY="your-api-key-here"uv run deep-research-ui
# or, equivalently:
uv run python -m deep_research_app.ui_gradio# Start a new research run
uv run deep-research new "Impact of AI on healthcare" --timeframe "2020-2024"
# List all research runs
uv run deep-research list
# Show a report
uv run deep-research show <RUN_ID>
# Revise a report with feedback
uv run deep-research revise <RUN_ID> --feedback "Add more focus on economic impacts"
# Check status of a running interaction
uv run deep-research status <INTERACTION_ID>
# Resume an interrupted research run
uv run deep-research resume <RUN_ID>uv run deep-research new "topic" \
--timeframe "2020-2024" \ # Time period constraint
--region "United States" \ # Geographic focus
--max-words 5000 \ # Maximum report length
--focus "economics,policy" # Comma-separated focus areas
# Show thinking summaries during streaming
uv run deep-research --show-thoughts new "topic"The package is not on PyPI, but it is a standard PEP 621 build and can be installed or executed directly from this git repo.
# CLI
uvx --from git+https://github.com/danmackinlay/gemini_deep_research_client.git \
deep-research new "Impact of AI on healthcare"
# Web UI
uvx --from git+https://github.com/danmackinlay/gemini_deep_research_client.git \
deep-research-uiGEMINI_API_KEY must be set in the environment that invokes uvx — it does
not read this project's .envrc.
uv add git+https://github.com/danmackinlay/gemini_deep_research_client.git
# or
pip install git+https://github.com/danmackinlay/gemini_deep_research_client.gitThis installs the deep-research and deep-research-ui console scripts and
makes the deep_research_app package importable.
from deep_research_app import (
ResearchWorkflow,
RunStorage,
ResearchConstraints,
DeepResearchClient,
Settings,
)
workflow = ResearchWorkflow()
run_id, report = workflow.run_initial_research(
topic="Impact of AI on healthcare",
constraints=ResearchConstraints(timeframe="2020-2024"),
)Public symbols re-exported from deep_research_app: Settings,
get_settings, InteractionStatus, ResearchRun, RunMetadata,
PollResult, DeepResearchClient, RunStorage, ResearchWorkflow,
ResearchConstraints.
I like to automatically configure my Gemini API key using direnv
# Create .envrc with your API key
echo 'export GEMINI_API_KEY="your-api-key-here"' > .envrc
direnv allow- Streaming output: Watch research progress in real-time
- Automatic fallback: Falls back to polling if streaming fails
- Interrupt & resume: Ctrl+C saves state; resume later with
deep-research resume - Versioned reports: Each revision creates a new version, preserving history
- Iterative revisions: Refine reports with feedback using previous context
Reports are saved to runs/{run_id}/:
prompt_v1.md,report_v1.md- Initial researchprompt_v2.md,report_v2.md- After revisionmeta.json- Run metadata