# saicharan0811/schemeiq-plus architecture

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

- Interactive diagram: https://gitdiagram.com/saicharan0811/schemeiq-plus
- Repository: https://github.com/saicharan0811/schemeiq-plus

## Overview

SchemeIQ+ helps people in Telangana discover welfare schemes, assess eligibility, and ask questions grounded in official sources. The main journey runs from a citizen through the web interface and REST API into profile validation, deterministic rule assessment, and ranked recommendations; a separate question-answering route retrieves source material and produces grounded answers. Document ingestion and RAG indexing support that knowledge workflow. The README describes multilingual support and official-source grounding. Some routes and internal wiring are unsampled, so the graph omits uncertain links rather than inferring them.

Main entry points: [`src/rag/ingest.py`](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/ingest.py) (RAG indexing), [`frontend/src/App.jsx`](https://github.com/saicharan0811/schemeiq-plus/blob/master/frontend/src/App.jsx) (Page router), [`src/eligibility/service.py`](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/service.py) (Eligibility service), [`src/rag/rag_service.py`](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/rag_service.py) (RAG orchestrator)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_frontend["Web interface"]
  node_app["Page router<br/>[App.jsx]"]
  node_recommend_page["Recommendations<br/>[RecommendPage.jsx]"]
  node_scheme_page["Scheme details"]
  node_ask_page["Ask a question<br/>[AskPage.jsx]"]
  node_api_client["API client<br/>[api.js]"]
end

subgraph group_api["API layer"]
  node_rest_api["REST API<br/>[app.py]"]
end

subgraph group_eligibility["Eligibility and recommendations"]
  node_eligibility_service["Eligibility service<br/>[service.py]"]
  node_profile["Profile handling<br/>[profile.py]"]
  node_recommender["Scheme ranking<br/>[recommender.py]"]
  node_evaluator["Eligibility evaluator<br/>[evaluator.py]"]
  node_rules["Rule engine<br/>[rule_engine.py]"]
  node_explanation["Explanations<br/>[explanation.py]"]
end

subgraph group_rag["Grounded Q&amp;A"]
  node_rag_service["RAG orchestrator<br/>[rag_service.py]"]
  node_query_detector["Scheme detection<br/>[query_detector.py]"]
  node_hybrid["Hybrid retrieval"]
  node_keyword["Keyword retrieval"]
  node_vector_store[("Vector index<br/>[vector_store.py]")]
  node_answer_generator["Answer generation"]
end

subgraph group_ingestion["Source ingestion"]
  node_ingestion_pipeline["Document downloads<br/>[pipeline.py]"]
  node_manifest["Source manifest<br/>[manifest_loader.py]"]
  node_downloader["Official downloader<br/>[downloader.py]"]
  node_rag_ingest["RAG indexing<br/>[ingest.py]"]
  node_loader["Document loader<br/>[document_loader.py]"]
  node_chunker["Structure chunker<br/>[chunker.py]"]
  node_embeddings["Embedding provider<br/>[embeddings.py]"]
end

node_citizen(("Citizen"))
node_official_sources(("Official sources"))

node_citizen -->|"uses"| node_app
node_app -->|"routes to"| node_recommend_page
node_app -->|"routes to"| node_scheme_page
node_app -->|"routes to"| node_ask_page
node_recommend_page -->|"requests"| node_api_client
node_scheme_page -->|"requests"| node_api_client
node_ask_page -->|"requests"| node_api_client
node_api_client -->|"calls"| node_rest_api
node_rest_api -->|"assesses"| node_eligibility_service
node_rest_api -->|"answers"| node_rag_service
node_eligibility_service -->|"normalizes"| node_profile
node_eligibility_service -->|"ranks"| node_recommender
node_recommender -->|"evaluates"| node_evaluator
node_evaluator -->|"checks rules"| node_rules
node_eligibility_service -->|"formats"| node_explanation
node_rag_service -->|"detects scheme"| node_query_detector
node_rag_service -->|"retrieves"| node_hybrid
node_rag_service -->|"generates answer"| node_answer_generator
node_hybrid -->|"queries"| node_keyword
node_hybrid -->|"queries"| node_vector_store
node_official_sources -->|"provides documents"| node_ingestion_pipeline
node_ingestion_pipeline -->|"loads entries"| node_manifest
node_ingestion_pipeline -->|"downloads"| node_downloader
node_rag_ingest -->|"loads documents"| node_loader
node_rag_ingest -->|"chunks documents"| node_chunker
node_rag_ingest -->|"embeds chunks"| node_embeddings
node_rag_ingest -->|"indexes chunks"| node_vector_store

click node_app "https://github.com/saicharan0811/schemeiq-plus/blob/master/frontend/src/App.jsx"
click node_recommend_page "https://github.com/saicharan0811/schemeiq-plus/blob/master/frontend/src/pages/RecommendPage.jsx"
click node_scheme_page "https://github.com/saicharan0811/schemeiq-plus/blob/master/frontend/src/pages/SchemeDetailPage.jsx"
click node_ask_page "https://github.com/saicharan0811/schemeiq-plus/blob/master/frontend/src/pages/AskPage.jsx"
click node_api_client "https://github.com/saicharan0811/schemeiq-plus/blob/master/frontend/src/api.js"
click node_rest_api "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/api/app.py"
click node_eligibility_service "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/service.py"
click node_profile "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/profile.py"
click node_recommender "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/recommender.py"
click node_evaluator "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/evaluator.py"
click node_rules "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/rule_engine.py"
click node_explanation "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/explanation.py"
click node_rag_service "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/rag_service.py"
click node_query_detector "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/query_detector.py"
click node_hybrid "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/hybrid_retriever.py"
click node_keyword "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/keyword_retriever.py"
click node_vector_store "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/vector_store.py"
click node_answer_generator "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/answer_generator.py"
click node_ingestion_pipeline "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/ingestion/pipeline.py"
click node_manifest "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/ingestion/manifest_loader.py"
click node_downloader "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/ingestion/downloader.py"
click node_rag_ingest "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/ingest.py"
click node_loader "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/document_loader.py"
click node_chunker "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/chunker.py"
click node_embeddings "https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/embeddings.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_recommend_page,node_scheme_page,node_ask_page,node_api_client toneBlue
class node_rest_api toneAmber
class node_eligibility_service,node_profile,node_recommender,node_evaluator,node_rules,node_explanation toneMint
class node_rag_service,node_query_detector,node_hybrid,node_keyword,node_vector_store,node_answer_generator toneRose
class node_ingestion_pipeline,node_manifest,node_downloader,node_rag_ingest,node_loader,node_chunker,node_embeddings,node_citizen,node_official_sources toneIndigo
```

## Components

### Web interface

- [Page router](https://github.com/saicharan0811/schemeiq-plus/blob/master/frontend/src/App.jsx): `frontend/src/App.jsx`
- [Recommendations](https://github.com/saicharan0811/schemeiq-plus/blob/master/frontend/src/pages/RecommendPage.jsx): `frontend/src/pages/RecommendPage.jsx`
- [Scheme details](https://github.com/saicharan0811/schemeiq-plus/blob/master/frontend/src/pages/SchemeDetailPage.jsx): `frontend/src/pages/SchemeDetailPage.jsx`
- [Ask a question](https://github.com/saicharan0811/schemeiq-plus/blob/master/frontend/src/pages/AskPage.jsx): `frontend/src/pages/AskPage.jsx`
- [API client](https://github.com/saicharan0811/schemeiq-plus/blob/master/frontend/src/api.js): `frontend/src/api.js`

### API layer

- [REST API](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/api/app.py): `src/api/app.py`

### Eligibility and recommendations

- [Eligibility service](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/service.py): `src/eligibility/service.py`
- [Profile handling](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/profile.py): `src/eligibility/profile.py`
- [Scheme ranking](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/recommender.py): `src/eligibility/recommender.py`
- [Eligibility evaluator](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/evaluator.py): `src/eligibility/evaluator.py`
- [Rule engine](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/rule_engine.py): `src/eligibility/rule_engine.py`
- [Explanations](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/eligibility/explanation.py): `src/eligibility/explanation.py`

### Grounded Q&A

- [RAG orchestrator](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/rag_service.py): `src/rag/rag_service.py`
- [Scheme detection](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/query_detector.py): `src/rag/query_detector.py`
- [Hybrid retrieval](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/hybrid_retriever.py): `src/rag/hybrid_retriever.py`
- [Keyword retrieval](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/keyword_retriever.py): `src/rag/keyword_retriever.py`
- [Vector index](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/vector_store.py): `src/rag/vector_store.py`
- [Answer generation](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/answer_generator.py): `src/rag/answer_generator.py`

### Source ingestion

- [Document downloads](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/ingestion/pipeline.py): `src/ingestion/pipeline.py`
- [Source manifest](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/ingestion/manifest_loader.py): `src/ingestion/manifest_loader.py`
- [Official downloader](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/ingestion/downloader.py): `src/ingestion/downloader.py`
- [RAG indexing](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/ingest.py): `src/rag/ingest.py`
- [Document loader](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/document_loader.py): `src/rag/document_loader.py`
- [Structure chunker](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/chunker.py): `src/rag/chunker.py`
- [Embedding provider](https://github.com/saicharan0811/schemeiq-plus/blob/master/src/rag/embeddings.py): `src/rag/embeddings.py`

### Other components

- **Citizen**
- **Official sources**

## Connections

- Citizen → Page router: uses
- Page router → Recommendations: routes to
- Page router → Scheme details: routes to
- Page router → Ask a question: routes to
- Recommendations → API client: requests
- Scheme details → API client: requests
- Ask a question → API client: requests
- API client → REST API: calls
- REST API → Eligibility service: assesses
- REST API → RAG orchestrator: answers
- Eligibility service → Profile handling: normalizes
- Eligibility service → Scheme ranking: ranks
- Scheme ranking → Eligibility evaluator: evaluates
- Eligibility evaluator → Rule engine: checks rules
- Eligibility service → Explanations: formats
- RAG orchestrator → Scheme detection: detects scheme
- RAG orchestrator → Hybrid retrieval: retrieves
- RAG orchestrator → Answer generation: generates answer
- Hybrid retrieval → Keyword retrieval: queries
- Hybrid retrieval → Vector index: queries
- Official sources → Document downloads: provides documents
- Document downloads → Source manifest: loads entries
- Document downloads → Official downloader: downloads
- RAG indexing → Document loader: loads documents
- RAG indexing → Structure chunker: chunks documents
- RAG indexing → Embedding provider: embeds chunks
- RAG indexing → Vector index: indexes chunks
