Skip to content

AtharvaVavhal/FaultLine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🌾 Bharat Sahayak AI

AI-Powered Multilingual Government Scheme Intelligence System

AWS Python Flask License

📖 Overview

Bharat Sahayak AI is an intelligent platform that helps Indian citizens discover government schemes they're eligible for. Using natural language processing and AI reasoning, it simplifies the complex landscape of 1000+ government schemes into personalized, actionable recommendations.

🎯 The Problem

  • Awareness Gap: Citizens don't know which schemes apply to them
  • Language Barrier: Schemes explained in English/complex language
  • Eligibility Complexity: Multi-factor criteria are hard to understand
  • Middlemen Dependency: Leads to fraud and misinformation
  • Low Utilization: Eligible citizens never apply

💡 Our Solution

  • ✅ Natural language input in multiple Indian languages
  • ✅ AI-powered eligibility reasoning (explains WHY you qualify)
  • ✅ Multilingual explanations in simple language
  • ✅ Voice interface for semi-literate users
  • ✅ Document intelligence for PDF processing
  • ✅ Step-by-step application guidance

🏗️ Architecture

Technology Stack

Frontend:

  • HTML5, CSS3, JavaScript
  • Responsive design for mobile and desktop

Backend:

  • Python 3.11
  • Flask web framework
  • RESTful API

AI/ML Services (AWS):

  • Amazon Bedrock (Claude 3 Sonnet) - Core reasoning and NLP
  • Amazon Comprehend - Entity extraction and language detection
  • Amazon Textract - PDF text extraction
  • Amazon Translate - Multi-language translation
  • Amazon Polly - Text-to-speech
  • Amazon Transcribe - Speech-to-text

Infrastructure (AWS):

  • AWS Lambda - Serverless compute
  • Amazon DynamoDB - Scheme database
  • Amazon S3 - Document storage
  • Amazon API Gateway - API management
  • AWS CloudWatch - Monitoring and logging

System Flow

User Input (Text/Voice)
    ↓
API Gateway
    ↓
Lambda: Profile Extractor (Comprehend + Bedrock)
    ↓
Structured User Profile
    ↓
Lambda: Scheme Matcher (DynamoDB + Bedrock)
    ↓
Matched Schemes with Reasoning
    ↓
Lambda: Translator (Amazon Translate)
    ↓
Regional Language Output
    ↓
Lambda: Voice Output (Amazon Polly - if requested)
    ↓
User Interface

🚀 Quick Start

Prerequisites

  • Python 3.11 or higher
  • pip (Python package manager)
  • Git

Installation

  1. Clone the repository
git clone https://github.com/yourusername/bharat-sahayak-ai.git
cd bharat-sahayak-ai
  1. Install dependencies
pip install -r requirements.txt
  1. Run the application
python app.py
  1. Access the web interface

Open your browser and navigate to:

http://localhost:5000

Usage Examples

Example 1: Farmer in Maharashtra

Input: "I am a farmer from Maharashtra, 45 years old, my annual income is 1.8 lakh, I own 2 acres of farmland"

Output:
✅ PM-KISAN - ₹6,000/year
✅ Maharashtra Mukhyamantri Kisan Yojana - ₹6,000/year

Example 2: Senior Citizen

Input: "I am 65 years old, my income is below 1 lakh per year, I have a BPL card, from Delhi"

Output:
✅ Indira Gandhi National Old Age Pension Scheme - ₹200-500/month
✅ PM Ujjwala Yojana - Free LPG connection

Example 3: Girl Child Education

Input: "I have a 5-year-old daughter, I want to save for her education"

Output:
✅ Sukanya Samriddhi Yojana - 8.2% interest with tax benefits

📊 Features

Core Features

  1. Intelligent Profile Extraction

    • Understands natural language input
    • Mixed language support (e.g., Hindi-English)
    • Extracts: age, income, occupation, location, category
  2. AI-Powered Eligibility Reasoning

    • Not just matching, but explaining WHY
    • Example: "You qualify because: farmer + land ownership + income < ₹2L"
    • Relevance scoring (0-100)
  3. Multilingual Support

    • Input and output in 10+ Indian languages
    • Simple, conversational explanations
    • Culturally appropriate context
  4. Document Intelligence

    • Processes government PDF circulars
    • Extracts eligibility criteria automatically
    • Summarizes in simple language
  5. Voice Interface (Coming Soon)

    • Voice input for semi-literate users
    • Voice output in regional languages
    • Critical for rural penetration
  6. Personalized Guidance

    • Required documents checklist
    • Step-by-step application process
    • Nearest help center information
    • Helpline numbers

