# langchain-ai/langchain-academy architecture

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

- Interactive diagram: https://gitdiagram.com/langchain-ai/langchain-academy
- Repository: https://github.com/langchain-ai/langchain-academy

## Overview

#### Purpose and Execution Model
This is a LangChain Academy course repository for learning LangGraph through progressively advanced, runnable examples. Primary entry points are Jupyter notebooks for guided lessons and LangGraph Studio graph modules for interactive local execution. The supported runtime is Python 3.11–3.13.

Paths: `module-0/basics.ipynb`, `module-1/agent.ipynb`, `module-6/assistant.ipynb`

#### Curriculum Structure
Modules are organized as a capability progression rather than one integrated application:
- Module 0 establishes environment and basic concepts.
- Modules 1–5 build graph agents, state, human intervention, parallelism, and memory.
- Module 6 focuses on deployment and production interaction patterns.

Notebook variants demonstrate each concept independently; Studio implementations are the executable graph equivalents where present.

Paths: `module-1/simple-graph.ipynb`, `module-3/time-travel.ipynb`, `module-4/research-assistant.ipynb`

#### Graph Agent Foundations
Module 1 defines the baseline LangGraph patterns: linear chains, simple state graphs, tool/agent behavior, routing, and agent memory. Its Studio graphs are likely the first reusable executable targets for `langgraph dev`.

Paths: `module-1/studio/simple.py`, `module-1/studio/agent.py`, `module-1/studio/router.py`

#### State, Persistence, and Message Management
Module 2 centers on graph state schemas and reducers, including message trimming/filtering and persistent conversational state. The checked-in SQLite database supports the state/persistence examples, establishing a local storage boundary rather than requiring a remote database.

Paths: `module-2/studio/chatbot.py`, `module-2/state_db/example.db`, `module-2/state-reducers.ipynb`

#### Human-in-the-Loop Control
Module 3 demonstrates execution interruption and recovery: static/dynamic breakpoints, streamed interruption, human edits to graph state, and time travel. These examples define a control boundary where graph execution can pause, expose state for review, then resume from altered or historical checkpoints.

Paths: `module-3/studio/agent.py`, `module-3/studio/dynamic_breakpoints.py`, `module-3/edit-state-human-feedback.ipynb`

#### Parallel and Hierarchical Workflows
Module 4 covers fan-out/fan-in and decomposition patterns: parallelization, map-reduce, research workflows, and subgraphs. The research assistant is the principal external-data workflow and uses Tavily for web search; results are coordinated through LangGraph rather than a standalone service layer.

Paths: `module-4/studio/parallelization.py`, `module-4/studio/map_reduce.py`, `module-4/studio/research_assistant.py`

#### Long-Term Memory and Deployment
Module 5 expands from session state into durable memory models: agent memory, generic stores, collection schemas, and profile schemas, with shared configuration guiding those graph variants. Module 6 provides deployment-oriented graph code plus Docker Compose example configuration and covers connection/creation, assistant behavior, and double-texting.

Paths: `module-5/studio/memory_agent.py`, `module-5/studio/memory_store.py`, `module-6/deployment/task_maistro.py`

#### Runtime, Infrastructure, and External Services
Each Studio directory is a self-contained local LangGraph deployment unit: `langgraph.json` identifies graph exports, `requirements.txt` defines module dependencies, and `.env` supplies secrets. `langgraph dev` exposes a local API and connects it to LangGraph Studio. OpenAI supplies LLM inference; LangSmith provides tracing and Studio hosting/UI integration; Tavily is used for search-oriented lessons.

Paths: `module-1/studio/langgraph.json`, `module-4/studio/.env.example`, `module-6/deployment/docker-compose-example.yml`

