# kaaradev/agentic-interaction-ws2627 architecture

> Architecture diagram of the GitHub repository kaaradev/agentic-interaction-ws2627, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-01). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kaaradev/agentic-interaction-ws2627
- Repository: https://github.com/kaaradev/agentic-interaction-ws2627

## Overview

This is a day-and-travel planning agent: a user asks a question, the model requests calendar, weather, or transit data as needed, and the agent returns a checked answer. Transit connections are evaluated against that day’s calendar in code. Appointment creation is the sole write action and is controlled by preview or direct approval. The README documents these capabilities; links involving unsampled modules are included only where the README or source index supports them.

Main entry points: [`agent/agent.py`](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/agent.py) (Agent loop), [`agent/__main__.py`](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/__main__.py) (Command entry), [`agent/tools/__init__.py`](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/__init__.py) (Tool assembly), [`agent/tools/transit.py`](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/transit.py) (Transit lookup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Agent runtime"]
  node_entry["Command entry<br/>[__main__.py]"]
  node_config["Run configuration<br/>[config.py]"]
  node_loop["Agent loop<br/>[agent.py]"]
  node_prompts["Model prompts<br/>[prompts.py]"]
  node_llm["Model client<br/>[llm.py]"]
end

subgraph group_safety["Answer and action controls"]
  node_approval["Approval gates<br/>[approval.py]"]
  node_guards["Answer guards<br/>[guards.py]"]
  node_policies["Rate-limit policy<br/>[policies.py]"]
end

subgraph group_tools["Planning tools"]
  node_registry["Tool registry<br/>[base.py]"]
  node_toolset["Tool assembly<br/>[__init__.py]"]
  node_calendar["Calendar lookup<br/>[calendar.py]"]
  node_weather["Weather lookup<br/>[weather.py]"]
  node_transit["Transit lookup<br/>[transit.py]"]
  node_schedule["Connection checks<br/>[schedule.py]"]
  node_appointments["Appointment creation<br/>[appointments.py]"]
  node_data["Mock data access<br/>[data.py]"]
end

subgraph group_support["Run support"]
  node_log[("Run log<br/>[log.py]")]
end

node_user(("User"))
node_model["Chat endpoint"]
node_data_service["Mock data service"]
node_calendar_store[("Appointment JSONL")]

node_user -->|"submits task"| node_entry
node_entry -->|"loads settings"| node_config
node_entry -->|"starts run"| node_loop
node_entry -->|"creates log"| node_log
node_entry -->|"selects gate"| node_approval
node_loop -->|"requests completion"| node_llm
node_llm -->|"sends requests"| node_model
node_loop -->|"builds prompt"| node_prompts
node_loop -->|"describes and executes"| node_registry
node_toolset -->|"builds registry"| node_registry
node_toolset -->|"registers"| node_calendar
node_toolset -->|"registers"| node_weather
node_toolset -->|"registers"| node_transit
node_toolset -->|"registers"| node_appointments
node_calendar -->|"fetches calendar"| node_data
node_weather -->|"fetches forecast"| node_data
node_transit -->|"fetches route data"| node_data
node_data -->|"reads JSON"| node_data_service
node_transit -->|"checks connections"| node_schedule
node_transit -->|"reads day calendar"| node_calendar_store
node_appointments -->|"appends appointment"| node_calendar_store
node_loop -->|"checks actions"| node_approval
node_approval -->|"requests approval"| node_user
node_loop -->|"checks answers"| node_guards
node_loop -->|"handles rate limits"| node_policies
node_loop -->|"records run events"| node_log
node_entry -->|"prints answer"| node_user

click node_entry "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/__main__.py"
click node_config "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/config.py"
click node_loop "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/agent.py"
click node_prompts "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/prompts.py"
click node_llm "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/llm.py"
click node_registry "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/base.py"
click node_toolset "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/__init__.py"
click node_calendar "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/calendar.py"
click node_weather "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/weather.py"
click node_transit "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/transit.py"
click node_schedule "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/schedule.py"
click node_appointments "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/appointments.py"
click node_data "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/data.py"
click node_approval "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/approval.py"
click node_guards "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/guards.py"
click node_policies "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/policies.py"
click node_log "https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/log.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_entry,node_config,node_loop,node_prompts,node_llm,node_user toneBlue
class node_approval,node_guards,node_policies,node_calendar_store toneAmber
class node_registry,node_toolset,node_calendar,node_weather,node_transit,node_schedule,node_appointments,node_data toneMint
class node_log toneRose
class node_model,node_data_service toneIndigo
```

## Components

### Agent runtime

- [Command entry](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/__main__.py): `agent/__main__.py`
- [Run configuration](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/config.py): `agent/config.py`
- [Agent loop](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/agent.py): `agent/agent.py`
- [Model prompts](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/prompts.py): `agent/prompts.py`
- [Model client](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/llm.py): `agent/llm.py`

### Answer and action controls

- [Approval gates](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/approval.py): `agent/approval.py`
- [Answer guards](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/guards.py): `agent/guards.py`
- [Rate-limit policy](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/policies.py): `agent/policies.py`

### Planning tools

- [Tool registry](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/base.py): `agent/tools/base.py`
- [Tool assembly](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/__init__.py): `agent/tools/__init__.py`
- [Calendar lookup](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/calendar.py): `agent/tools/calendar.py`
- [Weather lookup](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/weather.py): `agent/tools/weather.py`
- [Transit lookup](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/transit.py): `agent/tools/transit.py`
- [Connection checks](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/schedule.py): `agent/tools/schedule.py`
- [Appointment creation](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/appointments.py): `agent/tools/appointments.py`
- [Mock data access](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/tools/data.py): `agent/tools/data.py`

### Run support

- [Run log](https://github.com/kaaradev/agentic-interaction-ws2627/blob/main/agent/log.py): `agent/log.py`

### Other components

- **User**
- **Chat endpoint**
- **Mock data service**
- **Appointment JSONL**

## Connections

- User → Command entry: submits task (evidence: `README.md`)
- Command entry → Run configuration: loads settings (evidence: `README.md`)
- Command entry → Agent loop: starts run (evidence: `README.md`)
- Command entry → Run log: creates log (evidence: `README.md`)
- Command entry → Approval gates: selects gate (evidence: `README.md`)
- Agent loop → Model client: requests completion (evidence: `README.md`)
- Model client → Chat endpoint: sends requests (evidence: `agent/llm.py`)
- Agent loop → Model prompts: builds prompt (evidence: `agent/agent.py`)
- Agent loop → Tool registry: describes and executes (evidence: `agent/agent.py`)
- Tool assembly → Tool registry: builds registry (evidence: `agent/tools/__init__.py`)
- Tool assembly → Calendar lookup: registers (evidence: `agent/tools/__init__.py`)
- Tool assembly → Weather lookup: registers (evidence: `agent/tools/__init__.py`)
- Tool assembly → Transit lookup: registers (evidence: `agent/tools/__init__.py`)
- Tool assembly → Appointment creation: registers (evidence: `agent/tools/__init__.py`)
- Calendar lookup → Mock data access: fetches calendar (evidence: `agent/tools/calendar.py`)
- Weather lookup → Mock data access: fetches forecast (evidence: `agent/tools/weather.py`)
- Transit lookup → Mock data access: fetches route data (evidence: `agent/tools/transit.py`)
- Mock data access → Mock data service: reads JSON (evidence: `agent/tools/data.py`)
- Transit lookup → Connection checks: checks connections (evidence: `agent/tools/transit.py`)
- Transit lookup → Appointment JSONL: reads day calendar (evidence: `README.md`)
- Appointment creation → Appointment JSONL: appends appointment (evidence: `README.md`)
- Agent loop → Approval gates: checks actions (evidence: `README.md`)
- Approval gates → User: requests approval (evidence: `README.md`)
- Agent loop → Answer guards: checks answers (evidence: `README.md`)
- Agent loop → Rate-limit policy: handles rate limits (evidence: `README.md`)
- Agent loop → Run log: records run events (evidence: `README.md`)
- Command entry → User: prints answer (evidence: `README.md`)
