# jamalla/deep-task-planner architecture

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

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

## Overview

Deep Task Planner turns browser chat history into a reviewed, dependency-aware action plan with deterministic dates, then returns the plan and timing data. The main flow is documented in the README and shown in the handler and agent excerpts. The agent and scheduling modules are substantial core modules; unsampled UI details are limited to documented chat and localStorage behavior.

Main entry points: [`app/handler.py`](https://github.com/jamalla/deep-task-planner/blob/main/app/handler.py) (Lambda routes), [`app/static/index.html`](https://github.com/jamalla/deep-task-planner/blob/main/app/static/index.html) (Chat interface), [`app/agent.py`](https://github.com/jamalla/deep-task-planner/blob/main/app/agent.py) (Chat turn runner), [`app/tools.py`](https://github.com/jamalla/deep-task-planner/blob/main/app/tools.py) (Schedule tool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_client["Chat client"]
  node_chat_ui["Chat interface<br/>[index.html]"]
  node_history[("Local history<br/>[index.html]")]
end

subgraph group_request["Request handling"]
  node_lambda["Lambda routes<br/>[handler.py]"]
  node_request_checks["Access and validation<br/>[handler.py]"]
end

subgraph group_planning["Agent planning"]
  node_run_chat["Chat turn runner<br/>[agent.py]"]
  node_agent["Task planning agent<br/>[agent.py]"]
  node_todo_middleware["Todo middleware<br/>[agent.py]"]
  node_reviewer["Plan reviewer<br/>[agent.py]"]
end

subgraph group_schedule["Scheduling and response"]
  node_schedule_tool["Schedule tool<br/>[tools.py]"]
  node_schedule_engine["Schedule calculation<br/>[tools.py]"]
  node_reply_assembly["Reply assembly<br/>[agent.py]"]
  node_timing["Call timings<br/>[agent.py]"]
end

node_user(("Planner user"))
node_openai["OpenAI models"]

node_user -->|"enters goal"| node_chat_ui
node_chat_ui -->|"stores history"| node_history
node_history -->|"supplies history"| node_chat_ui
node_chat_ui -->|"requests chat"| node_lambda
node_lambda -->|"serves page"| node_chat_ui
node_lambda -->|"checks request"| node_request_checks
node_lambda -->|"calls run_chat"| node_run_chat
node_run_chat -->|"invokes agent"| node_agent
node_agent -->|"requests completions"| node_openai
node_agent -->|"tracks todos"| node_todo_middleware
node_agent -->|"delegates review"| node_reviewer
node_agent -->|"calls tool"| node_schedule_tool
node_schedule_tool -->|"builds schedule"| node_schedule_engine
node_run_chat -->|"fills schedule"| node_reply_assembly
node_reply_assembly -->|"reads tool output"| node_schedule_tool
node_run_chat -->|"records calls"| node_timing
node_run_chat -->|"returns reply"| node_lambda
node_lambda -->|"returns chat result"| node_chat_ui

click node_chat_ui "https://github.com/jamalla/deep-task-planner/blob/main/app/static/index.html"
click node_history "https://github.com/jamalla/deep-task-planner/blob/main/app/static/index.html"
click node_lambda "https://github.com/jamalla/deep-task-planner/blob/main/app/handler.py"
click node_request_checks "https://github.com/jamalla/deep-task-planner/blob/main/app/handler.py"
click node_run_chat "https://github.com/jamalla/deep-task-planner/blob/main/app/agent.py"
click node_agent "https://github.com/jamalla/deep-task-planner/blob/main/app/agent.py"
click node_todo_middleware "https://github.com/jamalla/deep-task-planner/blob/main/app/agent.py"
click node_reviewer "https://github.com/jamalla/deep-task-planner/blob/main/app/agent.py"
click node_schedule_tool "https://github.com/jamalla/deep-task-planner/blob/main/app/tools.py"
click node_schedule_engine "https://github.com/jamalla/deep-task-planner/blob/main/app/tools.py"
click node_reply_assembly "https://github.com/jamalla/deep-task-planner/blob/main/app/agent.py"
click node_timing "https://github.com/jamalla/deep-task-planner/blob/main/app/agent.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_chat_ui,node_history,node_user toneBlue
class node_lambda,node_request_checks toneAmber
class node_run_chat,node_agent,node_todo_middleware,node_reviewer toneMint
class node_schedule_tool,node_schedule_engine,node_reply_assembly,node_timing toneRose
class node_openai toneIndigo
```

## Components

### Chat client

- [Chat interface](https://github.com/jamalla/deep-task-planner/blob/main/app/static/index.html): `app/static/index.html`
- [Local history](https://github.com/jamalla/deep-task-planner/blob/main/app/static/index.html): `app/static/index.html`

### Request handling

- [Lambda routes](https://github.com/jamalla/deep-task-planner/blob/main/app/handler.py): `app/handler.py`
- [Access and validation](https://github.com/jamalla/deep-task-planner/blob/main/app/handler.py): `app/handler.py`

### Agent planning

- [Chat turn runner](https://github.com/jamalla/deep-task-planner/blob/main/app/agent.py): `app/agent.py`
- [Task planning agent](https://github.com/jamalla/deep-task-planner/blob/main/app/agent.py): `app/agent.py`
- [Todo middleware](https://github.com/jamalla/deep-task-planner/blob/main/app/agent.py): `app/agent.py`
- [Plan reviewer](https://github.com/jamalla/deep-task-planner/blob/main/app/agent.py): `app/agent.py`

### Scheduling and response

- [Schedule tool](https://github.com/jamalla/deep-task-planner/blob/main/app/tools.py): `app/tools.py`
- [Schedule calculation](https://github.com/jamalla/deep-task-planner/blob/main/app/tools.py): `app/tools.py`
- [Reply assembly](https://github.com/jamalla/deep-task-planner/blob/main/app/agent.py): `app/agent.py`
- [Call timings](https://github.com/jamalla/deep-task-planner/blob/main/app/agent.py): `app/agent.py`

### Other components

- **Planner user**
- **OpenAI models**

## Connections

- Planner user → Chat interface: enters goal (evidence: `README.md`)
- Chat interface → Local history: stores history (evidence: `README.md`)
- Local history → Chat interface: supplies history (evidence: `README.md`)
- Chat interface → Lambda routes: requests chat (evidence: `README.md`)
- Lambda routes → Chat interface: serves page (evidence: `app/handler.py`)
- Lambda routes → Access and validation: checks request (evidence: `app/handler.py`)
- Lambda routes → Chat turn runner: calls run_chat (evidence: `app/handler.py`)
- Chat turn runner → Task planning agent: invokes agent (evidence: `app/agent.py`)
- Task planning agent → OpenAI models: requests completions (evidence: `README.md`)
- Task planning agent → Todo middleware: tracks todos (evidence: `app/agent.py`)
- Task planning agent → Plan reviewer: delegates review (evidence: `README.md`)
- Task planning agent → Schedule tool: calls tool (evidence: `README.md`)
- Schedule tool → Schedule calculation: builds schedule (evidence: `app/tools.py`)
- Chat turn runner → Reply assembly: fills schedule (evidence: `app/agent.py`)
- Reply assembly → Schedule tool: reads tool output (evidence: `app/agent.py`)
- Chat turn runner → Call timings: records calls (evidence: `app/agent.py`)
- Chat turn runner → Lambda routes: returns reply (evidence: `app/handler.py`)
- Lambda routes → Chat interface: returns chat result (evidence: `README.md`)
