Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

272 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿค– Vaani (เคตเคพเคฃเฅ€)

Typing SVG

๐Ÿ—ฃ๏ธ Democratizing Digital Access Through Voice โ€“ Empowering India's Underserved Populations

Python 3.10+ Flask Google STT gTTS Sentence Transformers License: MIT SDG Goals


Bridging the Digital Divide with Zero Literacy Barriers! ๐ŸŒพ

๐ŸŒ Deploy on Render โ€ข ๐Ÿ“– About โ€ข โš™๏ธ How It Works โ€ข ๐Ÿ—๏ธ Architecture โ€ข ๐Ÿ› ๏ธ Tech Stack โ€ข ๐Ÿš€ Setup


๐Ÿ“– About the Project

Vaani (เคตเคพเคฃเฅ€) is India's first voice-first digital inclusion platform designed specifically for 300+ million functionally illiterate and semi-literate citizens. By removing text literacy as a pre-requisite for digital services, Vaani enables anyone who can speak to seamlessly access essential government schemes, agricultural advice, market commodity prices, weather forecasts, financial services, news, and emergency assistance.

While agriculture served as our entry point, Vaani empowers all underserved populations: farmers (146M), elderly citizens (104M), disabled persons (27M), domestic workers (50M), daily wage workers (139M), women in conservative families (80M), and migrant workers (139M) who are otherwise excluded from India's digital revolution.

Note

๐ŸŽฏ Mission: To democratize digital access across India by ensuring that literacy is never a barrier to accessing critical information, fundamental rights, financial tools, and life-saving emergency services.


๐Ÿšจ The Problem

โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—
โ•‘        โš ๏ธ  CHALLENGES IN RURAL & LITERACY-BARRED ACCESS     โ•‘
โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ
โ•‘                                                              โ•‘
โ•‘  ๐Ÿ“„  Text-heavy mobile apps & websites bar 300M+ citizens   โ•‘
โ•‘  ๐ŸŒพ  Farmers lack real-time market prices & crop disease infoโ•‘
โ•‘  ๐Ÿ›๏ธ  Government welfare schemes remain unused & inaccessible  โ•‘
โ•‘  ๐ŸŒฆ๏ธ  Unpredictable weather losses without localized alerts   โ•‘
โ•‘  ๐Ÿ“ฑ  Complex touch UI navigation confuses elderly & disabled  โ•‘
โ•‘  ๐ŸŒ  Poor internet connectivity in remote rural pockets      โ•‘
โ•‘                                                              โ•‘
โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•

Traditional mobile applications and digital government portals rely heavily on text literacy, complex menu navigation, and constant high-speed internet connection. This creates a severe digital divide, leaving over 695 million rural and semi-literate Indians without access to vital economic and social resources.


โœ… Our Solution

Vaani transforms digital interaction into an intuitive, voice-first experience powered by semantic NLU and local caching:

๐ŸŽฏ Core Capabilities

  • ๐Ÿ—ฃ๏ธ Conversational Voice Interface in Natural Hindi
  • ๐ŸŒพ Live Agmarknet Market Prices & Crop Advisories
  • ๐Ÿ“‹ Automated Government Scheme Eligibility Checker
  • ๐ŸŒฆ๏ธ Location-Aware Weather Forecasts & Warnings

๐Ÿš€ Key Benefits

  • โšก Zero Literacy Barrier (Spoken Voice In & Out)
  • ๐ŸŒ Offline Mode for Low Connectivity Areas
  • ๐Ÿ’ฐ Built-in Expense Tracker & Calculator
  • ๐Ÿšจ One-Touch Voice Emergency Helpline Router

โš™๏ธ How It Works

sequenceDiagram
    participant User
    participant WebUI as Browser UI / Mic
    participant STT as Google Speech API
    participant Router as Main Engine (main.py)
    participant NLU as Sentence Transformer NLU
    participant Services as Service Layer
    participant TTS as gTTS & Audio Engine
    participant Cache as Offline Cache / Local Data

    User->>WebUI: Speak Query (Hindi/Regional)
    WebUI->>STT: Stream Audio Input
    STT-->>Router: Return Transcribed Text
    Router->>NLU: Semantic Intent Matching
    alt Online Mode
        Services->>APIs: Query Agmarknet / Weather / News API
        APIs-->>Services: Return Live Data
    else Offline Mode
        Services->>Cache: Query Local Cache / JSON Data
        Cache-->>Services: Return Cached Response
    end
    Services-->>Router: Formulate Spoken Response Text
    Router->>TTS: Convert Text to Speech (gTTS + Pydub)
    TTS-->>WebUI: Stream Audio Playback (.mp3)
    WebUI-->>User: Play Spoken Response & Display Card
