# abhishekadbhute-create/llm_based_chatbot architecture

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

- Interactive diagram: https://gitdiagram.com/abhishekadbhute-create/llm_based_chatbot
- Repository: https://github.com/abhishekadbhute-create/llm_based_chatbot

## Overview

This is a Streamlit conversational chatbot. A user enters a message, the UI streams the LangGraph response, and the graph invokes a Hugging Face Llama endpoint while checkpointing conversation state by thread ID. The UI also creates and switches threads, loading their saved messages for display. The graph and UI source are excerpted; the endpoint and checkpoint behavior are documented in the README. External service interactions are represented at the boundary, not as internal modules.

Main entry points: [`streamlit_ui.py`](https://github.com/abhishekadbhute-create/llm_based_chatbot/blob/main/streamlit_ui.py) (Chat and thread UI), [`chatbott_langgraph.py`](https://github.com/abhishekadbhute-create/llm_based_chatbot/blob/main/chatbott_langgraph.py) (State graph)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Chat interface"]
  node_streamlit["Chat and thread UI<br/>[streamlit_ui.py]"]
  node_thread_session[("Thread session state<br/>[streamlit_ui.py]")]
end

subgraph group_runtime["Conversation runtime"]
  node_chat_graph["State graph"]
  node_chat_node["Chat node"]
  node_checkpoint[("Memory checkpoint")]
end

subgraph group_external["External services"]
  node_hf_endpoint["Hugging Face endpoint"]
end

node_user(("Chat user"))
node_browser(("Web browser"))

node_user -->|"sends messages"| node_streamlit
node_streamlit -->|"updates threads"| node_thread_session
node_streamlit -->|"streams requests"| node_chat_graph
node_streamlit -->|"loads thread state"| node_chat_graph
node_chat_graph -->|"dispatches to"| node_chat_node
node_chat_node -->|"invokes model"| node_hf_endpoint
node_chat_graph -->|"persists state"| node_checkpoint
node_streamlit -->|"renders stream"| node_browser

click node_streamlit "https://github.com/abhishekadbhute-create/llm_based_chatbot/blob/main/streamlit_ui.py"
click node_thread_session "https://github.com/abhishekadbhute-create/llm_based_chatbot/blob/main/streamlit_ui.py"
click node_chat_graph "https://github.com/abhishekadbhute-create/llm_based_chatbot/blob/main/chatbott_langgraph.py"
click node_chat_node "https://github.com/abhishekadbhute-create/llm_based_chatbot/blob/main/chatbott_langgraph.py"
click node_checkpoint "https://github.com/abhishekadbhute-create/llm_based_chatbot/blob/main/chatbott_langgraph.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_streamlit,node_thread_session,node_user,node_browser toneBlue
class node_chat_graph,node_chat_node,node_checkpoint toneAmber
class node_hf_endpoint toneMint
```

## Components

### Chat interface

- [Chat and thread UI](https://github.com/abhishekadbhute-create/llm_based_chatbot/blob/main/streamlit_ui.py): `streamlit_ui.py`
- [Thread session state](https://github.com/abhishekadbhute-create/llm_based_chatbot/blob/main/streamlit_ui.py): `streamlit_ui.py`

### Conversation runtime

- [State graph](https://github.com/abhishekadbhute-create/llm_based_chatbot/blob/main/chatbott_langgraph.py): `chatbott_langgraph.py`
- [Chat node](https://github.com/abhishekadbhute-create/llm_based_chatbot/blob/main/chatbott_langgraph.py): `chatbott_langgraph.py`
- [Memory checkpoint](https://github.com/abhishekadbhute-create/llm_based_chatbot/blob/main/chatbott_langgraph.py): `chatbott_langgraph.py`

### External services

- **Hugging Face endpoint**

### Other components

- **Chat user**
- **Web browser**

## Connections

- Chat user → Chat and thread UI: sends messages (evidence: `README.md`)
- Chat and thread UI → Thread session state: updates threads (evidence: `streamlit_ui.py`)
- Chat and thread UI → State graph: streams requests (evidence: `streamlit_ui.py`)
- Chat and thread UI → State graph: loads thread state (evidence: `streamlit_ui.py`)
- State graph → Chat node: dispatches to (evidence: `chatbott_langgraph.py`)
- Chat node → Hugging Face endpoint: invokes model (evidence: `chatbott_langgraph.py`)
- State graph → Memory checkpoint: persists state (evidence: `chatbott_langgraph.py`)
- Chat and thread UI → Web browser: renders stream (evidence: `README.md`)
