# Agent Workflow Diagrams ## 1. Main deploy/run lifecycle ```mermaid flowchart TD A[Local VS Code / Cloud Shell] -->|01-setupenv.sh| B[APIs Enabled + Bucket + SA] B -->|02-deploy.sh| C[ADK Python SDK] C -->|gcloud auth ADC| D[Gemini Enterprise Agent Platform] D -->|Agent Runtime deployed| E[Managed Serverless Runtime] E -->|Query via API| F[Agent Response] F -->|End of day| G[03-teardown.sh] G --> H[Agent Runtime Deleted — Billing Stopped] style G fill:#c0392b,color:#fff style H fill:#27ae60,color:#fff ``` ## 2. Multi-agent / Coordinator delegation flow ```mermaid flowchart TD U[User Input] --> O[Orchestrator LlmAgent] O -->|Knowledge question| R[rag_agent] O -->|GCP ops question| G[gcp_ops_agent] O -->|Memory recall/store| M[memory_agent] O -->|Session close| F[farewell_agent] R --> V[Vertex AI RAG Engine] M --> MB[Memory Bank / Agent Engine] O -->|Final answer| U ``` ## 3. Agents CLI lifecycle (2026) ```mermaid flowchart LR A[Developer] -->|natural language| B[Agents CLI skills] B -->|agents-cli create| C[Scaffolded project] C -->|agents-cli run| D[Local test] D -->|agents-cli deploy| E{Deploy target} E -->|cloud_run| F[Cloud Run service] E -->|agent_runtime| G[Agent Runtime — managed] E -->|gke| H[GKE cluster] F & G & H --> J[Cloud Trace + Logging + Monitoring] ``` ## 4. Observability stack ```mermaid flowchart TD A[ADK Agent — deployed] -->|OpenTelemetry| B[Cloud Trace] A -->|structured logs| C[Cloud Logging] A -->|metrics| D[Cloud Monitoring] D -->|alert policy| E[Email / PubSub] B --> F[Agent Platform: Traces tab] C --> G[Agent Platform: Logs tab] D --> H[Dashboards: sessions, latency p50/p95/p99, error rates] ``` ## 5. RAG-grounded agent data flow ```mermaid flowchart LR A[User query] --> B[ADK Agent] B -->|retrieve| C[Vertex AI RAG Engine] C -->|search corpus| D[Vector index] D -->|relevant chunks| C C -->|grounded context| B B -->|generate| E[Gemini model] E -->|grounded response| F[User] B -->|telemetry| G[Cloud Trace] ``` ## 6. CI/CD pipeline ```mermaid flowchart TD P[git push to main] --> T[Cloud Build Trigger] T --> B[Build Docker image] B --> AR[Push to Artifact Registry] AR --> EV[run_eval.py — CI gate] EV -->|groundedness >= 0.8| CR[Deploy to Cloud Run] EV -->|groundedness < 0.8| FAIL[Build FAILED] CR --> LIVE[Live service] ``` ## 7. Memory Bank session lifecycle ``` Session Start └── Load memories (recall by user_id) Agent conversation (session.state updates) Session End └── Generate memories (summarize session) └── Store in Memory Bank (TTL: 30 days default) Next Session └── Memories retrieved at start ``` ## 8. A2A agent communication ``` Orchestrator Agent (Cloud Run Service A) │ HTTP POST /tasks (A2A protocol) │ Authorization: Bearer ▼ Sub-Agent B (Cloud Run Service B) │ AgentCard: /.well-known/agent.json ▼ Response (A2A TaskResult) └── Orchestrator aggregates + responds to user ```