Main entry points: [`module-1/agent.ipynb`](https://github.com/langchain-ai/langchain-academy/blob/main/module-1/agent.ipynb) (Module 1 agents), [`module-2/state-reducers.ipynb`](https://github.com/langchain-ai/langchain-academy/blob/main/module-2/state-reducers.ipynb) (State reducers), [`module-3/edit-state-human-feedback.ipynb`](https://github.com/langchain-ai/langchain-academy/blob/main/module-3/edit-state-human-feedback.ipynb) (Human feedback), [`module-4/research-assistant.ipynb`](https://github.com/langchain-ai/langchain-academy/blob/main/module-4/research-assistant.ipynb) (Research assistant)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_curriculum["Curriculum Modules"]
  node_m0["Module 0 basics<br/>lesson notebook<br/>[basics.ipynb]"]
  node_m1["Module 1 agents<br/>lesson notebook<br/>[agent.ipynb]"]
  node_m2["State reducers<br/>lesson notebook"]
  node_m3["Human feedback<br/>lesson notebook"]
  node_m4["Research assistant<br/>lesson notebook"]
  node_m5["Durable memory<br/>memory lessons"]
  node_m6["Module 6 assistant<br/>lesson notebook<br/>[assistant.ipynb]"]
end

subgraph group_studio["Studio Graph Units"]
  node_foundation_graphs{{"Foundation graphs<br/>Studio graphs<br/>[agent.py]"}}
  node_state_graph{{"Persistent chatbot<br/>Studio graph<br/>[chatbot.py]"}}
  node_sqlite[("Local state DB<br/>SQLite<br/>[example.db]")]
  node_hitl_graphs{{"Interruptible graphs<br/>Studio graphs"}}
  node_parallel_graphs{{"Parallel research graphs<br/>Studio graphs"}}
  node_memory_graphs{{"Memory graphs<br/>Studio graphs<br/>[memory_store.py]"}}
  node_deployment_graph{{"Deployment graph<br/>production graph<br/>[task_maistro.py]"}}
end

subgraph group_runtime["Local Runtime"]
  node_studio_manifest["Studio manifest<br/>graph exports<br/>[langgraph.json]"]
  node_langgraph_dev["langgraph dev<br/>local API runtime"]
  node_compose["Docker Compose example<br/>deployment config"]
end

subgraph group_services["External Services"]
  node_openai(("OpenAI<br/>LLM inference"))
  node_tavily(("Tavily<br/>web search"))
  node_langsmith(("LangSmith / Studio<br/>tracing and UI"))
end

node_m0 -->|"builds toward"| node_m1
node_m1 -->|"extends state"| node_m2
node_m2 -->|"adds control"| node_m3
node_m3 -->|"scales workflows"| node_m4
node_m4 -->|"adds durability"| node_m5
node_m5 -->|"prepares deployment"| node_m6
node_m1 -.->|"implemented as"| node_foundation_graphs
node_m2 -.->|"implemented as"| node_state_graph
node_state_graph -->|"persists state"| node_sqlite
node_m3 -.->|"implemented as"| node_hitl_graphs
node_m4 -.->|"implemented as"| node_parallel_graphs
node_m5 -.->|"implemented as"| node_memory_graphs
node_m6 -.->|"implemented as"| node_deployment_graph
node_studio_manifest -->|"declares exports for"| node_langgraph_dev
node_langgraph_dev -->|"runs"| node_foundation_graphs
node_langgraph_dev -->|"runs"| node_state_graph
node_langgraph_dev -->|"runs"| node_hitl_graphs
node_langgraph_dev -->|"runs"| node_parallel_graphs
node_langgraph_dev -->|"runs"| node_memory_graphs
node_compose -->|"deploys example"| node_deployment_graph
node_foundation_graphs -->|"uses LLM"| node_openai
node_parallel_graphs -->|"searches web"| node_tavily
node_langgraph_dev -->|"connects Studio and tracing"| node_langsmith

click node_m0 "https://github.com/langchain-ai/langchain-academy/blob/main/module-0/basics.ipynb"
click node_m1 "https://github.com/langchain-ai/langchain-academy/blob/main/module-1/agent.ipynb"
click node_m2 "https://github.com/langchain-ai/langchain-academy/blob/main/module-2/state-reducers.ipynb"
click node_m3 "https://github.com/langchain-ai/langchain-academy/blob/main/module-3/edit-state-human-feedback.ipynb"
click node_m4 "https://github.com/langchain-ai/langchain-academy/blob/main/module-4/research-assistant.ipynb"
click node_m6 "https://github.com/langchain-ai/langchain-academy/blob/main/module-6/assistant.ipynb"
click node_foundation_graphs "https://github.com/langchain-ai/langchain-academy/blob/main/module-1/studio/agent.py"
click node_state_graph "https://github.com/langchain-ai/langchain-academy/blob/main/module-2/studio/chatbot.py"
click node_sqlite "https://github.com/langchain-ai/langchain-academy/blob/main/module-2/state_db/example.db"
click node_hitl_graphs "https://github.com/langchain-ai/langchain-academy/blob/main/module-3/studio/dynamic_breakpoints.py"
click node_parallel_graphs "https://github.com/langchain-ai/langchain-academy/blob/main/module-4/studio/research_assistant.py"
click node_memory_graphs "https://github.com/langchain-ai/langchain-academy/blob/main/module-5/studio/memory_store.py"
click node_deployment_graph "https://github.com/langchain-ai/langchain-academy/blob/main/module-6/deployment/task_maistro.py"
click node_studio_manifest "https://github.com/langchain-ai/langchain-academy/blob/main/module-1/studio/langgraph.json"
click node_compose "https://github.com/langchain-ai/langchain-academy/blob/main/module-6/deployment/docker-compose-example.yml"

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_m0,node_m1,node_m2,node_m3,node_m4,node_m5,node_m6 toneBlue
class node_foundation_graphs,node_state_graph,node_sqlite,node_hitl_graphs,node_parallel_graphs,node_memory_graphs,node_deployment_graph toneAmber
class node_studio_manifest,node_langgraph_dev,node_compose toneMint
class node_openai,node_tavily,node_langsmith toneRose
```

## Components

### Curriculum Modules

Independent notebook lessons progress from basics to deployment.

- [Module 0 basics](https://github.com/langchain-ai/langchain-academy/blob/main/module-0/basics.ipynb): lesson notebook · Environment and LangGraph foundations. · `module-0/basics.ipynb`
- [Module 1 agents](https://github.com/langchain-ai/langchain-academy/blob/main/module-1/agent.ipynb): lesson notebook · Chains, state graphs, tools, routing, and memory. · `module-1/agent.ipynb`
- [State reducers](https://github.com/langchain-ai/langchain-academy/blob/main/module-2/state-reducers.ipynb): lesson notebook · State schemas, reducers, and message management. · `module-2/state-reducers.ipynb`
- [Human feedback](https://github.com/langchain-ai/langchain-academy/blob/main/module-3/edit-state-human-feedback.ipynb): lesson notebook · State editing and interrupted execution recovery. · `module-3/edit-state-human-feedback.ipynb`
- [Research assistant](https://github.com/langchain-ai/langchain-academy/blob/main/module-4/research-assistant.ipynb): lesson notebook · Parallel research and coordinated external search. · `module-4/research-assistant.ipynb`
- **Durable memory**: memory lessons · Agent memory, stores, collections, and profiles.
- [Module 6 assistant](https://github.com/langchain-ai/langchain-academy/blob/main/module-6/assistant.ipynb): lesson notebook · Deployment and production interaction patterns. · `module-6/assistant.ipynb`

### Studio Graph Units

Runnable LangGraph graph implementations.

- [Foundation graphs](https://github.com/langchain-ai/langchain-academy/blob/main/module-1/studio/agent.py): Studio graphs · Simple, agent, and router executable graph patterns. · `module-1/studio/agent.py`
- [Persistent chatbot](https://github.com/langchain-ai/langchain-academy/blob/main/module-2/studio/chatbot.py): Studio graph · Conversation state and reducer-based message handling. · `module-2/studio/chatbot.py`
- [Local state DB](https://github.com/langchain-ai/langchain-academy/blob/main/module-2/state_db/example.db): SQLite · Checked-in persistence for state examples. · `module-2/state_db/example.db`
- [Interruptible graphs](https://github.com/langchain-ai/langchain-academy/blob/main/module-3/studio/dynamic_breakpoints.py): Studio graphs · Dynamic breakpoints pause, expose, and resume graph state. · `module-3/studio/dynamic_breakpoints.py`
- [Parallel research graphs](https://github.com/langchain-ai/langchain-academy/blob/main/module-4/studio/research_assistant.py): Studio graphs · Fan-out/fan-in, map-reduce, and research workflows. · `module-4/studio/research_assistant.py`
- [Memory graphs](https://github.com/langchain-ai/langchain-academy/blob/main/module-5/studio/memory_store.py): Studio graphs · Durable agent memory and generic store patterns. · `module-5/studio/memory_store.py`
- [Deployment graph](https://github.com/langchain-ai/langchain-academy/blob/main/module-6/deployment/task_maistro.py): production graph · Assistant deployment-oriented workflow. · `module-6/deployment/task_maistro.py`

### Local Runtime

Local development and interactive graph execution boundary.

- [Studio manifest](https://github.com/langchain-ai/langchain-academy/blob/main/module-1/studio/langgraph.json): graph exports · Declares graph exports for local development. · `module-1/studio/langgraph.json`
- **langgraph dev**: local API runtime · Runs a Studio unit locally and exposes its graph API.
- [Docker Compose example](https://github.com/langchain-ai/langchain-academy/blob/main/module-6/deployment/docker-compose-example.yml): deployment config · Example deployment infrastructure configuration. · `module-6/deployment/docker-compose-example.yml`

### External Services

- **OpenAI**: LLM inference
- **Tavily**: web search
- **LangSmith / Studio**: tracing and UI · Tracing plus interactive Studio integration.

## Connections

- Module 0 basics → Module 1 agents: builds toward
- Module 1 agents → State reducers: extends state
- State reducers → Human feedback: adds control
- Human feedback → Research assistant: scales workflows
- Research assistant → Durable memory: adds durability
- Durable memory → Module 6 assistant: prepares deployment
- Module 1 agents → Foundation graphs: implemented as
- State reducers → Persistent chatbot: implemented as
- Persistent chatbot → Local state DB: persists state
- Human feedback → Interruptible graphs: implemented as
- Research assistant → Parallel research graphs: implemented as
- Durable memory → Memory graphs: implemented as
- Module 6 assistant → Deployment graph: implemented as
- Studio manifest → langgraph dev: declares exports for
- langgraph dev → Foundation graphs: runs
- langgraph dev → Persistent chatbot: runs
- langgraph dev → Interruptible graphs: runs
- langgraph dev → Parallel research graphs: runs
- langgraph dev → Memory graphs: runs
- Docker Compose example → Deployment graph: deploys example
- Foundation graphs → OpenAI: uses LLM
- Parallel research graphs → Tavily: searches web
- langgraph dev → LangSmith / Studio: connects Studio and tracing
