# mridula222/ai-helpbot-kg architecture

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

- Interactive diagram: https://gitdiagram.com/mridula222/ai-helpbot-kg
- Repository: https://github.com/mridula222/ai-helpbot-kg

## Overview

AI Help Bot is a MOSDAC/ISRO knowledge assistant with a React chat UI, a FastAPI service, entity extraction, and a local JSON-backed knowledge graph. The main user workflow sends a chat message to the API, extracts entities, then resolves them against canned answers or the graph; file uploads follow a separate extraction-and-summary route. Documented ingestion and FAQ entity-processing capabilities are also shown. The README describes a broader LangChain RAG and Neo4j design, but the sampled runtime implements the JSON graph path; unsampled integration details are not inferred.

Main entry points: [`backend/app/main.py`](https://github.com/mridula222/ai-helpbot-kg/blob/main/backend/app/main.py) (FastAPI routes), [`data_ingestion/process_all_data.py`](https://github.com/mridula222/ai-helpbot-kg/blob/main/data_ingestion/process_all_data.py) (FAQ and document parsing), [`frontend/chat-bot/src/App.jsx`](https://github.com/mridula222/ai-helpbot-kg/blob/main/frontend/chat-bot/src/App.jsx) (Chat application), [`frontend/chat-bot/src/components/ChatWindow.jsx`](https://github.com/mridula222/ai-helpbot-kg/blob/main/frontend/chat-bot/src/components/ChatWindow.jsx) (Chat and upload)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Chat interface"]
  node_webapp["Chat application<br/>[App.jsx]"]
  node_chatwindow["Chat and upload<br/>[ChatWindow.jsx]"]
  node_sidebar["Chat sidebar<br/>[Sidebar.jsx]"]
end

subgraph group_api["API service"]
  node_api["FastAPI routes<br/>[main.py]"]
  node_reply["Fallback replies<br/>[main.py]"]
end

subgraph group_knowledge["Knowledge processing"]
  node_nlp["Entity extraction"]
  node_kginterface["Graph answer interface"]
  node_kgquery["Entity lookup<br/>[kg_query.py]"]
  node_kgdata[("Knowledge graph data<br/>[kg_data.json]")]
  node_faqextract["FAQ entity extraction"]
  node_faqentities["FAQ entity output<br/>[faq_entities.json]"]
end

subgraph group_ingestion["Content ingestion"]
  node_ingest["FAQ and document parsing"]
  node_faqsource["FAQ and source documents<br/>[mosdac_faqs.json]"]
  node_parsed["Parsed text corpus<br/>[master_dataset.txt]"]
end

node_user(("User"))
node_external(("MOSDAC portal"))

node_user -->|"enters query"| node_chatwindow
node_webapp -->|"renders"| node_chatwindow
node_webapp -->|"renders"| node_sidebar
node_sidebar -->|"starts chat"| node_webapp
node_chatwindow -->|"posts chat or file"| node_api
node_api -->|"checks fallback"| node_reply
node_api -->|"extracts entities"| node_nlp
node_api -->|"requests graph answer"| node_kginterface
node_kginterface -->|"looks up entities"| node_kgquery
node_kgquery -->|"reads"| node_kgdata
node_external -.->|"supplies FAQs"| node_ingest
node_ingest -->|"writes FAQ data"| node_faqsource
node_ingest -->|"writes parsed corpus"| node_parsed
node_faqsource -->|"provides FAQ input"| node_faqextract
node_faqextract -->|"writes entities"| node_faqentities

click node_webapp "https://github.com/mridula222/ai-helpbot-kg/blob/main/frontend/chat-bot/src/App.jsx"
click node_chatwindow "https://github.com/mridula222/ai-helpbot-kg/blob/main/frontend/chat-bot/src/components/ChatWindow.jsx"
click node_sidebar "https://github.com/mridula222/ai-helpbot-kg/blob/main/frontend/chat-bot/src/components/Sidebar.jsx"
click node_api "https://github.com/mridula222/ai-helpbot-kg/blob/main/backend/app/main.py"
click node_reply "https://github.com/mridula222/ai-helpbot-kg/blob/main/backend/app/main.py"
click node_nlp "https://github.com/mridula222/ai-helpbot-kg/blob/main/nlp_processing/backend_interface.py"
click node_kginterface "https://github.com/mridula222/ai-helpbot-kg/blob/main/knowledge_graph/backend_interface.py"
click node_kgquery "https://github.com/mridula222/ai-helpbot-kg/blob/main/knowledge_graph/kg_query.py"
click node_kgdata "https://github.com/mridula222/ai-helpbot-kg/blob/main/knowledge_graph/kg_data.json"
click node_faqextract "https://github.com/mridula222/ai-helpbot-kg/blob/main/nlp_processing/process_faq_entities.py"
click node_faqentities "https://github.com/mridula222/ai-helpbot-kg/blob/main/nlp_processing/faq_entities.json"
click node_ingest "https://github.com/mridula222/ai-helpbot-kg/blob/main/data_ingestion/process_all_data.py"
click node_faqsource "https://github.com/mridula222/ai-helpbot-kg/blob/main/data_ingestion/mosdac_faqs.json"
click node_parsed "https://github.com/mridula222/ai-helpbot-kg/blob/main/data_ingestion/parsed_output/master_dataset.txt"

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_webapp,node_chatwindow,node_sidebar,node_user toneBlue
class node_api,node_reply toneAmber
class node_nlp,node_kginterface,node_kgquery,node_kgdata,node_faqextract,node_faqentities toneMint
class node_ingest,node_faqsource,node_parsed toneRose
class node_external toneIndigo
```

## Components

### Chat interface

- [Chat application](https://github.com/mridula222/ai-helpbot-kg/blob/main/frontend/chat-bot/src/App.jsx): `frontend/chat-bot/src/App.jsx`
- [Chat and upload](https://github.com/mridula222/ai-helpbot-kg/blob/main/frontend/chat-bot/src/components/ChatWindow.jsx): `frontend/chat-bot/src/components/ChatWindow.jsx`
- [Chat sidebar](https://github.com/mridula222/ai-helpbot-kg/blob/main/frontend/chat-bot/src/components/Sidebar.jsx): `frontend/chat-bot/src/components/Sidebar.jsx`

### API service

- [FastAPI routes](https://github.com/mridula222/ai-helpbot-kg/blob/main/backend/app/main.py): `backend/app/main.py`
- [Fallback replies](https://github.com/mridula222/ai-helpbot-kg/blob/main/backend/app/main.py): `backend/app/main.py`

### Knowledge processing

- [Entity extraction](https://github.com/mridula222/ai-helpbot-kg/blob/main/nlp_processing/backend_interface.py): `nlp_processing/backend_interface.py`
- [Graph answer interface](https://github.com/mridula222/ai-helpbot-kg/blob/main/knowledge_graph/backend_interface.py): `knowledge_graph/backend_interface.py`
- [Entity lookup](https://github.com/mridula222/ai-helpbot-kg/blob/main/knowledge_graph/kg_query.py): `knowledge_graph/kg_query.py`
- [Knowledge graph data](https://github.com/mridula222/ai-helpbot-kg/blob/main/knowledge_graph/kg_data.json): `knowledge_graph/kg_data.json`
- [FAQ entity extraction](https://github.com/mridula222/ai-helpbot-kg/blob/main/nlp_processing/process_faq_entities.py): `nlp_processing/process_faq_entities.py`
- [FAQ entity output](https://github.com/mridula222/ai-helpbot-kg/blob/main/nlp_processing/faq_entities.json): `nlp_processing/faq_entities.json`

### Content ingestion

- [FAQ and document parsing](https://github.com/mridula222/ai-helpbot-kg/blob/main/data_ingestion/process_all_data.py): `data_ingestion/process_all_data.py`
- [FAQ and source documents](https://github.com/mridula222/ai-helpbot-kg/blob/main/data_ingestion/mosdac_faqs.json): `data_ingestion/mosdac_faqs.json`
- [Parsed text corpus](https://github.com/mridula222/ai-helpbot-kg/blob/main/data_ingestion/parsed_output/master_dataset.txt): `data_ingestion/parsed_output/master_dataset.txt`

### Other components

- **User**
- **MOSDAC portal**

## Connections

- User → Chat and upload: enters query (evidence: `frontend/chat-bot/src/components/ChatWindow.jsx`)
- Chat application → Chat and upload: renders (evidence: `frontend/chat-bot/src/App.jsx`)
- Chat application → Chat sidebar: renders (evidence: `frontend/chat-bot/src/App.jsx`)
- Chat sidebar → Chat application: starts chat (evidence: `frontend/chat-bot/src/App.jsx`)
- Chat and upload → FastAPI routes: posts chat or file (evidence: `frontend/chat-bot/src/components/ChatWindow.jsx`)
- FastAPI routes → Fallback replies: checks fallback (evidence: `backend/app/main.py`)
- FastAPI routes → Entity extraction: extracts entities (evidence: `backend/app/main.py`)
- FastAPI routes → Graph answer interface: requests graph answer (evidence: `backend/app/main.py`)
- Graph answer interface → Entity lookup: looks up entities (evidence: `knowledge_graph/backend_interface.py`)
- Entity lookup → Knowledge graph data: reads (evidence: `knowledge_graph/kg_query.py`)
- MOSDAC portal → FAQ and document parsing: supplies FAQs
- FAQ and document parsing → FAQ and source documents: writes FAQ data (evidence: `data_ingestion/process_all_data.py`)
- FAQ and document parsing → Parsed text corpus: writes parsed corpus (evidence: `data_ingestion/process_all_data.py`)
- FAQ and source documents → FAQ entity extraction: provides FAQ input (evidence: `nlp_processing/process_faq_entities.py`)
- FAQ entity extraction → FAQ entity output: writes entities (evidence: `nlp_processing/process_faq_entities.py`)
