# lior-gr/ai_agents_lectures architecture

> Architecture diagram of the GitHub repository lior-gr/ai_agents_lectures, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-04-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lior-gr/ai_agents_lectures
- Repository: https://github.com/lior-gr/ai_agents_lectures

## Overview

1. This repository has two major concerns: a tutorial/content track under `Lessons/`, and a runnable reference application under `task_manager/`. The lesson material explains the architecture progressively, while `task_manager` is the concrete example being evolved.

2. The lesson content exists in two forms: Markdown source in `Lessons/md_only/` and a generated/static tutorial site in `Lessons/tutorial_site/`. `Lessons/full_tutorial.html` appears to be a compiled single-page version. The site layer is a simple static frontend (`index.html`, per-lesson HTML, `style.css`, `app.js`) that presents the written lessons.

3. The `task_manager` package is the application architecture to diagram. It is a Python app with a small, explicit set of modules: `main.py` as the entry point, `agent.py` for the agent loop, `ui.py` for the user-facing boundary, `storage.py` for persistence, `tools.py` for callable operations, `mcp_client.py` / `mcp_server.py` for model-context-protocol integration, and `skill_router.py` for skill selection.

4. The core data flow is likely: user intent enters through the UI, `main.py` wires the pieces together, `agent.py` orchestrates the loop, `skill_router.py` chooses which skills apply, `tools.py` exposes task operations, and `storage.py` persists state. The response then returns back through the UI boundary.

5. The architecture is intentionally split between orchestration and capability execution. `agent.py` handles the control loop, while `tools.py` and `storage.py` hold the task-domain mechanics. This separation is important for an architecture diagram because it shows the app is not a monolith; it has a coordinator plus distinct service layers.

6. MCP is used as a decoupling boundary. The presence of both `mcp_client.py` and `mcp_server.py` suggests the app can separate the agent from tool execution, with the client side invoking externally exposed capabilities and the server side hosting them. That boundary is central to the “MCP Decoupling” lesson.

7. The skills system is another key subsystem. `task_manager/skills/` contains markdown skill documents such as `task_planning.md`, `task_deletion.md`, `status_reporting.md`, `output_format.md`, and `always_on.md`. These are not code modules; they are behavior/policy artifacts that guide the agent’s responses and tool use.

8. `skill_router.py` is the bridge between the agent and those skill documents. Its role is to decide which skill context should be active for a given request, which is why the repo also includes lessons about “bounded model skill routing.” For architecture purposes, treat this as a policy-selection layer between intent parsing and execution.

9. The `clarification_log.md` file indicates the system records uncertain or ambiguous interactions. That suggests a feedback loop where the agent can defer, ask for more information, or capture unresolved intent before acting on task data.

10. The `task_manager/README.md` and top-level tutorial materials imply the project is educational as well as functional. The codebase is designed to demonstrate an incremental path: baseline task manager, minimal agent loop, MCP decoupling, skills, and then the UI boundary.

11. The repo also has process/tooling boundaries worth noting: `.githooks/` contains git hooks, and the root README calls out Git LFS for media assets. Those are support concerns, not runtime dependencies, but they matter if you are diagramming the project’s build/content workflow rather than just the app.

12. If you are drawing the architecture, the clearest top-level separation is: static lesson content pipeline, Python task-manager runtime, and protocol/policy layers inside the runtime. The runtime itself is organized around four main boundaries: UI, agent orchestration, skill/tool selection, and persistence/external tool access.

