# kulkarniparth30/toolbot architecture

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

- Interactive diagram: https://gitdiagram.com/kulkarniparth30/toolbot
- Repository: https://github.com/kulkarniparth30/toolbot

## Overview

Toolbot is a set of Streamlit chat applications backed by LangGraph assistants. The main application supports per-conversation PDF indexing and retrieval, streamed answers, web/stock/MCP tools, and persisted conversation state; the process subdirectory contains simpler chat and tool-enabled variants. The excerpts show frontend-to-backend calls and several backend implementations, but the README is empty and the main backend excerpt omits parts of graph construction, so some internal links are omitted rather than inferred.

Main entry points: [`Toolbot/Main_Backend.py`](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py) (Tool-enabled agent), [`Toolbot process/chatbot_backend.py`](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/chatbot_backend.py) (Basic assistant), [`Toolbot/Main_Frontend.py`](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Frontend.py) (Main chat UI), [`Toolbot process/langgraph_mcp_backend.py`](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_mcp_backend.py) (MCP assistant)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_main["PDF assistant"]
  node_main_ui["Main chat UI<br/>[Main_Frontend.py]"]
  node_main_backend["Main assistant<br/>[Main_Backend.py]"]
  node_pdf_ingest["PDF ingestion<br/>[Main_Backend.py]"]
  node_pdf_retrieval["PDF retrieval<br/>[Main_Backend.py]"]
end

subgraph group_variants["Chat variants"]
  node_basic_ui["Basic chat UI"]
  node_basic_backend["Basic assistant<br/>[chatbot_backend.py]"]
  node_db_ui["Tool chat UI"]
  node_db_backend["Search assistant"]
  node_mcp_ui["MCP chat UI"]
  node_mcp_backend["MCP assistant"]
  node_stream_ui["Threaded chat UI"]
end

subgraph group_runtime["Assistant runtime"]
  node_main_tools["Tool-enabled agent<br/>[Main_Backend.py]"]
end

subgraph group_services["State and integrations"]
  node_main_store[("Conversation checkpoints<br/>[Main_Backend.py]")]
  node_vector_store[("Thread PDF index<br/>[Main_Backend.py]")]
  node_mcp_services{{"MCP tool servers"}}
  node_web_services{{"Search and stock APIs"}}
  node_db_store[("Tool chat checkpoints")]
  node_mcp_store[("MCP chat checkpoints")]
end

node_user(("Chat user"))

node_user -->|"sends prompts"| node_main_ui
node_main_ui -->|"streams turns"| node_main_backend
node_main_ui -->|"uploads PDFs"| node_pdf_ingest
node_main_backend -->|"runs assistant"| node_main_tools
node_main_backend -->|"checkpoints state"| node_main_store
node_pdf_ingest -->|"builds index"| node_vector_store
node_pdf_retrieval -->|"searches index"| node_vector_store
node_main_tools -->|"invokes retrieval"| node_pdf_retrieval
node_main_tools -->|"loads tools"| node_mcp_services
node_main_tools -->|"binds tools"| node_web_services
node_user -->|"sends prompts"| node_basic_ui
node_basic_ui -->|"invokes turns"| node_basic_backend
node_basic_backend -->|"stores in memory"| node_basic_backend
node_user -->|"sends prompts"| node_db_ui
node_db_ui -->|"streams turns"| node_db_backend
node_db_backend -->|"checkpoints state"| node_db_store
node_user -->|"sends prompts"| node_mcp_ui
node_mcp_ui -->|"streams turns"| node_mcp_backend
node_mcp_backend -->|"checkpoints state"| node_mcp_store
node_mcp_backend -->|"loads tools"| node_mcp_services
node_user -->|"sends prompts"| node_stream_ui
node_stream_ui -->|"streams turns"| node_basic_backend

