# bhancockio/deploy-adk-agent-engine architecture

> Architecture diagram of the GitHub repository bhancockio/deploy-adk-agent-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-28). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/bhancockio/deploy-adk-agent-engine
- Repository: https://github.com/bhancockio/deploy-adk-agent-engine

## Overview

ADK Short Bot takes a message, uses an instruction-driven Gemini agent to shorten it while preserving meaning, and returns original/new character counts plus the revised message. The agent exposes a character-counting tool. The README documents both local session-based use and remote Agent Engine deployment, including session management and deployment cleanup. Deployment source supports these operations; the exact internal wiring of the ADK runtime is not shown in the sampled code.

Main entry points: [`adk_short_bot/agent.py`](https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/adk_short_bot/agent.py) (Shortening agent), [`deployment/local.py`](https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/deployment/local.py) (Local ADK app), [`deployment/remote.py`](https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/deployment/remote.py) (Remote operations), [`deployment/cleanup.py`](https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/deployment/cleanup.py) (Deployment cleanup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Shortening agent"]
  node_agent["Shortening agent<br/>[agent.py]"]
  node_prompt["Shortening instructions<br/>[prompt.py]"]
  node_counter["Character counter"]
end

subgraph group_local["Local sessions"]
  node_local_runner["Local session runner<br/>[local.py]"]
  node_local_app["Local ADK app<br/>[local.py]"]
end

subgraph group_remote["Remote deployment"]
  node_remote_runner["Remote operations<br/>[remote.py]"]
  node_cleanup["Deployment cleanup<br/>[cleanup.py]"]
end

subgraph group_cloud["Google Cloud runtime"]
  node_engine["Agent Engine"]
  node_vertex["Vertex AI"]
  node_gemini["Gemini model"]
  node_session_state[("Session state")]
end

node_user(("Message sender"))

node_user -->|"starts local test"| node_local_runner
node_local_runner -->|"creates app"| node_local_app
node_local_app -->|"hosts agent"| node_agent
node_local_app -->|"creates, queries sessions"| node_engine
node_user -->|"requests operation"| node_remote_runner
node_remote_runner -->|"packages for deployment"| node_agent
node_remote_runner -->|"manages deployment and sessions"| node_engine
node_cleanup -->|"lists and deletes deployments"| node_engine
node_engine -->|"stores session state"| node_session_state
node_engine -->|"runs deployed agent"| node_agent
node_agent -->|"uses instructions"| node_prompt
node_agent -->|"calls tool"| node_counter
node_agent -->|"requests shortening"| node_gemini
node_gemini -->|"runs on"| node_vertex
node_local_app -->|"prints response events"| node_user
node_remote_runner -->|"prints results"| node_user

click node_agent "https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/adk_short_bot/agent.py"
click node_prompt "https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/adk_short_bot/prompt.py"
click node_counter "https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/adk_short_bot/tools/character_counter.py"
click node_local_runner "https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/deployment/local.py"
click node_local_app "https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/deployment/local.py"
click node_remote_runner "https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/deployment/remote.py"
click node_cleanup "https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/deployment/cleanup.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_agent,node_prompt,node_counter toneBlue
class node_local_runner,node_local_app toneAmber
class node_remote_runner,node_cleanup toneMint
class node_engine,node_vertex,node_gemini,node_session_state toneRose
class node_user toneIndigo
```

## Components

### Shortening agent

- [Shortening agent](https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/adk_short_bot/agent.py): `adk_short_bot/agent.py`
- [Shortening instructions](https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/adk_short_bot/prompt.py): `adk_short_bot/prompt.py`
- [Character counter](https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/adk_short_bot/tools/character_counter.py): `adk_short_bot/tools/character_counter.py`

### Local sessions

- [Local session runner](https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/deployment/local.py): `deployment/local.py`
- [Local ADK app](https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/deployment/local.py): `deployment/local.py`

### Remote deployment

- [Remote operations](https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/deployment/remote.py): `deployment/remote.py`
- [Deployment cleanup](https://github.com/bhancockio/deploy-adk-agent-engine/blob/main/deployment/cleanup.py): `deployment/cleanup.py`

### Google Cloud runtime

- **Agent Engine**
- **Vertex AI**
- **Gemini model**
- **Session state**

### Other components

- **Message sender**

## Connections

- Message sender → Local session runner: starts local test
- Local session runner → Local ADK app: creates app
- Local ADK app → Shortening agent: hosts agent
- Local ADK app → Agent Engine: creates, queries sessions
- Message sender → Remote operations: requests operation
- Remote operations → Shortening agent: packages for deployment
- Remote operations → Agent Engine: manages deployment and sessions
- Deployment cleanup → Agent Engine: lists and deletes deployments
- Agent Engine → Session state: stores session state
- Agent Engine → Shortening agent: runs deployed agent
- Shortening agent → Shortening instructions: uses instructions
- Shortening agent → Character counter: calls tool
- Shortening agent → Gemini model: requests shortening
- Gemini model → Vertex AI: runs on
- Local ADK app → Message sender: prints response events
- Remote operations → Message sender: prints results
