# campusx-official/langgraph-tutorials architecture

> Architecture diagram of the GitHub repository campusx-official/langgraph-tutorials, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/campusx-official/langgraph-tutorials
- Repository: https://github.com/campusx-official/langgraph-tutorials

## Overview

This repository is a collection of LangGraph learning examples, spanning simple workflows, chatbots, persistence, tools, retrieval, human approval, subgraphs, and MCP. The clearest executable workflow is the stock chatbot: a user turn enters the compiled graph, the chat node calls an LLM, and conditional tool dispatch can fetch a quote or request a purchase. The HITL version pauses for human approval; the MCP example loads tools from configured servers. Notebook contents and a README were unavailable, so their connections are not inferred.

Main entry points: [`chatbot_without_hitl.py`](https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_without_hitl.py) (Chat graph), [`chatbot_with_hitl.py`](https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_with_hitl.py) (Approval graph), [`12_mcp.py`](https://github.com/campusx-official/langgraph-tutorials/blob/main/12_mcp.py) (MCP client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_learning["Workflow examples"]
  node_bmi["BMI workflow"]
  node_simple_llm["Simple LLM"]
  node_prompt_chain["Prompt chaining"]
  node_batsman["Batsman workflow"]
  node_essay["Essay workflow"]
  node_quadratic["Quadratic workflow"]
  node_review["Review reply"]
  node_xpost["X post generator"]
  node_basic_chat["Basic chatbot"]
  node_persistence["Persistence"]
  node_tools_example["Tool examples<br/>[11_tools.ipynb]"]
  node_rag["RAG example<br/>[13_rag.ipynb]"]
  node_hitl_example["HITL example<br/>[14_hitl.ipynb]"]
  node_shared_subgraphs["Shared subgraphs"]
  node_subgraphs["Subgraphs<br/>[15_subgraphs.ipynb]"]
end

subgraph group_chat["Chatbot runtime"]
  node_cli_hitl["HITL CLI"]
  node_cli_plain["Chat CLI"]
  node_chat_graph["Chat graph"]
  node_hitl_graph["Approval graph"]
end

subgraph group_integrations["Tools and integrations"]
  node_llm["Chat model"]
  node_tools["Tool dispatcher"]
  node_stock_quote["Stock quote tool"]
  node_purchase["Purchase tool"]
  node_mcp["MCP workflow<br/>[12_mcp.py]"]
  node_mcp_client["MCP client<br/>[12_mcp.py]"]
end

node_user(("User"))
node_stock_api["Alpha Vantage"]
node_human(("Approving human"))
node_mcp_servers["MCP servers"]

node_user -->|"enters turn"| node_cli_plain
node_cli_plain -->|"invokes graph"| node_chat_graph
node_chat_graph -->|"calls model"| node_llm
node_chat_graph -->|"dispatches tools"| node_tools
node_tools -->|"runs tool"| node_stock_quote
node_stock_quote -->|"requests quote"| node_stock_api
node_user -->|"enters turn"| node_cli_hitl
node_cli_hitl -->|"invokes graph"| node_hitl_graph
node_hitl_graph -->|"dispatches tool"| node_purchase
node_purchase -->|"requests approval"| node_human
node_human -->|"provides decision"| node_cli_hitl
node_hitl_graph -->|"calls model"| node_llm
node_mcp -->|"loads tools"| node_mcp_client
node_mcp_client -->|"connects servers"| node_mcp_servers

click node_bmi "https://github.com/campusx-official/langgraph-tutorials/blob/main/1_bmi_workflow.ipynb"
click node_simple_llm "https://github.com/campusx-official/langgraph-tutorials/blob/main/2_simple_llm_workflow.ipynb"
click node_prompt_chain "https://github.com/campusx-official/langgraph-tutorials/blob/main/3_prompt_chaining.ipynb"
click node_batsman "https://github.com/campusx-official/langgraph-tutorials/blob/main/4_batsman_workflow.ipynb"
click node_essay "https://github.com/campusx-official/langgraph-tutorials/blob/main/5_UPSC_essay_workflow.ipynb"
click node_quadratic "https://github.com/campusx-official/langgraph-tutorials/blob/main/6_quadratic_equation_workflow.ipynb"
click node_review "https://github.com/campusx-official/langgraph-tutorials/blob/main/7_review_reply_workflow.ipynb"
click node_xpost "https://github.com/campusx-official/langgraph-tutorials/blob/main/8_X_post_generator.ipynb"
click node_basic_chat "https://github.com/campusx-official/langgraph-tutorials/blob/main/9_basic_chatbot.ipynb"
click node_persistence "https://github.com/campusx-official/langgraph-tutorials/blob/main/10_persistence.ipynb"
click node_tools_example "https://github.com/campusx-official/langgraph-tutorials/blob/main/11_tools.ipynb"
click node_rag "https://github.com/campusx-official/langgraph-tutorials/blob/main/13_rag.ipynb"
click node_hitl_example "https://github.com/campusx-official/langgraph-tutorials/blob/main/14_hitl.ipynb"
click node_shared_subgraphs "https://github.com/campusx-official/langgraph-tutorials/blob/main/15_subgraph_shared.ipynb"
click node_subgraphs "https://github.com/campusx-official/langgraph-tutorials/blob/main/15_subgraphs.ipynb"
click node_cli_hitl "https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_with_hitl.py"
click node_cli_plain "https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_without_hitl.py"
click node_chat_graph "https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_without_hitl.py"
click node_hitl_graph "https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_with_hitl.py"
click node_llm "https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_without_hitl.py"
click node_tools "https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_without_hitl.py"
click node_stock_quote "https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_without_hitl.py"
click node_purchase "https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_with_hitl.py"
click node_mcp "https://github.com/campusx-official/langgraph-tutorials/blob/main/12_mcp.py"
click node_mcp_client "https://github.com/campusx-official/langgraph-tutorials/blob/main/12_mcp.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_bmi,node_simple_llm,node_prompt_chain,node_batsman,node_essay,node_quadratic,node_review,node_xpost,node_basic_chat,node_persistence,node_tools_example,node_rag,node_hitl_example,node_shared_subgraphs,node_subgraphs,node_user toneBlue
class node_cli_hitl,node_cli_plain,node_chat_graph,node_hitl_graph toneAmber
class node_llm,node_tools,node_stock_quote,node_purchase,node_mcp,node_mcp_client,node_mcp_servers toneMint
class node_stock_api,node_human toneIndigo
```

## Components

### Workflow examples

- [BMI workflow](https://github.com/campusx-official/langgraph-tutorials/blob/main/1_bmi_workflow.ipynb): `1_bmi_workflow.ipynb`
- [Simple LLM](https://github.com/campusx-official/langgraph-tutorials/blob/main/2_simple_llm_workflow.ipynb): `2_simple_llm_workflow.ipynb`
- [Prompt chaining](https://github.com/campusx-official/langgraph-tutorials/blob/main/3_prompt_chaining.ipynb): `3_prompt_chaining.ipynb`
- [Batsman workflow](https://github.com/campusx-official/langgraph-tutorials/blob/main/4_batsman_workflow.ipynb): `4_batsman_workflow.ipynb`
- [Essay workflow](https://github.com/campusx-official/langgraph-tutorials/blob/main/5_UPSC_essay_workflow.ipynb): `5_UPSC_essay_workflow.ipynb`
- [Quadratic workflow](https://github.com/campusx-official/langgraph-tutorials/blob/main/6_quadratic_equation_workflow.ipynb): `6_quadratic_equation_workflow.ipynb`
- [Review reply](https://github.com/campusx-official/langgraph-tutorials/blob/main/7_review_reply_workflow.ipynb): `7_review_reply_workflow.ipynb`
- [X post generator](https://github.com/campusx-official/langgraph-tutorials/blob/main/8_X_post_generator.ipynb): `8_X_post_generator.ipynb`
- [Basic chatbot](https://github.com/campusx-official/langgraph-tutorials/blob/main/9_basic_chatbot.ipynb): `9_basic_chatbot.ipynb`
- [Persistence](https://github.com/campusx-official/langgraph-tutorials/blob/main/10_persistence.ipynb): `10_persistence.ipynb`
- [Tool examples](https://github.com/campusx-official/langgraph-tutorials/blob/main/11_tools.ipynb): `11_tools.ipynb`
- [RAG example](https://github.com/campusx-official/langgraph-tutorials/blob/main/13_rag.ipynb): `13_rag.ipynb`
- [HITL example](https://github.com/campusx-official/langgraph-tutorials/blob/main/14_hitl.ipynb): `14_hitl.ipynb`
- [Shared subgraphs](https://github.com/campusx-official/langgraph-tutorials/blob/main/15_subgraph_shared.ipynb): `15_subgraph_shared.ipynb`
- [Subgraphs](https://github.com/campusx-official/langgraph-tutorials/blob/main/15_subgraphs.ipynb): `15_subgraphs.ipynb`

### Chatbot runtime

- [HITL CLI](https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_with_hitl.py): `chatbot_with_hitl.py`
- [Chat CLI](https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_without_hitl.py): `chatbot_without_hitl.py`
- [Chat graph](https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_without_hitl.py): `chatbot_without_hitl.py`
- [Approval graph](https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_with_hitl.py): `chatbot_with_hitl.py`

### Tools and integrations

- [Chat model](https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_without_hitl.py): `chatbot_without_hitl.py`
- [Tool dispatcher](https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_without_hitl.py): `chatbot_without_hitl.py`
- [Stock quote tool](https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_without_hitl.py): `chatbot_without_hitl.py`
- [Purchase tool](https://github.com/campusx-official/langgraph-tutorials/blob/main/chatbot_with_hitl.py): `chatbot_with_hitl.py`
- [MCP workflow](https://github.com/campusx-official/langgraph-tutorials/blob/main/12_mcp.py): `12_mcp.py`
- [MCP client](https://github.com/campusx-official/langgraph-tutorials/blob/main/12_mcp.py): `12_mcp.py`

### Other components

- **User**
- **Alpha Vantage**
- **Approving human**
- **MCP servers**

## Connections

- User → Chat CLI: enters turn (evidence: `chatbot_without_hitl.py`)
- Chat CLI → Chat graph: invokes graph (evidence: `chatbot_without_hitl.py`)
- Chat graph → Chat model: calls model (evidence: `chatbot_without_hitl.py`)
- Chat graph → Tool dispatcher: dispatches tools (evidence: `chatbot_without_hitl.py`)
- Tool dispatcher → Stock quote tool: runs tool (evidence: `chatbot_without_hitl.py`)
- Stock quote tool → Alpha Vantage: requests quote (evidence: `chatbot_without_hitl.py`)
- User → HITL CLI: enters turn (evidence: `chatbot_with_hitl.py`)
- HITL CLI → Approval graph: invokes graph (evidence: `chatbot_with_hitl.py`)
- Approval graph → Purchase tool: dispatches tool (evidence: `chatbot_with_hitl.py`)
- Purchase tool → Approving human: requests approval (evidence: `chatbot_with_hitl.py`)
- Approving human → HITL CLI: provides decision (evidence: `chatbot_with_hitl.py`)
- Approval graph → Chat model: calls model (evidence: `chatbot_with_hitl.py`)
- MCP workflow → MCP client: loads tools (evidence: `12_mcp.py`)
- MCP client → MCP servers: connects servers (evidence: `12_mcp.py`)