Main entry points: [`task_manager/agent.py`](https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/agent.py) (Agent loop), [`Lessons/md_only`](https://github.com/lior-gr/ai_agents_lectures/tree/main/Lessons/md_only) (Lesson drafts), [`task_manager/main.py`](https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/main.py) (Main entry), [`task_manager/ui.py`](https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/ui.py) (UI boundary)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_lessons["Lessons"]
  node_lesson_md["Lesson drafts<br/>content source"]
  node_lesson_site["Tutorial site<br/>static site"]
  node_full_tutorial["Full tutorial<br/>compiled tutorial<br/>[full_tutorial.html]"]
  node_tutorial_guidance["Guidance skill<br/>content policy"]
  node_style_notes["Style notes<br/>content policy"]
end

subgraph group_runtime["Task Manager"]
  node_main["Main entry<br/>bootstrap<br/>[main.py]"]
  node_ui["UI boundary<br/>interface<br/>[ui.py]"]
  node_agent["Agent loop<br/>orchestrator<br/>[agent.py]"]
  node_router["Skill router<br/>policy selector<br/>[skill_router.py]"]
  node_skills["Skills<br/>behavior docs"]
  node_tools["Tools<br/>task ops<br/>[tools.py]"]
  node_storage[("Storage<br/>persistence<br/>[storage.py]")]
  node_mcp_client["MCP client<br/>protocol client<br/>[mcp_client.py]"]
  node_mcp_server["MCP server<br/>protocol server<br/>[mcp_server.py]"]
  node_clarifications["Clarifications<br/>interaction log"]
end

subgraph group_support["Support"]
  node_readme["Repo README<br/>docs<br/>[README.md]"]
  node_githooks["Git hooks<br/>workflow<br/>[.githooks]"]
end

node_readme -->|"introduces"| node_lesson_md
node_readme -->|"introduces"| node_main
node_lesson_md -->|"generates"| node_lesson_site
node_lesson_md -->|"compiles to"| node_full_tutorial
node_tutorial_guidance -->|"shapes"| node_lesson_md
node_style_notes -->|"shapes"| node_lesson_site
node_main -->|"wires"| node_ui
node_main -->|"wires"| node_agent
node_ui -->|"submits intent"| node_agent
node_agent -->|"selects skills"| node_router
node_router -->|"activates"| node_skills
node_agent -->|"invokes"| node_mcp_client
node_mcp_client -->|"requests"| node_mcp_server
node_mcp_server -->|"exposes"| node_tools
node_agent -->|"uses"| node_tools
node_tools -->|"persists"| node_storage
node_agent -->|"reads state"| node_storage
node_agent -->|"records ambiguity"| node_clarifications
node_ui -->|"surfaces"| node_clarifications

click node_readme "https://github.com/lior-gr/ai_agents_lectures/blob/main/README.md"
click node_githooks "https://github.com/lior-gr/ai_agents_lectures/blob/main/.githooks"
click node_lesson_md "https://github.com/lior-gr/ai_agents_lectures/tree/main/Lessons/md_only"
click node_lesson_site "https://github.com/lior-gr/ai_agents_lectures/tree/main/Lessons/tutorial_site"
click node_full_tutorial "https://github.com/lior-gr/ai_agents_lectures/blob/main/Lessons/full_tutorial.html"
click node_tutorial_guidance "https://github.com/lior-gr/ai_agents_lectures/blob/main/Lessons/tutorial_content_guidance_skill.md"
click node_style_notes "https://github.com/lior-gr/ai_agents_lectures/blob/main/Lessons/tutorial_style_notes_skill.md"
click node_main "https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/main.py"
click node_ui "https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/ui.py"
click node_agent "https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/agent.py"
click node_router "https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/skill_router.py"
click node_skills "https://github.com/lior-gr/ai_agents_lectures/tree/main/task_manager/skills"
click node_tools "https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/tools.py"
click node_storage "https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/storage.py"
click node_mcp_client "https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/mcp_client.py"
click node_mcp_server "https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/mcp_server.py"
click node_clarifications "https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/clarification_log.md"

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_lesson_md,node_lesson_site,node_full_tutorial,node_tutorial_guidance,node_style_notes toneBlue
class node_main,node_ui,node_agent,node_router,node_skills,node_tools,node_storage,node_mcp_client,node_mcp_server,node_clarifications toneAmber
class node_readme,node_githooks toneMint
```

## Components

### Lessons

Tutorial source, compiled material, and site presentation for the architecture walkthrough.

- [Lesson drafts](https://github.com/lior-gr/ai_agents_lectures/tree/main/Lessons/md_only): content source · Markdown lesson sources that define the tutorial progression. · `Lessons/md_only`
- [Tutorial site](https://github.com/lior-gr/ai_agents_lectures/tree/main/Lessons/tutorial_site): static site · Generated static frontend for reading the tutorial lessons. · `Lessons/tutorial_site`
- [Full tutorial](https://github.com/lior-gr/ai_agents_lectures/blob/main/Lessons/full_tutorial.html): compiled tutorial · Single-page compiled version of the tutorial content. · `Lessons/full_tutorial.html`
- [Guidance skill](https://github.com/lior-gr/ai_agents_lectures/blob/main/Lessons/tutorial_content_guidance_skill.md): content policy · Instructions that shape the tutorial content and style. · `Lessons/tutorial_content_guidance_skill.md`
- [Style notes](https://github.com/lior-gr/ai_agents_lectures/blob/main/Lessons/tutorial_style_notes_skill.md): content policy · Notes for tutorial styling and presentation conventions. · `Lessons/tutorial_style_notes_skill.md`

### Task Manager

Runnable Python application and its control/data boundaries.

- [Main entry](https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/main.py): bootstrap · Application startup and wiring for the task manager runtime. · `task_manager/main.py`
- [UI boundary](https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/ui.py): interface · User-facing boundary where intent enters and responses return. · `task_manager/ui.py`
- [Agent loop](https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/agent.py): orchestrator · Coordinates the conversational/control loop for the task manager. · `task_manager/agent.py`
- [Skill router](https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/skill_router.py): policy selector · Selects which skill context should be active for a request. · `task_manager/skill_router.py`
- [Skills](https://github.com/lior-gr/ai_agents_lectures/tree/main/task_manager/skills): behavior docs · Markdown skill artifacts that shape planning, deletion, status, and output behavior. · `task_manager/skills`
- [Tools](https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/tools.py): task ops · Callable task-domain operations exposed to the agent. · `task_manager/tools.py`
- [Storage](https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/storage.py): persistence · Persists task state and related application data. · `task_manager/storage.py`
- [MCP client](https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/mcp_client.py): protocol client · Client-side boundary for invoking externally exposed capabilities. · `task_manager/mcp_client.py`
- [MCP server](https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/mcp_server.py): protocol server · Server-side boundary that hosts tool access over MCP. · `task_manager/mcp_server.py`
- [Clarifications](https://github.com/lior-gr/ai_agents_lectures/blob/main/task_manager/clarification_log.md): interaction log · Records ambiguous or uncertain interactions for later resolution. · `task_manager/clarification_log.md`

### Support

Repository-level documentation and workflow helpers.

- [Repo README](https://github.com/lior-gr/ai_agents_lectures/blob/main/README.md): docs · Top-level project overview and entry point to the repo narrative. · `README.md`
- [Git hooks](https://github.com/lior-gr/ai_agents_lectures/blob/main/.githooks): workflow · Repository automation hooks for local Git events. · `.githooks`

## Connections

- Repo README → Lesson drafts: introduces · The repository README points readers toward the tutorial material.
- Repo README → Main entry: introduces · The repository README also frames the runnable task manager example.
- Lesson drafts → Tutorial site: generates · Markdown lesson sources feed the static tutorial site.
- Lesson drafts → Full tutorial: compiles to · The lesson set is compiled into a single-page tutorial artifact.
- Guidance skill → Lesson drafts: shapes · Tutorial guidance influences the authored lesson content.
- Style notes → Tutorial site: shapes · Style notes inform the presentation layer of the tutorial site.
- Main entry → UI boundary: wires · Startup assembles the user-facing boundary.
- Main entry → Agent loop: wires · Startup creates and connects the agent orchestration loop.
- UI boundary → Agent loop: submits intent · User intent passes from the UI boundary into the agent.
- Agent loop → Skill router: selects skills · The agent asks the router which skill context applies.
- Skill router → Skills: activates · The router chooses among the skill documents.
- Agent loop → MCP client: invokes · The agent can call capabilities through the MCP client boundary.
- MCP client → MCP server: requests · Client and server form the decoupled MCP link.
- MCP server → Tools: exposes · The server hosts the task operations as MCP-accessible tools.
- Agent loop → Tools: uses · The orchestration loop ultimately drives task operations.
- Tools → Storage: persists · Task operations read and update application state through storage.
- Agent loop → Storage: reads state · The agent consults persisted task state during the loop.
- Agent loop → Clarifications: records ambiguity · Unclear interactions are captured for later resolution.
- UI boundary → Clarifications: surfaces · The user-facing layer can surface or collect clarifying interactions.
