# amaan7040/agentic-ai-langgraph- architecture

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

- Interactive diagram: https://gitdiagram.com/amaan7040/agentic-ai-langgraph-
- Repository: https://github.com/amaan7040/agentic-ai-langgraph-

## Overview

This repository is a collection of LangGraph and agentic-AI examples, not one integrated application. The clearest user-to-result workflows are the chat demos: a user enters a message in a Streamlit UI, the backend runs a chat or tool-enabled graph, and the UI displays the response. Other branches demonstrate research-driven blog writing, human approval, retrieval-augmented chat, MCP servers, and workflow patterns. Edges reflect excerpted imports or calls; notebook and unsampled subsystem details are represented without inferred internal flows.

Main entry points: [`Blog Writing Agent/frontend.py`](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Blog%20Writing%20Agent/frontend.py) (Blog writer UI), [`Chatbot Building/chatbot_frontend.py`](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_frontend.py) (Basic chat UI), [`Chatbot Building/chatbot_tool_frontend.py`](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_tool_frontend.py) (Tool chat UI), [`Chatbot Building/chatbot_with_db_frontend.py`](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_with_db_frontend.py) (Persistent chat UI)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_blog["Blog writing"]
  node_writer["Blog writer UI<br/>[frontend.py]"]
  node_writer_backend["Research and drafting graph<br/>[backend.py]"]
end

subgraph group_chat["Chat demos"]
  node_basic_ui["Basic chat UI"]
  node_basic_backend["Basic chat graph<br/>[chatbot_backend.py]"]
  node_tools_ui["Tool chat UI"]
  node_tools_backend["Tool chat graph"]
  node_db_ui["Persistent chat UI"]
  node_db_backend["Persistent chat backend"]
end

subgraph group_mcp["MCP integrations"]
  node_mcp_ui["MCP chat UI"]
  node_mcp_backend["MCP chat graph"]
  node_mcp_tools["MCP tool server<br/>[mcp-tools-local.py]"]
  node_fastapi_mcp["FastAPI MCP chatbot<br/>[main.py]"]
  node_expense_server["Expense MCP server"]
end

subgraph group_rag_hitl["RAG and approval"]
  node_hitl_ui["Approval chat UI<br/>[HITL_frontend.py]"]
  node_hitl_backend["Human-in-loop graph<br/>[HITL_backend.py]"]
  node_rag_ui["RAG chat UI<br/>[rag_frontend.py]"]
  node_rag_backend["RAG chat backend<br/>[rag_backend.py]"]
end

subgraph group_workflows["Workflow examples"]
  node_sequential["Sequential workflow demos"]
  node_conditional["Conditional workflow demos"]
  node_parallel["Parallel workflow demos"]
  node_subgraph["Subgraph demos"]
  node_iterative["Iterative generation demo"]
  node_correction["Corrective RAG demo"]
end

node_user(("User"))

node_user -->|"enters topic"| node_writer
node_writer -->|"runs graph"| node_writer_backend
node_user -->|"sends message"| node_basic_ui
node_basic_ui -->|"imports chatbot"| node_basic_backend
node_user -->|"sends message"| node_tools_ui
node_tools_ui -->|"imports backend"| node_tools_backend
node_user -->|"sends message"| node_db_ui
node_db_ui -->|"imports backend"| node_db_backend
node_user -->|"sends message"| node_mcp_ui
node_mcp_ui -->|"loads client"| node_mcp_backend
node_mcp_backend -->|"starts server"| node_mcp_tools
node_user -->|"sends request"| node_hitl_ui
node_hitl_ui -->|"invokes graph"| node_hitl_backend
node_user -->|"sends question"| node_rag_ui
node_rag_ui -->|"imports chatbot"| node_rag_backend