Loading

๐Ÿ”„ Step-by-Step User Journey

1๏ธโƒฃ Speak Command


Speech Recognition


Click microphone or speak naturally in Hindi / regional dialect

2๏ธโƒฃ Intent Recognition


Sentence Transformers


Sentence Transformers map colloquial speech to underlying actions

3๏ธโƒฃ Live API / Cache Retrieval


API Integration


Fetches Agmarknet prices, OpenWeather reports, or cached JSON

4๏ธโƒฃ Context Management


State Engine


Remembers conversation history for seamless multi-turn follow-ups

5๏ธโƒฃ Voice Synthesis


gTTS & Audio


Generates natural speech with volume normalization & speed tuning

6๏ธโƒฃ Audio Response


Audio Output


Plays audio response clearly while rendering summary cards on screen


๐Ÿ—๏ธ System Architecture

flowchart TB
    subgraph Client["๐ŸŒ Client & Interaction Layer"]
        WebUI["Web Interface<br/>(HTML5 / CSS3 / Web Speech API)"]
        CLI["Terminal CLI Interface<br/>(Pygame Audio / SoundDevice)"]
    end
    
    subgraph Core["โš™๏ธ Core Processing & Voice Pipeline"]
        Router["main.py Engine Router"]
        VoiceIO["voice_tool.py<br/>(STT & gTTS Synthesis)"]
        LangMgr["language_manager.py<br/>(Multi-language Support)"]
        NLU["Sentence Transformer & RapidFuzz<br/>Semantic Intent Classifier"]
        OfflineMgr["offline_mode.py & CacheManager"]
    end
    
    subgraph Services["โšก Domain Service Layer"]
        S_Agri["Agriculture Service<br/>(Crops, Mandi Prices, Subsidies)"]
        S_Weather["Weather Service<br/>(Live Weather & Forecasts)"]
        S_News["News Service<br/>(Category Headlines & Summaries)"]
        S_Scheme["Social Welfare Service<br/>(PM-KISAN, Loans, Pensions)"]
        S_Finance["Finance & Expense Service<br/>(Calculator, Expense Tracker)"]
        S_Emerg["Emergency Assistance<br/>(Helpline Router)"]
        S_GK["Knowledge Service<br/>(Wikipedia & Gemini AI)"]
    end
    
    subgraph Data["๐Ÿ’พ Storage & External Integration Layer"]
        Agmarknet["๐ŸŒพ Agmarknet API"]
        OpenWeather["๐ŸŒฆ๏ธ OpenWeatherMap API"]
        GNews["๐Ÿ“ฐ GNews API"]
        Gemini["๐Ÿง  Google Gemini AI"]
        LocalData[("๐Ÿ“ฆ Local JSON Data<br/>(30+ Crops, Schemes, Cache)")]
    end
    
    WebUI -->|1. Voice / Text Query| Router
    CLI -->|1. Mic Audio Input| Router
    Router --> VoiceIO
    Router --> LangMgr
    Router --> NLU
    Router --> OfflineMgr
    
    NLU -->|2. Route Intent| Services
    
    S_Agri --> Agmarknet
    S_Agri --> LocalData
    S_Weather --> OpenWeather
    S_News --> GNews
    S_News --> LocalData
    S_Scheme --> LocalData
    S_Finance --> LocalData
    S_Emerg --> LocalData
    S_GK --> Gemini
    
    Services -->|3. Structured Response| Router
    Router -->|4. Speech Output| WebUI
    Router -->|4. Play Audio| CLI
    
    style Client fill:#00d4ff,stroke:#0099cc,stroke-width:3px
    style Core fill:#ff66ff,stroke:#cc44cc,stroke-width:3px
    style Services fill:#ff6b35,stroke:#cc5529,stroke-width:3px
    style Data fill:#00ff88,stroke:#00cc66,stroke-width:3px
Loading

๐Ÿ› ๏ธ Technology Stack

