How aditya9122002/yojanagpt works
YojanaGPT is a multilingual assistant for discovering and understanding Indian government schemes. Citizens use its web interface and API to ask general questions or request eligibility checks, document lists, application guidance, comparisons, and contact details; the RAG pipeline retrieves scheme context, builds a task-specific prompt, and returns a grounded answer. A separate data workflow fetches scheme information and ingests it into ChromaDB. The API and RAG calls are visible in excerpts; scraper wiring and several subsystem details are documented but unsampled.
Main entry points: main.py FastAPI routes · retrieval/pipeline.py RAG orchestration · ingestion/pipeline.py Ingestion workflow · scraper.py Scrape orchestration
Components 22
Citizen interface
- Web interface
frontend/index.html - FastAPI routes
src/api/main.py - API schemas
src/api/models.py - Pipeline dependency
src/api/deps.py - Speech synthesis
src/api/tts.py
Answer generation
- RAG orchestration
src/retrieval/pipeline.py - Language detection
src/translation/detector.py - Query translation
src/translation/translator.py - Hybrid retrieval
src/retrieval/retriever.py - Task prompts
src/retrieval/prompt.py - Groq LLM client
src/retrieval/llm.py
Scheme knowledge
- ChromaDB store
src/ingestion/vectorstore.py - Scheme chunking
src/ingestion/chunker.py - Embedding generation
src/ingestion/embedder.py - Ingestion workflow
src/ingestion/pipeline.py
Data collection
- Scrape orchestration
src/scraper/scraper.py - MyScheme client
src/scraper/client.py - Scheme parser
src/scraper/parser.py - Scheme models
src/scraper/models.py
Other components
- Citizen
- Groq API
- MyScheme API
Connections 21
- Citizen → Web interface: asks through
- Web interface → FastAPI routes: sends requests
- FastAPI routes → API schemas: validates with
src/api/main.py - FastAPI routes → Pipeline dependency: gets pipeline
src/api/main.py - FastAPI routes → RAG orchestration: routes questions
src/api/main.py - FastAPI routes → Language detection: detects language
src/api/main.py - FastAPI routes → Speech synthesis: synthesizes speech
src/api/main.py - RAG orchestration → Query translation: translates text
src/retrieval/pipeline.py - RAG orchestration → Hybrid retrieval: retrieves chunks
src/retrieval/pipeline.py - RAG orchestration → Task prompts: builds prompts
src/retrieval/pipeline.py - RAG orchestration → Groq LLM client: generates answer
src/retrieval/pipeline.py - Groq LLM client → Groq API: posts prompt
src/retrieval/llm.py - Hybrid retrieval → ChromaDB store: searches chunks
- Ingestion workflow → Scheme chunking: chunks schemes
src/ingestion/pipeline.py - Ingestion workflow → Embedding generation: embeds chunks
src/ingestion/pipeline.py - Ingestion workflow → ChromaDB store: stores embeddings
src/ingestion/pipeline.py - Scrape orchestration → MyScheme client: fetches data
- Scrape orchestration → Scheme parser: parses responses
- Scheme parser → Scheme models: creates models
- MyScheme client → MyScheme API: requests scheme data
src/scraper/client.py - Scrape orchestration → Ingestion workflow: provides scraped data
README.md