DeepSearch is an attractive, terminal-first deep research assistant built with Google ADK.
It converts a plain question into a structured, high-signal answer:
- Quick Summary
- Key Points
- Deep Dive
- Final Takeaway
When a Gemini model is selected, DeepSearch can use Google Search tool calls for live sources.
When a Gemma model is selected, it automatically disables search tools to avoid compatibility failures.
- Clean CLI UX with
rich - Structured output format for better readability
- Model-aware tool gating (Gemini: search on, Gemma: search off)
- Easy
.envconfiguration - Works well for quick research workflows and note-taking
User Input (CLI)
|
v
cli.py
|
v
agent.py (ADK LlmAgent)
|- instruction template
|- model from RESEARCH_MODEL
|- tools:
- Gemini models -> [google_search]
- Gemma models -> []
|
v
Runner + Session Service
|
v
Structured Response
deep_research_agent/
βββ agent.py # Agent definition and model/tool logic
βββ cli.py # Interactive CLI loop and rendering
βββ requirements.txt # Python dependencies
βββ .env.example # Safe env template
βββ README.md # Documentation
python3 -m venv .venv
source .venv/bin/activatepython3 -m pip install -r requirements.txtcp .env.example .envSet values in .env:
GOOGLE_API_KEY=YOUR_NEW_KEY
GOOGLE_GENAI_USE_VERTEXAI=FALSE
RESEARCH_MODEL=gemma-3-27b-itset -a; source .env; set +a; python3 cli.py| Command | Description |
|---|---|
/help |
Show command help |
/clear |
Clear terminal screen |
/new |
Start a fresh session |
/model |
Show active model |
/exit |
Quit the app |
Pick a model by setting RESEARCH_MODEL in .env.
| Model ID | Search Tool Support | Best For |
|---|---|---|
gemma-3-27b-it |
No | Stable structured responses with lower cost |
gemma-3-12b-it |
No | Faster responses |
gemini-2.0-flash |
Yes | Source-backed research with web tool calls |
Gemma models currently do not support the ADK Google Search tool in this project flow.
DeepSearch handles this automatically in code.
π¬ DeepSearch > Explain quantum computing in simple words with examples
Expected shape:
- Topic
- Quick Summary
- Key Points
- Deep Dive
- Final Takeaway
- Verify
.envhas a real key (not placeholder) - Regenerate key at Google AI Studio API Key
- Reload environment and run again
Your project/key quota is exhausted.
- Rate limits: Gemini API rate limits
- Usage dashboard: AI Dev rate-limit dashboard
- Retry after the delay shown in the error message
- Use a Gemini model if you need live web search (
gemini-2.0-flash) - Or keep Gemma and run without search tool support
- Never commit real API keys
- Keep
.envprivate - Rotate keys immediately if exposed
- Use
.env.examplewith placeholders only
- Save results to markdown files
- Add streaming output mode
- Add model fallback strategy
- Add persistent session history
- Add prompt presets for common research tasks
Built by Gokulakrishnan.
Point-by-point research answers with sources, powered by Google Gemma 4 via Google ADK
βββββββ βββββββββββββββββββββββ ββββββββββββββββ ββββββ βββββββ ββββββββββ βββ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βββ
βββ βββββββββ ββββββ ββββββββββββββββββββββ βββββββββββββββββββ ββββββββ
βββ βββββββββ ββββββ βββββββ ββββββββββββββ βββββββββββββββββββ ββββββββ
βββββββββββββββββββββββββββ βββββββββββββββββββ ββββββ ββββββββββββββ βββ
βββββββ βββββββββββββββββββ βββββββββββββββββββ ββββββ βββ ββββββββββ βββ
DeepSearch is a CLI-based deep research agent that:
- π Breaks down answers point-by-point β clear, numbered key points
- π Provides source links β real URLs from web search, not hallucinated
- π Gives a quick summary β 2-3 sentences you can understand instantly
- π§ Deep-dives the topic β explains like you're 16, no jargon
- β Final takeaway β the single most important thing to know
deep_research_agent/
βββ agent.py # Core agent logic (ADK + Gemma 4)
βββ cli.py # CLI interface with rich terminal UI
βββ requirements.txt # Python dependencies
βββ .env.example # Environment variable template
βββ README.md # This file
cd deep_research_agent
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activatepip install -r requirements.txt- Go to https://aistudio.google.com/apikey
- Create a free API key (no credit card needed)
- Copy the key
cp .env.example .envEdit .env and paste your key:
GOOGLE_API_KEY=AIzaSy...your_actual_key_here
GOOGLE_GENAI_USE_VERTEXAI=FALSE
RESEARCH_MODEL=gemma-3-27b-it# Load env and run
export $(cat .env | xargs) && python cli.py
# Or set key directly
GOOGLE_API_KEY=your_key python cli.pyOnce running, just type your research question:
π¬ DeepSearch > What is quantum computing and how does it work?
π¬ DeepSearch > Latest AI breakthroughs in 2025
π¬ DeepSearch > Explain blockchain simply with real examples
π¬ DeepSearch > How does CRISPR gene editing work?
| Command | Description |
|---|---|
/help |
Show help and available commands |
/clear |
Clear the terminal screen |
/new |
Start a fresh session (new history) |
/model |
Show which model is active |
/exit |
Quit DeepSearch |
Edit RESEARCH_MODEL in your .env:
| Model | Speed | Quality | Notes |
|---|---|---|---|
gemma-3-27b-it |
Medium | βββββ | Best open model (default) |
gemma-3-12b-it |
Fast | ββββ | Lighter, still great |
gemini-2.0-flash |
Fast | βββββ | Gemini β very capable |
gemini-2.5-flash-preview-04-17 |
Fast | βββββ | Latest Gemini Flash |
### π TOPIC: What is quantum computing?
---
### π QUICK SUMMARY
Quantum computing uses quantum mechanics to process information in ways
classical computers can't. Instead of bits (0 or 1), it uses "qubits"
that can be both at once, making it exponentially more powerful for
certain problems.
---
### π KEY POINTS
**Point 1: What is a Qubit?**
β Unlike classical bits that are 0 OR 1, qubits can be 0, 1, or both
simultaneously (called superposition). This is the core difference.
π Source: https://quantum.google/learn/
**Point 2: Why It Matters**
β Quantum computers can solve certain problems millions of times faster
than any classical computer β like breaking encryption or drug discovery.
π Source: https://www.ibm.com/quantum
...
### β
FINAL TAKEAWAY
Quantum computing isn't just a faster computer β it's a fundamentally
different way of processing information that will transform cryptography,
medicine, and AI.User Query
β
βΌ
Google ADK Runner
β
βββ LlmAgent (Gemma 4 / Gemini)
β βββ System Prompt: structured research format
β
βββ google_search Tool
βββ Live web search for real sources
β
βΌ
Structured Response:
Summary β Key Points β Deep Dive β Takeaway
- google-adk β Google Agent Development Kit
- google-genai β Google AI Python SDK
- rich β Beautiful terminal output
- python-dotenv β Environment variable loading
Google AI Studio offers a free tier with Gemma models:
- β No credit card required
- β Generous rate limits for personal use
- β Access to Gemma 3 (27B, 12B) and Gemini Flash
- π Get key: aistudio.google.com/apikey
- Google ADK v1.30+ (with Gemma 4 support added in v1.30)
- Google Gemma 3/4 models via Gemini API
- Rich terminal UI
- Python asyncio for async ADK runner
Built by Gokulakrishnan | gokulakrishnan.dev