๐Ÿ—ฃ๏ธ Speech, Audio & NLU

Python SpeechRecognition gTTS Pygame FFmpeg Sentence Transformers

Advanced STT, gTTS voice synthesis, Pydub volume/speed enhancement, Pygame playback, and semantic intent matching

๐ŸŒ Backend Server & Web Framework

Flask Flask CORS HTML5 CSS3

Flask web engine serving REST endpoints, Web Speech mic integration, and responsive cards

๐Ÿ”Œ APIs & External Integrations

OpenWeatherMap GNews Agmarknet Google Gemini AI Wikipedia

Integrated government & commercial REST APIs for real-time weather, market rates, news, and knowledge queries

๐Ÿ“ฆ Storage & Deployment

Docker Render JSON

Offline-first local JSON caching architecture deployable on Render cloud or Docker containers


๐Ÿ“‚ Project Structure

Vaani/
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ vaani/                       # Core Package Source Code
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ core/                    # System Core & Engine Modules
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿš€ main.py              # Application entry point & command router loop
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ”Š voice_tool.py        # SpeechRecognition (STT) & gTTS audio pipeline
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿง  context_manager.py   # State management (NewsContext, AgriContext, SchemeContext)
โ”‚   โ”‚   โ”œโ”€โ”€ ๐ŸŒ language_manager.py  # Multi-language translation & TTS code resolver
โ”‚   โ”‚   โ”œโ”€โ”€ โš™๏ธ config.py            # Central triggers (30+ lists), phrases & API keys
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ’พ offline_mode.py      # Offline connectivity checker & local fallback router
โ”‚   โ”‚   โ”œโ”€โ”€ โšก cache_manager.py      # Cache invalidation & storage controller
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ”’ api_key_manager.py  # Secure API key encryption & loader
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ services/                # Modular Domain Service Layer
โ”‚   โ”‚   โ”œโ”€โ”€ ๐ŸŒพ agriculture/         # Crop advisories (30+ crops) & Agmarknet market rates
โ”‚   โ”‚   โ”œโ”€โ”€ ๐ŸŒฆ๏ธ weather/             # OpenWeatherMap API wrapper & rain advisories
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ฐ news/                # GNews API integration & headline summarizer
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“‹ social/              # Government schemes (PM-KISAN, Ayushman Bharat) & emergency
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ’ธ finance/             # Expense tracker, daily calculator & financial literacy
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿง  knowledge/           # Wikipedia API & Google Gemini AI fallback
โ”‚   โ”‚   โ”œโ”€โ”€ ๐Ÿ“ฑ communication/       # SMS / USSD messaging integration
โ”‚   โ”‚   โ””โ”€โ”€ ๐Ÿ•’ time/                # Current date, time & history facts
โ”‚   โ”‚
โ”‚   โ”œโ”€โ”€ ๐Ÿ“ utils/                   # Shared Helper Utilities
โ”‚   โ””โ”€โ”€ ๐ŸŒ web.py                   # Flask server entry point & web API routes
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ data/                        # Static Data Models & Offline Cache
โ”‚   โ”œโ”€โ”€ ๐ŸŒพ crop_data/               # JSON datasets for 30+ crops
โ”‚   โ”œโ”€โ”€ ๐Ÿ“‹ scheme_data/             # Government scheme eligibility guidelines
โ”‚   โ”œโ”€โ”€ ๐Ÿ’ณ loan_data/               # Microfinance & KCC loan details
โ”‚   โ”œโ”€โ”€ ๐Ÿ’ธ subsidy_data/            # Agricultural subsidies documentation
โ”‚   โ””โ”€โ”€ ๐Ÿ’พ offline_cache/           # Cached news, weather, and market responses
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ docs/                        # Project Documentation
โ”‚   โ”œโ”€โ”€ ๐Ÿ—๏ธ PROJECT_ARCHITECTURE.md  # Detailed system architecture & flow diagrams
โ”‚   โ”œโ”€โ”€ ๐Ÿ“– USER_MANUAL.md           # End-user voice command guide
โ”‚   โ”œโ”€โ”€ ๐Ÿ› DEBUGGING_GUIDE.md       # Error tracking & troubleshooting procedures
โ”‚   โ””โ”€โ”€ ๐Ÿš€ RENDER_DEPLOYMENT_GUIDE.md# Cloud deployment step-by-step instructions
โ”‚
โ”œโ”€โ”€ ๐Ÿ“ tests/                       # Automated Test Suite (Unittest)
โ”œโ”€โ”€ โšก start_web.ps1                 # Windows web interface launcher script
โ”œโ”€โ”€ โšก start_vaani.ps1               # Windows CLI launcher script
โ”œโ”€โ”€ ๐Ÿณ Dockerfile                   # Docker container build specification
โ”œโ”€โ”€ โš™๏ธ render.yaml                  # Render cloud deployment specification
โ”œโ”€โ”€ ๐Ÿ“„ requirements.txt             # Python dependencies specification
โ”œโ”€โ”€ ๐Ÿ“„ setup.py                     # Package installation configuration
โ”œโ”€โ”€ ๐Ÿ“– README.md                    # Main Project Documentation
โ””โ”€โ”€ ๐Ÿ“„ LICENSE                      # MIT Open Source License

