# ammanamanchisushma123-cell/government_scheme_recommender architecture

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

- Interactive diagram: https://gitdiagram.com/ammanamanchisushma123-cell/government_scheme_recommender
- Repository: https://github.com/ammanamanchisushma123-cell/government_scheme_recommender

## Overview

GovScheme AI is a Streamlit app for discovering Indian government schemes. A user registers or logs in, builds a profile, receives profile-based recommendations, and can inspect details or save schemes; the app also offers language selection and an AI assistant. The implementation is concentrated in app.py, with recommendation data and model artifacts supplied as pickle files. The excerpts show OTP verification, saving, detail views, and assistant behavior; some workflow links are based on README documentation because the relevant code was not sampled.

Main entry points: [`app.py`](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py) (Streamlit app), [`scheme_recommendation_model.pkl`](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/scheme_recommendation_model.pkl) (Recommendation model), [`scheme_tfidf_matrix.pkl`](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/scheme_tfidf_matrix.pkl) (TF-IDF matrix), [`government_schemes_data.pkl`](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/government_schemes_data.pkl) (Scheme catalogue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_access["Access and Profile"]
  node_app["Streamlit app<br/>[app.py]"]
  node_otp["OTP verification<br/>[app.py]"]
  node_account["Registration and login<br/>[app.py]"]
  node_profile["User profile<br/>[app.py]"]
  node_language["Language selection<br/>[app.py]"]
end

subgraph group_discovery["Scheme Discovery"]
  node_recommend["Scheme recommendations<br/>[app.py]"]
  node_model["Recommendation model"]
  node_tfidf["TF-IDF matrix"]
  node_schemes["Scheme catalogue"]
  node_results["Search results<br/>[app.py]"]
  node_details["Scheme details<br/>[app.py]"]
end

subgraph group_state["User State"]
  node_saved["Saved schemes<br/>[app.py]"]
  node_database[("User SQLite store<br/>[app.py]")]
end

subgraph group_integrations["External Services"]
  node_assistant["AI assistant<br/>[app.py]"]
  node_twilio["Twilio Verify"]
  node_gemini["Gemini API"]
end

node_user(("Scheme seeker"))

node_user -->|"uses"| node_app
node_app -->|"verifies OTP"| node_otp
node_app -->|"registers or logs in"| node_account
node_account -->|"creates profile"| node_profile
node_account -->|"stores account"| node_database
node_app -->|"selects language"| node_language
node_profile -->|"personalizes"| node_recommend
node_recommend -->|"uses model"| node_model
node_recommend -->|"uses matrix"| node_tfidf
node_recommend -->|"loads catalogue"| node_schemes
node_app -->|"shows matches"| node_results
node_results -->|"opens details"| node_details
node_results -->|"toggles saved"| node_saved
node_details -->|"toggles saved"| node_saved
node_saved -->|"reads and writes"| node_database
node_app -->|"opens assistant"| node_assistant
node_assistant -.->|"queries optionally"| node_gemini
node_otp -.->|"verifies optionally"| node_twilio

click node_app "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py"
click node_otp "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py"
click node_account "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py"
click node_profile "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py"
click node_language "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py"
click node_recommend "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py"
click node_model "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/scheme_recommendation_model.pkl"
click node_tfidf "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/scheme_tfidf_matrix.pkl"
click node_schemes "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/government_schemes_data.pkl"
click node_results "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py"
click node_details "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py"
click node_saved "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py"
click node_database "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py"
click node_assistant "https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.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_app,node_otp,node_account,node_profile,node_language toneBlue
class node_recommend,node_model,node_tfidf,node_schemes,node_results,node_details toneAmber
class node_saved,node_database toneMint
class node_assistant,node_twilio,node_gemini toneRose
class node_user toneIndigo
```

## Components

### Access and Profile

- [Streamlit app](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py): `app.py`
- [OTP verification](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py): `app.py`
- [Registration and login](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py): `app.py`
- [User profile](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py): `app.py`
- [Language selection](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py): `app.py`

### Scheme Discovery

- [Scheme recommendations](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py): `app.py`
- [Recommendation model](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/scheme_recommendation_model.pkl): `scheme_recommendation_model.pkl`
- [TF-IDF matrix](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/scheme_tfidf_matrix.pkl): `scheme_tfidf_matrix.pkl`
- [Scheme catalogue](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/government_schemes_data.pkl): `government_schemes_data.pkl`
- [Search results](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py): `app.py`
- [Scheme details](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py): `app.py`

### User State

- [Saved schemes](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py): `app.py`
- [User SQLite store](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py): `app.py`

### External Services

- [AI assistant](https://github.com/ammanamanchisushma123-cell/government_scheme_recommender/blob/main/app.py): `app.py`
- **Twilio Verify**
- **Gemini API**

### Other components

- **Scheme seeker**

## Connections

- Scheme seeker → Streamlit app: uses (evidence: `README.md`)
- Streamlit app → OTP verification: verifies OTP (evidence: `app.py`)
- Streamlit app → Registration and login: registers or logs in (evidence: `README.md`)
- Registration and login → User profile: creates profile (evidence: `README.md`)
- Registration and login → User SQLite store: stores account (evidence: `README.md`)
- Streamlit app → Language selection: selects language (evidence: `README.md`)
- User profile → Scheme recommendations: personalizes (evidence: `README.md`)
- Scheme recommendations → Recommendation model: uses model (evidence: `README.md`)
- Scheme recommendations → TF-IDF matrix: uses matrix (evidence: `README.md`)
- Scheme recommendations → Scheme catalogue: loads catalogue (evidence: `README.md`)
- Streamlit app → Search results: shows matches (evidence: `README.md`)
- Search results → Scheme details: opens details (evidence: `app.py`)
- Search results → Saved schemes: toggles saved (evidence: `app.py`)
- Scheme details → Saved schemes: toggles saved (evidence: `app.py`)
- Saved schemes → User SQLite store: reads and writes (evidence: `README.md`)
- Streamlit app → AI assistant: opens assistant (evidence: `README.md`)
- AI assistant → Gemini API: queries optionally (evidence: `app.py`)
- OTP verification → Twilio Verify: verifies optionally (evidence: `app.py`)
