# jamalla/deep-task-planner-agentcore architecture

> Architecture diagram of the GitHub repository jamalla/deep-task-planner-agentcore, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/jamalla/deep-task-planner-agentcore
- Repository: https://github.com/jamalla/deep-task-planner-agentcore

## Overview

This repository hosts a conversational task planner on Amazon Bedrock AgentCore. A user sends a prompt through the AgentCore console or the optional chat UI; the runtime maintains per-session history, invokes the deep agent, and returns a reviewed plan with a deterministic dated schedule. The README documents the browser-to-Lambda-to-runtime path; excerpts show runtime, agent, scheduling, and UI proxy behavior. Agent sub-agent dispatch is described in the agent prompt and setup, but its execution details are not fully excerpted.

Main entry points: [`app/agent.py`](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/app/agent.py) (Planner agent), [`main.py`](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/main.py) (Session handler), [`app/tools.py`](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/app/tools.py) (Schedule tool), [`ui/index.html`](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/ui/index.html) (Chat page)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and sessions"]
  node_agentcore["AgentCore Runtime"]
  node_session_handler["Session handler<br/>[main.py]"]
  node_session_history[("Session history<br/>[main.py]")]
end

subgraph group_planning["Plan generation"]
  node_deep_agent["Planner agent<br/>[agent.py]"]
  node_openai["OpenAI models"]
  node_todo_middleware["Todo middleware<br/>[agent.py]"]
  node_reviewer["Plan reviewer<br/>[agent.py]"]
  node_schedule_tool["Schedule tool<br/>[tools.py]"]
  node_calendar_logic["Calendar scheduling<br/>[tools.py]"]
end

subgraph group_delivery["Chat UI proxy"]
  node_chat_ui["Chat page<br/>[index.html]"]
  node_lambda_proxy["Lambda proxy<br/>[handler.py]"]
  node_agentcore_api["AgentCore API"]
end

node_console_user(("Console user"))
node_browser_user(("Browser user"))

node_console_user -->|"invokes"| node_agentcore
node_agentcore -->|"routes to"| node_session_handler
node_session_handler -->|"reads and writes"| node_session_history
node_session_handler -->|"calls"| node_deep_agent
node_deep_agent -->|"queries"| node_openai
node_deep_agent -->|"uses"| node_todo_middleware
node_deep_agent -->|"delegates review"| node_reviewer
node_deep_agent -->|"calls"| node_schedule_tool
node_schedule_tool -->|"computes dates"| node_calendar_logic
node_browser_user -.->|"uses"| node_chat_ui
node_chat_ui -->|"sends prompt"| node_lambda_proxy
node_lambda_proxy -->|"invokes runtime"| node_agentcore_api
node_agentcore_api -->|"forwards request"| node_agentcore

click node_session_handler "https://github.com/jamalla/deep-task-planner-agentcore/blob/main/main.py"
click node_session_history "https://github.com/jamalla/deep-task-planner-agentcore/blob/main/main.py"
click node_deep_agent "https://github.com/jamalla/deep-task-planner-agentcore/blob/main/app/agent.py"
click node_todo_middleware "https://github.com/jamalla/deep-task-planner-agentcore/blob/main/app/agent.py"
click node_reviewer "https://github.com/jamalla/deep-task-planner-agentcore/blob/main/app/agent.py"
click node_schedule_tool "https://github.com/jamalla/deep-task-planner-agentcore/blob/main/app/tools.py"
click node_calendar_logic "https://github.com/jamalla/deep-task-planner-agentcore/blob/main/app/tools.py"
click node_chat_ui "https://github.com/jamalla/deep-task-planner-agentcore/blob/main/ui/index.html"
click node_lambda_proxy "https://github.com/jamalla/deep-task-planner-agentcore/blob/main/ui/handler.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_agentcore,node_session_handler,node_session_history,node_console_user,node_browser_user toneBlue
class node_deep_agent,node_openai,node_todo_middleware,node_reviewer,node_schedule_tool,node_calendar_logic toneAmber
class node_chat_ui,node_lambda_proxy,node_agentcore_api toneMint
```

## Components

### Runtime and sessions

- **AgentCore Runtime**
- [Session handler](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/main.py): `main.py`
- [Session history](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/main.py): `main.py`

### Plan generation

- [Planner agent](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/app/agent.py): `app/agent.py`
- **OpenAI models**
- [Todo middleware](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/app/agent.py): `app/agent.py`
- [Plan reviewer](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/app/agent.py): `app/agent.py`
- [Schedule tool](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/app/tools.py): `app/tools.py`
- [Calendar scheduling](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/app/tools.py): `app/tools.py`

### Chat UI proxy

- [Chat page](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/ui/index.html): `ui/index.html`
- [Lambda proxy](https://github.com/jamalla/deep-task-planner-agentcore/blob/main/ui/handler.py): `ui/handler.py`
- **AgentCore API**

### Other components

- **Console user**
- **Browser user**

## Connections

- Console user → AgentCore Runtime: invokes (evidence: `README.md`)
- AgentCore Runtime → Session handler: routes to (evidence: `README.md`)
- Session handler → Session history: reads and writes (evidence: `main.py`)
- Session handler → Planner agent: calls (evidence: `main.py`)
- Planner agent → OpenAI models: queries (evidence: `app/agent.py`)
- Planner agent → Todo middleware: uses (evidence: `app/agent.py`)
- Planner agent → Plan reviewer: delegates review (evidence: `app/agent.py`)
- Planner agent → Schedule tool: calls (evidence: `app/agent.py`)
- Schedule tool → Calendar scheduling: computes dates (evidence: `app/tools.py`)
- Browser user → Chat page: uses (evidence: `README.md`)
- Chat page → Lambda proxy: sends prompt (evidence: `README.md`)
- Lambda proxy → AgentCore API: invokes runtime (evidence: `ui/handler.py`)
- AgentCore API → AgentCore Runtime: forwards request (evidence: `README.md`)