๐Ÿ—ฃ๏ธ Voice Commands & Service Reference

Service Example Hindi Voice Command Functionality Data Source / API
๐ŸŒพ Crop Advisory "เคงเคพเคจ เค•เฅ€ เค–เฅ‡เคคเฅ€ เค•เฅ‡ เคฌเคพเคฐเฅ‡ เคฎเฅ‡เค‚ เคฌเคคเคพเค“" Comprehensive farming guide, soil & sowing tips Local JSON (30+ crops)
๐Ÿ’ฐ Market Prices "เค†เคœ เค—เฅ‡เคนเฅ‚เค‚ เค•เคพ เคฐเฅ‡เคŸ เค•เฅเคฏเคพ เคนเฅˆ" Real-time commodity market prices Agmarknet API
๐Ÿ“‹ Govt Schemes "PM Kisan เคฏเฅ‹เคœเคจเคพ เค•เฅ‡ เคฌเคพเคฐเฅ‡ เคฎเฅ‡เค‚ เคฌเคคเคพเค“" Scheme details, eligibility & application steps Scheme JSON Datasets
๐ŸŒฆ๏ธ Weather Report "เคฆเคฟเคฒเฅเคฒเฅ€ เค•เคพ เคฎเฅŒเคธเคฎ เค•เฅˆเคธเคพ เคนเฅˆ" Temperature, humidity, rain forecast & advice OpenWeatherMap API
๐Ÿ“ฐ Voice News "เค†เคœ เค•เฅ€ เคคเคพเคœเคผเคพ เค–เคฌเคฐเฅ‡เค‚ เคธเฅเคจเคพเค“" Top headlines with interactive details GNews API & Cache
๐Ÿงฎ Calculator "500 เคฎเฅ‡เค‚ เคธเฅ‡ 200 เค˜เคŸเคพเค“" Hands-free spoken arithmetic calculations Internal Math Engine
๐Ÿ’ธ Expense Tracker "เค–เคฐเฅเคšเคพ เคœเฅ‹เคกเคผเฅ‹ 500 เคฐเฅเคชเคฏเฅ‡ เคฌเฅ€เคœ" Log expense items and query monthly spend totals Local Storage / JSON
๐Ÿšจ Emergency "เคเคฎเฅเคฌเฅเคฒเฅ‡เค‚เคธ เคจเค‚เคฌเคฐ เคฌเคคเคพเค“" Immediate helpline routing (100, 102, 1091) Emergency Directory
๐Ÿง  General Knowledge "เคญเคพเคฐเคค เค•เฅ€ เคฐเคพเคœเคงเคพเคจเฅ€ เค•เฅเคฏเคพ เคนเฅˆ" Answer curiosity questions & general facts Google Gemini AI / Wikipedia

๐Ÿš€ Setup & Deployment Guide

Prerequisites

  • Python 3.8+ (Python 3.10+ recommended)
  • Microphone & Speaker connected to your device
  • FFmpeg installed (for audio enhancement with Pydub)
  • Modern web browser (Google Chrome or Microsoft Edge recommended)

1๏ธโƒฃ Clone the Repository

git clone https://github.com/ankittroy-21/Vaani.git
cd Vaani

2๏ธโƒฃ Install Dependencies & FFmpeg

Install Python packages:

pip install -r requirements.txt

Install FFmpeg:

  • Windows (PowerShell):
    .\scripts\install_ffmpeg.ps1
  • Linux (Ubuntu/Debian):
    sudo apt-get update && sudo apt-get install -y ffmpeg
  • macOS:
    brew install ffmpeg

3๏ธโƒฃ Configure API Keys

Create a .env file in the root directory:

WEATHER_API_KEY=your_openweathermap_key
GNEWS_API_KEY=your_gnews_key
AGMARKNET_API_KEY=your_agmarknet_key
GEMINI_API_KEY=your_google_gemini_key

Free API Keys:


4๏ธโƒฃ Run Vaani Locally

Option A: Web Interface (Recommended) ๐ŸŒ

Windows (PowerShell Quick Start):

.\start_web.ps1

Manual Start (Any OS):

python -m vaani.web

Open your browser at http://localhost:5000 ๐ŸŽ‰

Option B: Terminal CLI Mode ๐Ÿ’ป

python -m vaani.core.main

5๏ธโƒฃ Deploy to Cloud (Render / Docker)

Deploy to Render

Deploy with Docker:

docker build -t vaani-app .
docker run -p 5000:5000 vaani-app

๐Ÿ”ฎ Future Enhancements & Roadmap

timeline
    title Vaani Development Roadmap
    section Phase 1 (Completed)
        Q4 2025 : Core NLU & Voice Engine
               : Agmarknet & Weather Integration
               : Web Interface & Offline Cache
    section Phase 2 (Current)
        Q1 2026 : Multi-language Support (Marathi, Bengali)
               : Render Cloud Deployment & Keep-Alive
               : Advanced Financial Expense Logging
    section Phase 3 (Upcoming)
        Q2 2026 : AI Crop Disease Detection from Photos
               : Native Android App with Offline Voice
               : SMS / USSD Integration for Feature Phones
    section Phase 4 (Future)
        Q3-Q4 2026 : IoT Sensor Integration for Soil Moisture
               : Voice Community Forum for Farmers
               : Expansion to 10+ Regional Dialects
Loading

๐ŸŽฏ Planned Features Checklist

  • Natural Hindi Voice STT & gTTS Audio Pipeline
  • Agmarknet Live Mandi Prices & 30+ Crop Datasets
  • Offline Mode Cache for Essential Schemes & News
  • ๐Ÿ“ฑ Native Android Application - Offline voice processing on low-cost smartphones
  • ๐Ÿค– AI Crop Disease Scanner - Instant leaf diagnosis using computer vision
  • ๐Ÿ“ฒ USSD & Interactive Voice Response (IVR) - Access via basic feature phones without internet
  • ๐Ÿ—ฃ๏ธ Extended Regional Language Support - Full support for Punjabi, Gujarati, Telugu, and Kannada

๐Ÿ’ก Key Concepts & Use Cases

๐ŸŒพ For Farmers & Rural Citizens

  • โœ… Speak naturally in Hindi to check crop market prices before selling
  • โœ… Learn step-by-step disease control methods for 30+ crops
  • โœ… Check eligibility for PM-KISAN, crop insurance, and solar pumps
  • โœ… Get urgent weather advisories to plan harvesting & spraying

๐ŸŽ“ For Developers & Civic Tech Researchers

  • โœ… Reference implementation of low-literacy voice interface design
  • โœ… Offline-first architecture combining live APIs with local JSON cache
  • โœ… Hybrid NLU combining Sentence Transformers with fuzzy matching
  • โœ… Aligned with UN Sustainable Development Goals (SDG 1 & SDG 8)

๐Ÿ‘ฅ Contributors

Arpit Verma
Arpit Verma

GitHub โ€ข LinkedIn
Ankit Roy
Ankit Roy

GitHub โ€ข LinkedIn
Anurag Joshi
Anurag Joshi

GitHub โ€ข LinkedIn

College Minor Project | UN SDG Aligned (No Poverty & Decent Work)


๐Ÿ“„ License & Support

This project is open-source under the MIT License โ€” see the LICENSE file for details.

๐ŸŒŸ Show Your Support

If you find Vaani impactful or inspiring, please consider leaving a โญ on GitHub!

GitHub stars GitHub forks GitHub issues


๐Ÿ’ฌ Vaani: If You Can Speak, You Deserve Equal Access to Information & Opportunities!

ยฉ 2026 Vaani Team | Built with โค๏ธ for Digital Inclusion

About

No description, website, or topics provided.

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages