A semantic search engine and deterministic rule engine for government scheme eligibility, built with Next.js, Node.js, and MongoDB Vector Search
India possesses a vast repository of central and state government welfare schemes, yet information asymmetry and complex eligibility criteria prevent efficient distribution. Existing search solutions rely on rudimentary keyword matching, while naive LLM implementations suffer from catastrophic hallucination regarding strict legal and demographic constraints.
Sarkari Saathi is a full-stack web application designed to democratize civic data distribution through a strictly constrained Retrieval-Augmented Generation (RAG) pipeline.
Frontend: Next.js for server-side rendered, low-latency client interactions.
Backend: Node.js and Express.js REST API handling data ingestion, ETL pipelines, and LLM orchestration.
Database: MongoDB Atlas utilizing Vector Search for high-dimensional semantic indexing of scheme documents.
The core architectural innovation is the decoupling of semantic search from eligibility verification to prevent AI hallucination.
Vector Retrieval: The system uses semantic embeddings to retrieve highly relevant schemes based on unstructured natural language user queries.
Deterministic Rule Engine: Retrieved schemes are passed through a strict boolean evaluation engine. The user's demographic JSON payload (income, location, age, gender) is mathematically verified against scheme constraints, ensuring 100% deterministic output.