A production-style layout for deploying a LangGraph agent to Vertex AI Agent Engine, based on Google's tutorial_langgraph.ipynb.
The agent uses the LanggraphAgent template with a custom product-catalog tool, deploys to managed Agent Engine, and supports local testing, remote queries, and teardown via a CLI.
flowchart LR
src[src/agent.py + tools.py] --> deploy[deploy.py]
deploy --> gcs[GCS staging bucket]
gcs --> engine[Vertex Agent Engine]
engine --> query[deploy.py query]
- Local:
src/defines the agent;deploy.py localornotebooks/development.ipynbrun queries against Gemini before deploy. - Deploy:
deploy.py deploybundlessrc/and uploads to your staging bucket, then creates an Agent Engine resource. - Remote:
deploy.py querycalls the deployed agent API.
- Google Cloud project with billing enabled
- Vertex AI API and Cloud Storage API enabled
- Python 3.10+
- Google Cloud SDK with
gcloud auth application-default login
First-time GCP setup: see docs/gcp-setup.md.
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env # edit with your project ID and staging bucketLocal test (no deploy):
python deploy.py local --prompt "Get product details for headphones"Deploy, query, delete:
python deploy.py deploy
python deploy.py query --prompt "Get product details for headphones"
python deploy.py deleteproduction-langgraph-agent/
├── deploy.py # CLI: deploy | query | delete | local
├── src/
│ ├── agent.py # LanggraphAgent factory
│ └── tools.py # get_product_details tool
├── notebooks/
│ └── development.ipynb # Local sandbox only
└── docs/
└── gcp-setup.md # GCP bootstrap guide
Open notebooks/development.ipynb to prototype against src/ without deploying. Remote steps use deploy.py.
Agent Engine charges while a deployment is running. Always run python deploy.py delete after demos. See docs/gcp-setup.md for bucket cleanup notes.