Scheme Database

Current coverage:

  • 7+ Central government schemes
  • State-specific schemes (Maharashtra as pilot)
  • Categories: Agriculture, Housing, Social Security, Education, Energy, MSME

Schemes included:

  • PM-KISAN
  • PMAY (Pradhan Mantri Awas Yojana)
  • Indira Gandhi National Old Age Pension
  • Sukanya Samriddhi Yojana
  • PM Ujjwala Yojana
  • PMEGP (Employment Generation Programme)
  • Maharashtra Mukhyamantri Kisan Yojana

🔧 API Documentation

Base URL

http://localhost:5000/api

Endpoints

1. Analyze User Profile

POST /api/analyze
Content-Type: application/json

{
  "text": "I am a farmer from Maharashtra, 45 years old, income 1.8 lakh",
  "language": "en"
}

Response:

{
  "success": true,
  "profile": {
    "age": 45,
    "income": 180000,
    "occupation": "Farmer",
    "state": "Maharashtra",
    "hasLand": true
  },
  "totalMatches": 2,
  "schemes": [
    {
      "schemeId": "PMKISAN-001",
      "name": "PM-KISAN",
      "category": "Agriculture",
      "benefits": "₹6,000 per year",
      "relevanceScore": 85,
      "explanation": "You are eligible for PM-KISAN...",
      "documents": ["Aadhaar", "Land records", "Bank account"],
      "applicationProcess": "Apply at pmkisan.gov.in",
      "helpline": "155261"
    }
  ],
  "timestamp": "2024-01-15T10:30:00"
}

2. Get All Schemes

GET /api/schemes

3. Get Specific Scheme

GET /api/scheme/{scheme_id}

4. Health Check

GET /api/health

🎨 UI/UX Design

  • Color Palette: Teal Trust (aligned with AWS branding)
  • Responsive Design: Works on mobile, tablet, and desktop
  • Accessibility: High contrast, clear typography
  • Language Toggle: Easy switching between languages
  • Example Prompts: Quick-start templates for users

📈 Scalability

Current MVP

  • Flask development server
  • In-memory scheme database
  • Single instance

Production Roadmap

Phase 1 (Month 1-2):

  • Migrate to AWS Lambda + API Gateway
  • DynamoDB for scheme database
  • Amazon Bedrock integration for real AI reasoning
  • 100 central schemes coverage

Phase 2 (Month 3-4):

  • Add 500+ state schemes
  • 10 language support via Amazon Translate
  • Voice interface via Polly + Transcribe
  • Mobile app (React Native)

Phase 3 (Month 5-6):

  • DigiLocker integration
  • Direct application submission
  • CSC (Common Service Center) deployment
  • 10 state government partnerships

Target Metrics:

  • 100,000 users by Month 3
  • 70% satisfaction score
  • 50% reduction in agent dependency

🔐 Security & Privacy

  • No PII Storage: User profiles auto-deleted after 24 hours
  • Encryption: TLS 1.3 in transit, AWS KMS at rest
  • Compliance: Aligned with India's Digital Personal Data Protection Act
  • Rate Limiting: Prevents abuse and DDoS
  • Data Residency: AWS Mumbai region

🤝 Contributing

We welcome contributions! Please follow these steps:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Development Setup

# Create virtual environment
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

# Run tests
python -m pytest tests/

# Run locally
python app.py

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👥 Team

AI for Bharat Hackathon 2024-25

  • Your Name - Project Lead & Backend Developer
  • Team Member 2 - Frontend Developer
  • Team Member 3 - AI/ML Engineer
  • Team Member 4 - Data Engineer

🙏 Acknowledgments

  • AWS for cloud infrastructure and AI services
  • YourStory for organizing AI for Bharat hackathon
  • Government of India for open data on schemes
  • Community for feedback and testing

📞 Contact

🎯 Vision

Our vision is to create an inclusive AI platform that:

  • Empowers every Indian citizen with scheme awareness
  • Reduces dependency on middlemen and agents
  • Increases government scheme utilization by 50%
  • Supports 100+ million citizens in discovering benefits

Empowering Every Indian Citizen with AI 🇮🇳


Built with ❤️ for Bharat

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors