Inspiration
In a country as vast and diverse as India, the government rolls out numerous welfare schemes designed to uplift and support its citizens. Yet, a persistent paradox remains: a significant portion of these benefits never reaches the people who need them most. I was inspired by the challenge of bridging this "information gap." I've seen firsthand how the complexity of official language, the confusion around eligibility, and the daunting nature of application forms can become insurmountable barriers for many, especially in rural and marginalized communities.
The inspiration for Sahay AI came from a simple idea: what if every citizen had a trusted, knowledgeable friend who could patiently guide them through this entire process? With recent advancements in conversational AI, I realized we could build that "friend"—an intelligent agent that works for the people, simplifying bureaucracy and turning confusion into clarity.
What it does
Sahay AI is a multi-platform AI assistant designed to be a trusted guide for navigating Indian government welfare schemes. It transforms the daunting task of understanding bureaucracy into a simple, empowering conversation.
Key Features Implemented:
- Multilingual Conversational Interface: Users can ask questions in both English and Hindi. The AI understands the query and responds in clear, simple language.
- Multi-Platform Access: The assistant is deployed on two platforms for maximum accessibility: a user-friendly Streamlit web application (completed) and an whatsApp bot (incomplete).
- Deep Document Understanding: The AI's knowledge is based entirely on official government documents. It uses this information to answer specific questions about benefits, eligibility, and required documents.
- Transparent and Trustworthy: To build trust, the web interface shows the exact excerpts from the source document that were used to generate the answer, fulfilling the goal of Explainable AI (AIX360).
- Built-in Fairness Auditing: The platform includes a module using IBM's AI Fairness 360 to run simulated audits, demonstrating a commitment to ensuring the system provides equitable information to all demographic groups.
How we built it
Sahay AI is architected using the powerful Retrieval-Augmented Generation (RAG) pattern and is built on a stack of cutting-edge open-source and IBM technologies.
Core Orchestration: The agentic workflow is orchestrated using LangChain. It manages the conversational memory, connects the user's query to the knowledge base, and passes the context to the language model to generate a final answer.
Natural Language Intelligence (The "Brain"): The system is powered by IBM's Granite Models.
- Generation: We use the
ibm-granite/granite-3.3-8b-instructmodel for its powerful instruction-following and text generation capabilities. - Knowledge Base: The knowledge base is created using the
ibm-granite/granite-embedding-278m-multilingualmodel. This was a critical choice, as its multilingual nature allows the system to understand a Hindi query and retrieve the relevant information from an English-language document.
- Generation: We use the
Data Ingestion Pipeline: To create the knowledge base, we built a pipeline that:
- Extracts clean text from the official government scheme PDF using the PyMuPDF library.
- Chunks the text into manageable pieces for the AI.
- Uses the IBM Granite embedding model to convert these chunks into vectors.
- Stores these vectors in a FAISS database for efficient, high-speed semantic search.
Responsible AI Layer: We integrated IBM AI Fairness 360 (AIF360) directly into the Streamlit application. The "Run Fairness Audit" feature simulates queries from different demographic groups and calculates the Statistical Parity Difference to ensure the information retrieval process is not biased.
Deployment: The project is deployed as two separate but connected applications on Hugging Face Spaces:
- A Streamlit application serves as the primary web UI and project showcase.
- A lightweight Flask server acts as the API webhook to receive messages from the WhatsApp Business API.
Challenges we ran into
The "Cold Start" Problem: Deploying a multi-gigabyte model like Granite on a serverless platform presented a significant real-world challenge. The first query after a period of inactivity would be very slow because the model had to be loaded into memory from scratch. We addressed this by implementing a more informative loading message in the Streamlit UI ("...the AI model is waking up") to manage user expectations, demonstrating an understanding of the practical limitations of LLM deployment.
Ensuring Simplicity: The Granite model is powerful, but initial responses were sometimes still too technical. This required significant prompt engineering. We crafted a detailed system prompt that strictly instructs the model to be "polite and professional," use simple language, and refuse to answer off-topic questions, which greatly improved the user experience.
Library Dependencies & Updates: The
aif360library had updated its API, causing severalTypeErrorandValueErrorexceptions during development. This required careful debugging of the function arguments to match the latest version's requirements, highlighting the importance of managing dependencies in a rapidly evolving AI ecosystem.
Accomplishments that we're proud of
We are incredibly proud of successfully building and deploying a complete, end-to-end RAG pipeline from scratch. Moving from a theoretical proposal to two live, functional applications—a web UI—that use a state-of-the-art IBM Granite model is a major accomplishment.
Furthermore, we are proud to have not just talked about Responsible AI, but to have implemented a functional fairness audit directly into the user-facing application using IBM AIF360.
What we learned
This project was a deep dive into the practical realities of building and deploying modern AI systems. We learned that the true power lies in the orchestration of components—how a framework like LangChain can connect a knowledge base, a powerful LLM, and user memory into a cohesive agent.
We also gained a profound appreciation for the challenges of MLOps (Machine Learning Operations), especially the "cold start" problem, and how important UI/UX is in mitigating these technical hurdles for the end-user. Most importantly, we learned that technology is at its best when it serves to simplify, empower, and connect people to the resources they deserve.
What's next for Sahay AI
Our development plan is structured for rapid, high-impact delivery.
- Phase 1 (Hackathon MVP): Build the core agentic workflow using an orchestration framework. We will focus on a single, high-impact scheme to create a functional demo for scheme discovery and information simplification. (Completed)
- Phase 2 (Post-Hackathon): Expand the Knowledge Base to the top 15 national schemes and enhance multi-language support and also including a whatsApp bot
- Phase 3 (Long-Term): Integrate state-specific schemes, conduct user testing with a pilot group, and deploy.
Built With
- css3
- html5
- ibm-cloud
- ibm-granite
- natural-language-processing
- python
- rag
- streamlit
Log in or sign up for Devpost to join the conversation.