# rashmirisha/chatbot architecture

> Architecture diagram of the GitHub repository rashmirisha/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/rashmirisha/chatbot
- Repository: https://github.com/rashmirisha/chatbot

## Overview

This repository is presented as a small FAQ chatbot: a user asks a question, the chatbot preprocesses it, matches it against FAQ data using cosine similarity, and returns the best answer. The README also documents an optional Gradio interface. The notebook is the only source file, and no notebook excerpts were provided, so the graph reflects documented behavior rather than verified implementation details.

Main entry points: [`Chatbot.ipynb`](https://github.com/rashmirisha/chatbot/blob/main/Chatbot.ipynb) (Chatbot)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_matching["FAQ matching"]
  node_chatbot["Chatbot<br/>[Chatbot.ipynb]"]
  node_preprocess["Text preprocessing<br/>[Chatbot.ipynb]"]
  node_similarity["Cosine similarity<br/>[Chatbot.ipynb]"]
  node_faqs[("FAQ dataset<br/>[Chatbot.ipynb]")]
  node_answer["Best answer<br/>[Chatbot.ipynb]"]
end

subgraph group_interface["User interface"]
  node_gradio["Gradio UI<br/>[Chatbot.ipynb]"]
end

node_user(("User"))

node_user -->|"asks question"| node_chatbot
node_chatbot -->|"preprocesses text"| node_preprocess
node_chatbot -->|"matches by cosine"| node_similarity
node_similarity -->|"compares FAQs"| node_faqs
node_chatbot -->|"returns best match"| node_answer
node_gradio -.->|"invokes function"| node_chatbot
node_user -.->|"enters question"| node_gradio

click node_chatbot "https://github.com/rashmirisha/chatbot/blob/main/Chatbot.ipynb"
click node_preprocess "https://github.com/rashmirisha/chatbot/blob/main/Chatbot.ipynb"
click node_similarity "https://github.com/rashmirisha/chatbot/blob/main/Chatbot.ipynb"
click node_faqs "https://github.com/rashmirisha/chatbot/blob/main/Chatbot.ipynb"
click node_answer "https://github.com/rashmirisha/chatbot/blob/main/Chatbot.ipynb"
click node_gradio "https://github.com/rashmirisha/chatbot/blob/main/Chatbot.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_chatbot,node_preprocess,node_similarity,node_faqs,node_answer,node_user toneBlue
class node_gradio toneAmber
```

## Components

### FAQ matching

- [Chatbot](https://github.com/rashmirisha/chatbot/blob/main/Chatbot.ipynb): `Chatbot.ipynb`
- [Text preprocessing](https://github.com/rashmirisha/chatbot/blob/main/Chatbot.ipynb): `Chatbot.ipynb`
- [Cosine similarity](https://github.com/rashmirisha/chatbot/blob/main/Chatbot.ipynb): `Chatbot.ipynb`
- [FAQ dataset](https://github.com/rashmirisha/chatbot/blob/main/Chatbot.ipynb): `Chatbot.ipynb`
- [Best answer](https://github.com/rashmirisha/chatbot/blob/main/Chatbot.ipynb): `Chatbot.ipynb`

### User interface

- [Gradio UI](https://github.com/rashmirisha/chatbot/blob/main/Chatbot.ipynb): `Chatbot.ipynb`

### Other components

- **User**

## Connections

- User → Chatbot: asks question (evidence: `README.md`)
- Chatbot → Text preprocessing: preprocesses text (evidence: `README.md`)
- Chatbot → Cosine similarity: matches by cosine (evidence: `README.md`)
- Cosine similarity → FAQ dataset: compares FAQs (evidence: `README.md`)
- Chatbot → Best answer: returns best match (evidence: `README.md`)
- Gradio UI → Chatbot: invokes function (evidence: `README.md`)
- User → Gradio UI: enters question (evidence: `README.md`)
