Production-ready deployment solution for Google ADK Agents to Vertex AI Agent Engine
The ADK CLI adk deploy agent_engine has a critical bug that causes deployments to fail with:
ModuleNotFoundError: No module named 'agent_engine_app'
This repository provides the solution.
This toolkit provides programmatic deployment templates that bypass CLI bugs and ensure reliable deployments every time.
| CLI Approach β | Programmatic Approach β |
|---|---|
| Creates temporary files with import bugs | Uses Python API directly |
| Implicit package handling | Explicit extra_packages control |
Runs problematic absolufy-imports |
Avoids intermediate steps |
| Limited error handling | Comprehensive error handling |
# Templates
cp templates/deploy_agent.py your_project/
cp templates/test_agent.py your_project/
# Edit deploy_agent.py
PROJECT_ID = "your-project-id"
AGENT_FOLDER = "your_agent_folder"
# ... other variables
# Deploy
python deploy_agent.py# Edit test_agent.py
TEST_MESSAGES = ["Hello!", "What can you do?"]
# Test
python test_agent.pyThat's it! β¨
- Complete Deployment Guide - Detailed explanations and examples
- Quick Reference Cheatsheet - Fast lookup
- README - How to use the templates
- β
Bypasses ADK CLI bugs - No more
ModuleNotFoundError - β Production-ready templates - Copy, configure, deploy
- β Comprehensive error handling - Clear error messages
- β Automated testing scripts - Verify deployments work
- β Battle-tested - Used in production environments
adk-agent-engine-deployment/
βββ README.md # This file
βββ LICENSE # MIT License
βββ docs/
β βββ en/ # English documentation
β β βββ README.md
β β βββ ADK_DEPLOYMENT_GUIDE.md
β β βββ ADK_DEPLOYMENT_CHEATSHEET.md
β βββ es/ # Spanish documentation
β βββ README.md
β βββ ADK_DEPLOYMENT_GUIDE.md
β βββ ADK_DEPLOYMENT_CHEATSHEET.md
βββ templates/
β βββ deploy_agent.py # Deployment template
β βββ test_agent.py # Testing template
βββ examples/
βββ weather_agent/ # Complete working example
βββ agent.py
βββ __init__.py
βββ deploy_agent.py
βββ test_agent.py
# β This fails
adk deploy agent_engine --project=... --region=... agent_folder
# Error: ModuleNotFoundError: No module named 'agent_engine_app'# β
This works
from vertexai.agent_engines import AdkApp
from vertexai import agent_engines
app = AdkApp(agent=root_agent)
remote_app = agent_engines.create(
app,
requirements=["google-cloud-aiplatform[adk,agent_engines]>=1.132.0"],
extra_packages=["./your_agent_folder"], # β Key difference
display_name="My Agent",
)Key Points:
- Uses Python API directly (no CLI)
- Explicitly includes agent folder via
extra_packages - Avoids temporary file creation bugs
- Full control over deployment process
# 1. Create your agent
from google.adk.agents import Agent
root_agent = Agent(
name="my_agent",
model="gemini-2.0-flash",
instruction="You are a helpful agent",
tools=[get_weather, get_time]
)
# 2. Copy templates
cp templates/deploy_agent.py .
cp templates/test_agent.py .
# 3. Configure
# Edit deploy_agent.py with your PROJECT_ID, etc.
# 4. Deploy
python deploy_agent.py
# 5. Test
python test_agent.py| Error | Solution |
|---|---|
ModuleNotFoundError: No module named 'agent_engine_app' |
Don't use CLI, use our templates |
'AgentEngine' object has no attribute 'query' |
Use async_stream_query() not query() |
No module named 'your_agent_folder' |
Add extra_packages=["./your_agent_folder"] |
cannot import name 'root_agent' |
Verify __init__.py exports root_agent |
Full troubleshooting guide: English | EspaΓ±ol
Contributions are welcome! Please feel free to submit a Pull Request.
- Additional examples
- Support for other deployment targets (Cloud Run, GKE)
- Automated testing improvements
- Documentation translations to other languages
This project is licensed under the MIT License - see the LICENSE file for details.
Adri - Applied AI Engineer @ Aselvia
- Expertise: ADK, Multi-Agent Systems, Google Cloud
- Background: 3D Video Game Artist turned AI Engineer
- Google ADK team for the excellent framework
- Vertex AI Agent Engine team
- Community members who identified and reported the CLI bug
If this toolkit helped you deploy your ADK agents successfully, please consider giving it a star! β
It helps others discover this solution and motivates continued maintenance.
Quick Links: