How prem8123/schemeai works
SchemeAI matches student profiles against education schemes using deterministic eligibility rules, while retrieving provenance-backed evidence and optionally generating a grounded answer. Students submit a profile and question through either frontend; the API returns ranked eligibility results, evidence, freshness, and localized response data. The graph includes official-source ingestion, record validation, retrieval, and freshness capabilities documented in the README. The API implementation and several modules were not excerpted, so connections involving them are marked unverified rather than inferred as confirmed calls.
Main entry points: main.py REST API · data.py Scheme loader · agents.py Planner · rag.py Evidence retrieval
Components 20
Student interfaces
- Streamlit UI
frontend/streamlit_app.py - Web UI
web/app.js
API orchestration
- REST API
app/main.py - Planner
app/agents.py - Language detection
app/language.py - Translations
app/translations.py - API key protection
app/auth.py - Input security
app/security.py
Matching and evidence
- Eligibility engine
app/eligibility.py - Evidence retrieval
app/rag.py - Grounded answer
app/llm.py - Freshness status
app/freshness.py
Scheme records
- Scheme loader
app/data.py - Domain models
app/models.py - Provenance schemas
app/schema.py
Source ingestion
- Document ingestion
app/ingestion.py - Official scheme records
data/official/schemes.jsonl - Demo scheme records
data/demo/schemes.jsonl - Official ingest command
scripts/ingest_official.py
Other components
- Student
Connections 24
- Student → Streamlit UI: enters profile
frontend/streamlit_app.py - Student → Web UI: enters profile
web/app.js - Streamlit UI → REST API: posts recommendation
frontend/streamlit_app.py - Web UI → REST API: posts recommendation
web/app.js - REST API → Planner: dispatches request
- Planner → Evidence retrieval: retrieves evidence
app/agents.py - Planner → Eligibility engine: ranks schemes
app/agents.py - Planner → Scheme loader: reads schemes
app/agents.py - Planner → Grounded answer: requests answer
app/agents.py - REST API → Language detection: detects language
- REST API → Translations: localizes response
- REST API → API key protection: checks API key
- REST API → Input security: sanitizes input
- Evidence retrieval → Scheme loader: loads schemes
app/rag.py - Evidence retrieval → Provenance schemas: builds evidence
app/rag.py - Scheme loader → Provenance schemas: validates clauses
app/data.py - Scheme loader → Domain models: creates schemes
app/data.py - Eligibility engine → Domain models: evaluates profiles
app/eligibility.py - Freshness status → Scheme loader: reads freshness
app/freshness.py - Official ingest command → Document ingestion: ingests source
scripts/ingest_official.py - Document ingestion → Provenance schemas: validates records
- Document ingestion → Official scheme records: writes records
- Scheme loader → Official scheme records: loads official records
app/data.py - Scheme loader → Demo scheme records: loads demo records
app/data.py