{"id":29622805,"url":"https://github.com/aditya-ranjan1234/janavaani","last_synced_at":"2025-07-21T04:37:13.301Z","repository":{"id":304435912,"uuid":"1018789086","full_name":"Aditya-Ranjan1234/JanaVaani","owner":"Aditya-Ranjan1234","description":"JanaVaani is a voice-based AI assistant that empowers citizens to access government schemes, report civic issues, and get real-time help through a simple phone call.","archived":false,"fork":false,"pushed_at":"2025-07-13T04:00:39.000Z","size":1268,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-13T05:34:13.445Z","etag":null,"topics":["civic-tech","groq","llm-agent","public-good","twilio","voice-assistant"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Aditya-Ranjan1234.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-13T03:40:09.000Z","updated_at":"2025-07-13T04:00:42.000Z","dependencies_parsed_at":null,"dependency_job_id":"e7d396e1-befd-43d3-98bd-6829b98a4d1d","html_url":"https://github.com/Aditya-Ranjan1234/JanaVaani","commit_stats":null,"previous_names":["aditya-ranjan1234/janavaani"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Aditya-Ranjan1234/JanaVaani","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FJanaVaani","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FJanaVaani/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FJanaVaani/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FJanaVaani/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aditya-Ranjan1234","download_url":"https://codeload.github.com/Aditya-Ranjan1234/JanaVaani/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aditya-Ranjan1234%2FJanaVaani/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266241340,"owners_count":23898066,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["civic-tech","groq","llm-agent","public-good","twilio","voice-assistant"],"created_at":"2025-07-21T04:37:12.833Z","updated_at":"2025-07-21T04:37:13.284Z","avatar_url":"https://github.com/Aditya-Ranjan1234.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JanaVaani — Voice Assistant for Bharat 🇮🇳\n\n\u003e Your voice. Your rights. One call away.\n\n![Logo](docs/janavaani_logo.png)\n\n---\n\n## 📜 Problem Statement\n\nWhile **over a billion Indians own a mobile phone**, **most do not have a smartphone, reliable data, or the digital literacy** needed to navigate government portals or mobile apps.\n\nMeanwhile, India’s welfare ecosystem is **highly fragmented**:\n\n* A single city such as **Bengaluru has 40+ helpline numbers** for different civic services.\n* Farmers rarely know **which scheme** fits their situation or **where to apply**.\n* In distress, citizens are forced to **search, wait, or abandon** their request due to bureaucracy.\n\nThis results in:\n\n* **Under-utilised welfare funds**\n* **Unreported civic issues**\n* **Low trust in public institutions**\n\n\u003e Despite hundreds of portals and helplines, **there is no unified, voice-first access point** for citizens to seek help, discover schemes, or file complaints.\n\n## 🌟 Vision Statement\n\n**JanaVaani** envisions a **single-call, AI-powered voice gateway to governance** for every Indian — urban or rural, literate or not.\n\n\u003e “If you can speak, you can get help.”\n\nThe platform will:\n\n* **Listen** to any citizen via a plain phone call.\n* **Understand** their language, intent and location using LLMs.\n* **Guide** them to the correct scheme, solution or authority — instantly.\n* **Report** civic issues on their behalf and follow-up with SMS or WhatsApp.\n\nBy making government services **voice-first and AI-driven**, JanaVaani delivers **access, clarity and action** without requiring an app, internet or technical know-how.\n\n---\n\n## 🎯 What is JanaVaani?\n\n`JanaVaani` is an **AI-powered voice assistant** that citizens can call to:\n\n1. **Speak** their problem in their native language.\n2. **Understand** intent using a lightweight LLM (Groq Mixtral-8x7B).\n3. **Guide** them to suitable schemes *or* file complaints automatically.\n4. **Respond** with natural-sounding speech and follow-up SMS/WhatsApp.\n\nThe entire workflow happens inside a single phone-call—no smartphone or app required.\n\n---\n\n## 🧩 Key Features\n\n### Multi-Agent Orchestration (NEW!)\n\nJanaVaani now routes every utterance to the right **domain agent**:\n\n| Agent | Triggers | What it does |\n| ----- | -------- | ------------ |\n| 🌾 **AgricultureAgent** | Mentions of crops, irrigation, farming | Recommends welfare schemes, subsidies \u0026 insurance |\n| 🏛️ **CivicAgent** | Potholes, garbage, water leak, etc. | Captures location ➜ logs complaint to civic authority |\n| 🚨 **EmergencyAgent** | Fire, accident, violence, etc. | Auto–dials police / ambulance / fire and sends caller an SMS |\n\nAn `AgentOrchestrator` analyses keywords and seamlessly forwards the call to the right agent.\n\n| Module | Purpose |\n| ------ | ------- |\n| 🗣️ Voice Conversation | Bi-directional speech via Twilio Voice |\n| 🎙️ Whisper STT | Converts incoming audio → text |\n| 🧠 Groq LLM | Interprets intent \u0026 crafts helpful answers |\n| 🧾 Scheme Recommender | Finds matching welfare schemes from `data/schemes.csv` |\n| 🧭 Civic Reporter | Escalates complaints to e-mail / API endpoints |\n| 🔊 Coqui / pyttsx3 TTS | Generates multilingual speech replies |\n| 📲 SMS / WhatsApp | Sends call summary \u0026 links |\n| 🌐 Multilingual | Hindi, Kannada, English (extendable) |\n\n---\n\n## ⚙️ Tech Stack\n\n| Layer | Tech | Notes |\n| ----- | ---- | ----- |\n| Agent Framework | Custom Python package (`agents/`) | Orchestrator + domain agents |\n| Telephony | **Twilio Voice \u0026 SMS** | Voice flow + SMS confirmations |\n| Backend | **Flask (Python)** | Webhooks + agent invocation |\n| LLM | **Groq API – Mixtral-8x7B** | Natural language understanding |\n| STT | **OpenAI Whisper (local)** | Speech → text |\n| TTS | **Coqui TTS** / **pyttsx3** | Text → speech |\n| Data | **CSV / SQLite** | Schemes \u0026 call logs |\n| DevOps | **ngrok / Render** | Tunnels \u0026 hosting |\n\n| Layer | Tech | Notes |\n| ----- | ---- | ----- |\n| Telephony | **Twilio Voice** | Receive \u0026 record calls |\n| Backend | **Flask (Python)** | Webhooks + business logic |\n| LLM | **Groq API – Mixtral-8x7B** | Fast, free inference |\n| STT | **OpenAI Whisper (local)** | Accurate transcription |\n| TTS | **Coqui TTS** *(default)* / **pyttsx3** | Natural speech output |\n| Data | **CSV / SQLite / Airtable** | Welfare schemes \u0026 call logs |\n| Messaging | **Twilio SMS / WhatsApp** | Optional follow-ups |\n| DevOps | **ngrok / Render / Railway** | Tunnels \u0026 hosting |\n\n---\n\n## 🏗️ System Architecture\n\n```mermaid\nflowchart TD\n    A[Caller] --\u003e|1. Voice| B(Twilio Voice)\n    B --\u003e|2. POST /voice| C[Flask Webhook]\n    C --\u003e|Download recording| D[Whisper STT]\n    D --\u003e|Text| E[Groq LLM]\n    E --\u003e|Intent + Response| C\n    C --\u003e|Lookup| F[Scheme DB / Complaint API]\n    C --\u003e|TTS| G[Coqui / pyttsx3]\n    G --\u003e|Audio| B\n    C --\u003e|SMS / WhatsApp| H[Twilio Messaging]\n```\n\n---\n\n## 📂 Repository Structure\n\n```text\n├── agents/\n│   ├── __init__.py\n│   ├── base.py               # Abstract agent class\n│   ├── orchestrator.py       # Keyword router\n│   ├── agriculture/          # AgricultureAgent\n│   ├── civic/                # CivicAgent\n│   └── emergency/            # EmergencyAgent\n│       └── __init__.py\n├── app.py                    # Flask entry-point \u0026 Twilio endpoints\n```\n\n```text\n├── app.py              # Flask entry-point \u0026 Twilio endpoints\n├── stt_whisper.py      # Speech-to-Text helper\n├── tts.py              # Text-to-Speech helper\n├── groq_agent.py       # Groq LLM wrapper\n├── scheme_finder.py    # Welfare scheme matching logic\n├── messaging.py        # SMS \u0026 WhatsApp helpers\n├── translator.py       # Google-Translate wrapper\n├── store.py            # Persistent call logs (JSONL / SQLite)\n├── requirements.txt\n├── .env.example        # Template for environment variables\n├── data/\n│   └── schemes.csv     # Knowledge-base of schemes\n└── static/             # Audio and static assets\n```\n\n---\n\n## 🚀 Quick Start (Local)\n\n### 1. Clone \u0026 Install\n\n```bash\ngit clone https://github.com/\u003cyou\u003e/JanaVaani.git\ncd JanaVaani\npython -m venv .venv\n.venv\\Scripts\\activate      # PowerShell (Windows)\npip install -r requirements.txt\n```\n\n### 2. Configure Environment Variables\n\nCopy `.env.example` ➡️ `.env` and fill in:\n\n```\nTWILIO_ACCOUNT_SID=\u003csid\u003e\nTWILIO_AUTH_TOKEN=\u003ctoken\u003e\nTWILIO_PHONE_NUMBER=\u003c+1…\u003e\nGROQ_API_KEY=\u003ckey\u003e\n```\n\n### 3. Run the Server\n\n```bash\npython app.py\n```\n\nExpose it with **ngrok**:\n\n```bash\nngrok http 5000\n```\n\nPoint your Twilio Voice webhook to `https://\u003cngrok\u003e.ngrok-free.app/voice` and call your number!\n\n---\n\n## 🧪 Testing\n\n* Unit-test modules with `pytest`.\n* Use Twilio Console’s *Test-to-speech* to simulate calls.\n* Verify multiple languages \u0026 accents.\n\n---\n\n## 📈 Roadmap\n\n- [ ] Replace CSV with RAG + vector DB\n- [ ] Add dashboard (React / Streamlit) for NGO/Gov visibility\n- [ ] Offline missed-call → automatic callback queue\n- [ ] WhatsApp text bot\n- [ ] Regional language expansion (Bengali, Tamil…)\n\n---\n\n## 🤝 Contributing\n\n1. Fork the repo \u0026 create a branch (`git checkout -b feat/awesome`)\n2. Commit your changes and open a PR.\n3. Make sure `pre-commit` hooks pass.\n\n---\n\n## 📄 License\n\nDistributed under the MIT License. See `LICENSE` for more information.\n\n---\n\n© 2025 JanaVaani Team\n\n\n\n\n\n* Accept inbound voice calls via **Twilio**\n* Converts speech ↔ text with **OpenAI Whisper** and **pyttsx3** (offline TTS – swap with Coqui if desired)\n* Fast reasoning with **Groq** LLMs (Mixtral-8x7b)\n* Recommends relevant government schemes from a CSV knowledge-base\n* Sends SMS \u0026 WhatsApp summaries to the caller\n* Supports language translation (English ⇄ Hindi/Kannada) via Google Translate or `googletrans`\n* Simple admin dashboard endpoint to view recent calls\n\n\n\n1. ️Clone repo inside current folder.\n2. Create virtual env \u0026 install deps:\n\n```bash\npython -m venv .venv\nsource .venv/Scripts/activate  # Windows\npip install -r requirements.txt\n```\n\n3. Copy `.env.example` to `.env` and fill Twilio / Groq keys.\n\n4. Run the server:\n\n```bash\npython app.py\n```\n\n5. Expose local port with ngrok (or Cloudflare tunnel):\n\n```bash\nngrok http 5000\n```\n\n6. Point your Twilio phone-number Voice webhook to `https://\u003cngrok\u003e.ngrok-free.app/voice`.\n\n7. Call the number – the agent will interact in Hindi by default and send you a summary SMS/WhatsApp.\n\n\n\n```\n│ app.py              # Flask server + endpoints\n│ stt_whisper.py      # Speech-to-text helper\n│ tts.py              # Text-to-speech helper\n│ groq_agent.py       # Groq LLM wrapper\n│ scheme_finder.py    # Finds relevant govt schemes\n│ messaging.py        # SMS \u0026 WhatsApp helpers via Twilio\n│ translator.py       # Google Translate wrapper\n│ store.py            # Saves call logs (JSONL)\n│ requirements.txt\n│ .env.example\n│ data/\n│   └── schemes.csv   # Gov schemes knowledge-base\n└─ static/\n```\n\n\n\n* Add more languages → improve `translator.py`\n* Swap pyttsx3 with Coqui TTS for better quality\n* Integrate real complaint-filing APIs in `handle_conversation_logic`\n* Build beautiful React dashboard that consumes `/admin/calls`\n\n---\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya-ranjan1234%2Fjanavaani","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faditya-ranjan1234%2Fjanavaani","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faditya-ranjan1234%2Fjanavaani/lists"}