click node_writer "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Blog%20Writing%20Agent/frontend.py"
click node_writer_backend "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Blog%20Writing%20Agent/backend.py"
click node_basic_ui "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_frontend.py"
click node_basic_backend "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_backend.py"
click node_tools_ui "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_tool_frontend.py"
click node_tools_backend "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_tool_backend.py"
click node_db_ui "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_with_db_frontend.py"
click node_db_backend "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_with_db_backend.py"
click node_mcp_ui "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20MCP/mcp-chatbot-frontend.py"
click node_mcp_backend "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20MCP/mcp_chatbot_backend_client.py"
click node_mcp_tools "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20MCP/mcp-tools-local.py"
click node_fastapi_mcp "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Fastapi%20MCP%20chatbot/main.py"
click node_expense_server "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/MCP/mcp-server-local.py"
click node_hitl_ui "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/HITL/HITL_frontend.py"
click node_hitl_backend "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/HITL/HITL_backend.py"
click node_rag_ui "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/RAG%20Chatbot/rag_frontend.py"
click node_rag_backend "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/RAG%20Chatbot/rag_backend.py"
click node_sequential "https://github.com/amaan7040/agentic-ai-langgraph-/tree/main/Sequential%20Workflow"
click node_conditional "https://github.com/amaan7040/agentic-ai-langgraph-/tree/main/Conditional%20Workflow"
click node_parallel "https://github.com/amaan7040/agentic-ai-langgraph-/tree/main/Parellel%20Workflow"
click node_subgraph "https://github.com/amaan7040/agentic-ai-langgraph-/tree/main/Subgraph"
click node_iterative "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Iterative/X_Post_Generation.ipynb"
click node_correction "https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Corrective_RAG.ipynb"

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_writer,node_writer_backend,node_user toneBlue
class node_basic_ui,node_basic_backend,node_tools_ui,node_tools_backend,node_db_ui,node_db_backend toneAmber
class node_mcp_ui,node_mcp_backend,node_mcp_tools,node_fastapi_mcp,node_expense_server toneMint
class node_hitl_ui,node_hitl_backend,node_rag_ui,node_rag_backend toneRose
class node_sequential,node_conditional,node_parallel,node_subgraph,node_iterative,node_correction toneIndigo
```

## Components

### Blog writing

- [Blog writer UI](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Blog%20Writing%20Agent/frontend.py): `Blog Writing Agent/frontend.py`
- [Research and drafting graph](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Blog%20Writing%20Agent/backend.py): `Blog Writing Agent/backend.py`

### Chat demos

- [Basic chat UI](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_frontend.py): `Chatbot Building/chatbot_frontend.py`
- [Basic chat graph](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_backend.py): `Chatbot Building/chatbot_backend.py`
- [Tool chat UI](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_tool_frontend.py): `Chatbot Building/chatbot_tool_frontend.py`
- [Tool chat graph](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_tool_backend.py): `Chatbot Building/chatbot_tool_backend.py`
- [Persistent chat UI](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_with_db_frontend.py): `Chatbot Building/chatbot_with_db_frontend.py`
- [Persistent chat backend](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20Building/chatbot_with_db_backend.py): `Chatbot Building/chatbot_with_db_backend.py`

### MCP integrations

- [MCP chat UI](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20MCP/mcp-chatbot-frontend.py): `Chatbot MCP/mcp-chatbot-frontend.py`
- [MCP chat graph](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20MCP/mcp_chatbot_backend_client.py): `Chatbot MCP/mcp_chatbot_backend_client.py`
- [MCP tool server](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Chatbot%20MCP/mcp-tools-local.py): `Chatbot MCP/mcp-tools-local.py`
- [FastAPI MCP chatbot](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Fastapi%20MCP%20chatbot/main.py): `Fastapi MCP chatbot/main.py`
- [Expense MCP server](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/MCP/mcp-server-local.py): `MCP/mcp-server-local.py`

### RAG and approval

- [Approval chat UI](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/HITL/HITL_frontend.py): `HITL/HITL_frontend.py`
- [Human-in-loop graph](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/HITL/HITL_backend.py): `HITL/HITL_backend.py`
- [RAG chat UI](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/RAG%20Chatbot/rag_frontend.py): `RAG Chatbot/rag_frontend.py`
- [RAG chat backend](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/RAG%20Chatbot/rag_backend.py): `RAG Chatbot/rag_backend.py`

### Workflow examples

- [Sequential workflow demos](https://github.com/amaan7040/agentic-ai-langgraph-/tree/main/Sequential%20Workflow): `Sequential Workflow`
- [Conditional workflow demos](https://github.com/amaan7040/agentic-ai-langgraph-/tree/main/Conditional%20Workflow): `Conditional Workflow`
- [Parallel workflow demos](https://github.com/amaan7040/agentic-ai-langgraph-/tree/main/Parellel%20Workflow): `Parellel Workflow`
- [Subgraph demos](https://github.com/amaan7040/agentic-ai-langgraph-/tree/main/Subgraph): `Subgraph`
- [Iterative generation demo](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Iterative/X_Post_Generation.ipynb): `Iterative/X_Post_Generation.ipynb`
- [Corrective RAG demo](https://github.com/amaan7040/agentic-ai-langgraph-/blob/main/Corrective_RAG.ipynb): `Corrective_RAG.ipynb`

### Other components

- **User**

## Connections

- User → Blog writer UI: enters topic
- Blog writer UI → Research and drafting graph: runs graph (evidence: `Blog Writing Agent/frontend.py`)
- User → Basic chat UI: sends message
- Basic chat UI → Basic chat graph: imports chatbot (evidence: `Chatbot Building/chatbot_frontend.py`)
- User → Tool chat UI: sends message
- Tool chat UI → Tool chat graph: imports backend (evidence: `Chatbot Building/chatbot_tool_frontend.py`)
- User → Persistent chat UI: sends message
- Persistent chat UI → Persistent chat backend: imports backend (evidence: `Chatbot Building/chatbot_with_db_frontend.py`)
- User → MCP chat UI: sends message
- MCP chat UI → MCP chat graph: loads client (evidence: `Chatbot MCP/mcp-chatbot-frontend.py`)
- MCP chat graph → MCP tool server: starts server (evidence: `Chatbot MCP/mcp_chatbot_backend_client.py`)
- User → Approval chat UI: sends request
- Approval chat UI → Human-in-loop graph: invokes graph (evidence: `HITL/HITL_frontend.py`)
- User → RAG chat UI: sends question
- RAG chat UI → RAG chat backend: imports chatbot (evidence: `RAG Chatbot/rag_frontend.py`)