click node_main_ui "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Frontend.py"
click node_main_backend "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py"
click node_pdf_ingest "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py"
click node_pdf_retrieval "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py"
click node_main_tools "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py"
click node_main_store "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py"
click node_vector_store "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py"
click node_basic_ui "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/chatbot_frontend.py"
click node_basic_backend "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/chatbot_backend.py"
click node_db_ui "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_database_frontend.py"
click node_db_backend "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_database_backend.py"
click node_db_store "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_database_backend.py"
click node_mcp_ui "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_mcp_frontend.py"
click node_mcp_backend "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_mcp_backend.py"
click node_mcp_store "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_mcp_backend.py"
click node_stream_ui "https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/streaming_frontend_threading.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_main_ui,node_main_backend,node_pdf_ingest,node_pdf_retrieval,node_user toneBlue
class node_basic_ui,node_basic_backend,node_db_ui,node_db_backend,node_mcp_ui,node_mcp_backend,node_stream_ui toneAmber
class node_main_tools toneMint
class node_main_store,node_vector_store,node_mcp_services,node_web_services,node_db_store,node_mcp_store toneRose
```

## Components

### PDF assistant

- [Main chat UI](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Frontend.py): `Toolbot/Main_Frontend.py`
- [Main assistant](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py): `Toolbot/Main_Backend.py`
- [PDF ingestion](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py): `Toolbot/Main_Backend.py`
- [PDF retrieval](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py): `Toolbot/Main_Backend.py`

### Chat variants

- [Basic chat UI](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/chatbot_frontend.py): `Toolbot process/chatbot_frontend.py`
- [Basic assistant](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/chatbot_backend.py): `Toolbot process/chatbot_backend.py`
- [Tool chat UI](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_database_frontend.py): `Toolbot process/langgraph_database_frontend.py`
- [Search assistant](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_database_backend.py): `Toolbot process/langgraph_database_backend.py`
- [MCP chat UI](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_mcp_frontend.py): `Toolbot process/langgraph_mcp_frontend.py`
- [MCP assistant](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_mcp_backend.py): `Toolbot process/langgraph_mcp_backend.py`
- [Threaded chat UI](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/streaming_frontend_threading.py): `Toolbot process/streaming_frontend_threading.py`

### Assistant runtime

- [Tool-enabled agent](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py): `Toolbot/Main_Backend.py`

### State and integrations

- [Conversation checkpoints](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py): `Toolbot/Main_Backend.py`
- [Thread PDF index](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot/Main_Backend.py): `Toolbot/Main_Backend.py`
- **MCP tool servers**
- **Search and stock APIs**
- [Tool chat checkpoints](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_database_backend.py): `Toolbot process/langgraph_database_backend.py`
- [MCP chat checkpoints](https://github.com/kulkarniparth30/toolbot/blob/main/Toolbot%20process/langgraph_mcp_backend.py): `Toolbot process/langgraph_mcp_backend.py`

### Other components

- **Chat user**

## Connections

- Chat user → Main chat UI: sends prompts (evidence: `Toolbot/Main_Frontend.py`)
- Main chat UI → Main assistant: streams turns (evidence: `Toolbot/Main_Frontend.py`)
- Main chat UI → PDF ingestion: uploads PDFs (evidence: `Toolbot/Main_Frontend.py`)
- Main assistant → Tool-enabled agent: runs assistant (evidence: `Toolbot/Main_Backend.py`)
- Main assistant → Conversation checkpoints: checkpoints state (evidence: `Toolbot/Main_Backend.py`)
- PDF ingestion → Thread PDF index: builds index (evidence: `Toolbot/Main_Backend.py`)
- PDF retrieval → Thread PDF index: searches index (evidence: `Toolbot/Main_Backend.py`)
- Tool-enabled agent → PDF retrieval: invokes retrieval (evidence: `Toolbot/Main_Backend.py`)
- Tool-enabled agent → MCP tool servers: loads tools (evidence: `Toolbot/Main_Backend.py`)
- Tool-enabled agent → Search and stock APIs: binds tools (evidence: `Toolbot/Main_Backend.py`)
- Chat user → Basic chat UI: sends prompts (evidence: `Toolbot process/chatbot_frontend.py`)
- Basic chat UI → Basic assistant: invokes turns (evidence: `Toolbot process/chatbot_frontend.py`)
- Basic assistant → Basic assistant: stores in memory (evidence: `Toolbot process/chatbot_backend.py`)
- Chat user → Tool chat UI: sends prompts (evidence: `Toolbot process/langgraph_database_frontend.py`)
- Tool chat UI → Search assistant: streams turns (evidence: `Toolbot process/langgraph_database_frontend.py`)
- Search assistant → Tool chat checkpoints: checkpoints state (evidence: `Toolbot process/langgraph_database_backend.py`)
- Chat user → MCP chat UI: sends prompts (evidence: `Toolbot process/langgraph_mcp_frontend.py`)
- MCP chat UI → MCP assistant: streams turns (evidence: `Toolbot process/langgraph_mcp_frontend.py`)
- MCP assistant → MCP chat checkpoints: checkpoints state (evidence: `Toolbot process/langgraph_mcp_backend.py`)
- MCP assistant → MCP tool servers: loads tools (evidence: `Toolbot process/langgraph_mcp_backend.py`)
- Chat user → Threaded chat UI: sends prompts (evidence: `Toolbot process/streaming_frontend_threading.py`)
- Threaded chat UI → Basic assistant: streams turns (evidence: `Toolbot process/streaming_frontend_threading.py`)
