# tarakaramaraoperabattula/elderly-care-assistant architecture

> Architecture diagram of the GitHub repository tarakaramaraoperabattula/elderly-care-assistant, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tarakaramaraoperabattula/elderly-care-assistant
- Repository: https://github.com/tarakaramaraoperabattula/elderly-care-assistant

## Overview

The product is an elderly-care assistant that handles medication questions and doctor appointments. Its main workflow checks for pending user confirmation, screens new requests for privacy and injection risks, delegates approved queries to specialist agents, and routes proposed changes through an approval gate before updating session state. The README documents the workflow and MCP capabilities; sampled source confirms the security, confirmation, state-update, and MCP setup. Specialist tool wiring and some workflow details are documented but not fully visible in the excerpts.

Main entry points: [`app/agent.py`](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py) (Orchestrator), [`app/mcp_server.py`](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/mcp_server.py) (MCP server), [`app/agent_runtime_app.py`](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent_runtime_app.py) (Agent Engine app), [`app/app_utils/telemetry.py`](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/app_utils/telemetry.py) (Telemetry setup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Conversation workflow"]
  node_confirm["Confirmation handler<br/>[agent.py]"]
  node_security["Security checkpoint<br/>[agent.py]"]
  node_alert["Security alert<br/>[agent.py]"]
  node_orchestrator["Orchestrator<br/>[agent.py]"]
  node_router["Action router<br/>[agent.py]"]
  node_approval["Approval gate<br/>[agent.py]"]
  node_response["Final response<br/>[agent.py]"]
  node_state["Session state<br/>[agent.py]"]
end

subgraph group_specialists["Care specialists"]
  node_medication["Medication agent<br/>[agent.py]"]
  node_appointments["Appointment agent<br/>[agent.py]"]
end

subgraph group_tools["MCP domain tools"]
  node_mcp["MCP server<br/>[mcp_server.py]"]
  node_warnings["Medication warnings<br/>[mcp_server.py]"]
  node_directory["Doctor directory<br/>[mcp_server.py]"]
  node_reminder["Appointment reminders<br/>[mcp_server.py]"]
end

subgraph group_runtime["Agent runtime"]
  node_runtime_app["Agent Engine app"]
  node_telemetry["Telemetry setup<br/>[telemetry.py]"]
  node_feedback["Feedback model<br/>[typing.py]"]
end

node_user(("User"))
node_cloud_logging[("Cloud Logging")]
node_gcs[("Cloud Storage")]

node_user -->|"sends message"| node_confirm
node_confirm -->|"new request"| node_security
node_confirm -->|"confirmed reply"| node_response
node_security -->|"blocks request"| node_alert
node_security -->|"approves request"| node_orchestrator
node_alert -->|"returns alert"| node_response
node_orchestrator -.->|"delegates medication"| node_medication
node_orchestrator -.->|"delegates appointment"| node_appointments
node_orchestrator -->|"passes output"| node_router
node_router -->|"requires approval"| node_approval
node_router -->|"direct response"| node_response
node_approval -->|"requests confirmation"| node_response
node_confirm -->|"updates confirmed action"| node_state
node_medication -.->|"uses MCP"| node_mcp
node_appointments -.->|"uses MCP"| node_mcp
node_mcp -->|"dispatches tool"| node_warnings
node_mcp -->|"dispatches tool"| node_directory
node_mcp -->|"dispatches tool"| node_reminder
node_runtime_app -->|"hosts workflow"| node_orchestrator
node_runtime_app -->|"sets up telemetry"| node_telemetry
node_runtime_app -->|"validates feedback"| node_feedback
node_runtime_app -->|"logs feedback"| node_cloud_logging
node_telemetry -.->|"uploads telemetry"| node_gcs

click node_confirm "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py"
click node_security "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py"
click node_alert "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py"
click node_orchestrator "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py"
click node_router "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py"
click node_approval "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py"
click node_response "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py"
click node_state "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py"
click node_medication "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py"
click node_appointments "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py"
click node_mcp "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/mcp_server.py"
click node_warnings "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/mcp_server.py"
click node_directory "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/mcp_server.py"
click node_reminder "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/mcp_server.py"
click node_runtime_app "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent_runtime_app.py"
click node_telemetry "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/app_utils/telemetry.py"
click node_feedback "https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/app_utils/typing.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_confirm,node_security,node_alert,node_orchestrator,node_router,node_approval,node_response,node_state,node_user toneBlue
class node_medication,node_appointments,node_cloud_logging,node_gcs toneAmber
class node_mcp,node_warnings,node_directory,node_reminder toneMint
class node_runtime_app,node_telemetry,node_feedback toneRose
```

## Components

### Conversation workflow

- [Confirmation handler](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py): `app/agent.py`
- [Security checkpoint](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py): `app/agent.py`
- [Security alert](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py): `app/agent.py`
- [Orchestrator](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py): `app/agent.py`
- [Action router](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py): `app/agent.py`
- [Approval gate](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py): `app/agent.py`
- [Final response](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py): `app/agent.py`
- [Session state](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py): `app/agent.py`

### Care specialists

- [Medication agent](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py): `app/agent.py`
- [Appointment agent](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent.py): `app/agent.py`

### MCP domain tools

- [MCP server](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/mcp_server.py): `app/mcp_server.py`
- [Medication warnings](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/mcp_server.py): `app/mcp_server.py`
- [Doctor directory](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/mcp_server.py): `app/mcp_server.py`
- [Appointment reminders](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/mcp_server.py): `app/mcp_server.py`

### Agent runtime

- [Agent Engine app](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/agent_runtime_app.py): `app/agent_runtime_app.py`
- [Telemetry setup](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/app_utils/telemetry.py): `app/app_utils/telemetry.py`
- [Feedback model](https://github.com/tarakaramaraoperabattula/elderly-care-assistant/blob/main/app/app_utils/typing.py): `app/app_utils/typing.py`

### Other components

- **User**
- **Cloud Logging**
- **Cloud Storage**

## Connections

- User → Confirmation handler: sends message
- Confirmation handler → Security checkpoint: new request
- Confirmation handler → Final response: confirmed reply
- Security checkpoint → Security alert: blocks request
- Security checkpoint → Orchestrator: approves request
- Security alert → Final response: returns alert
- Orchestrator → Medication agent: delegates medication
- Orchestrator → Appointment agent: delegates appointment
- Orchestrator → Action router: passes output
- Action router → Approval gate: requires approval
- Action router → Final response: direct response
- Approval gate → Final response: requests confirmation
- Confirmation handler → Session state: updates confirmed action
- Medication agent → MCP server: uses MCP
- Appointment agent → MCP server: uses MCP
- MCP server → Medication warnings: dispatches tool
- MCP server → Doctor directory: dispatches tool
- MCP server → Appointment reminders: dispatches tool
- Agent Engine app → Orchestrator: hosts workflow
- Agent Engine app → Telemetry setup: sets up telemetry
- Agent Engine app → Feedback model: validates feedback
- Agent Engine app → Cloud Logging: logs feedback
- Telemetry setup → Cloud Storage: uploads telemetry
