# muthanii/grad-proj architecture

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

- Interactive diagram: https://gitdiagram.com/muthanii/grad-proj
- Repository: https://github.com/muthanii/grad-proj

## Overview

Esaalni is a Streamlit chatbot backed by LangChain and Google’s Gemini Pro. Users submit a chat prompt (or choose a random example), the app invokes Gemini, and displays and retains the exchange in Streamlit session state. The README also describes the hosted web interface; the graph focuses on the runtime shown in main.py. Source evidence is limited to that excerpt and README, so the graph omits unverified internal LangChain details.

Main entry points: [`main.py`](https://github.com/muthanii/grad-proj/blob/main/main.py) (Response generator), [`img`](https://github.com/muthanii/grad-proj/tree/main/img) (QR image)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_ui["Chat interface"]
  node_streamlit_ui["Streamlit UI<br/>[main.py]"]
  node_sidebar["Sidebar options<br/>[main.py]"]
  node_qr_image["QR image"]
end

subgraph group_conversation["Conversation flow"]
  node_chat_input["Chat input<br/>[main.py]"]
  node_random_prompt["Random prompt<br/>[main.py]"]
  node_chat_history[("Session history<br/>[main.py]")]
end

subgraph group_model["AI response"]
  node_response_generator["Response generator<br/>[main.py]"]
  node_gemini{{"Gemini Pro"}}
end

node_user(("User"))

node_user -->|"uses"| node_streamlit_ui
node_streamlit_ui -->|"renders"| node_sidebar
node_sidebar -->|"displays"| node_qr_image
node_user -->|"submits prompt"| node_chat_input
node_sidebar -->|"offers"| node_random_prompt
node_random_prompt -->|"sends prompt"| node_response_generator
node_chat_input -->|"stores messages"| node_chat_history
node_chat_input -->|"calls"| node_response_generator
node_response_generator -->|"invokes"| node_gemini
node_response_generator -->|"returns response"| node_streamlit_ui
node_chat_history -->|"renders history"| node_streamlit_ui

click node_streamlit_ui "https://github.com/muthanii/grad-proj/blob/main/main.py"
click node_sidebar "https://github.com/muthanii/grad-proj/blob/main/main.py"
click node_qr_image "https://github.com/muthanii/grad-proj/tree/main/img"
click node_chat_input "https://github.com/muthanii/grad-proj/blob/main/main.py"
click node_random_prompt "https://github.com/muthanii/grad-proj/blob/main/main.py"
click node_chat_history "https://github.com/muthanii/grad-proj/blob/main/main.py"
click node_response_generator "https://github.com/muthanii/grad-proj/blob/main/main.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_ui,node_sidebar,node_qr_image,node_user toneBlue
class node_chat_input,node_random_prompt,node_chat_history toneAmber
class node_response_generator,node_gemini toneMint
```

## Components

### Chat interface

- [Streamlit UI](https://github.com/muthanii/grad-proj/blob/main/main.py): `main.py`
- [Sidebar options](https://github.com/muthanii/grad-proj/blob/main/main.py): `main.py`
- [QR image](https://github.com/muthanii/grad-proj/tree/main/img): `img`

### Conversation flow

- [Chat input](https://github.com/muthanii/grad-proj/blob/main/main.py): `main.py`
- [Random prompt](https://github.com/muthanii/grad-proj/blob/main/main.py): `main.py`
- [Session history](https://github.com/muthanii/grad-proj/blob/main/main.py): `main.py`

### AI response

- [Response generator](https://github.com/muthanii/grad-proj/blob/main/main.py): `main.py`
- **Gemini Pro**

### Other components

- **User**

## Connections

- User → Streamlit UI: uses (evidence: `README.md`)
- Streamlit UI → Sidebar options: renders (evidence: `main.py`)
- Sidebar options → QR image: displays (evidence: `main.py`)
- User → Chat input: submits prompt (evidence: `main.py`)
- Sidebar options → Random prompt: offers (evidence: `main.py`)
- Random prompt → Response generator: sends prompt (evidence: `main.py`)
- Chat input → Session history: stores messages (evidence: `main.py`)
- Chat input → Response generator: calls (evidence: `main.py`)
- Response generator → Gemini Pro: invokes (evidence: `main.py`)
- Response generator → Streamlit UI: returns response (evidence: `main.py`)
- Session history → Streamlit UI: renders history (evidence: `main.py`)
