IMD-grounded voice intelligence for farmers, fishermen, and disaster teams — district forecasts, sea-state and cyclone alerts in your language, no typing or English needed. Powered by the Agora Conversational AI Engine, Next.js web client, and Python FastAPI backend with a FastMCP tool layer. Features specialized personas (farmer, fisherman, disaster relief), real-time weather alerts, Cyclone eAtlas maps, and regional language support (Hindi, Bhojpuri, Marathi, and more).
- Python 3.10+
- Bun
- Agora CLI (optional, for project doctor and credential export)
To start both the FastAPI backend and Next.js frontend concurrently with one command:
bun run devThis starts:
- Frontend: http://localhost:3000
- Backend API: http://localhost:8000
- Interactive API Docs: http://localhost:8000/docs
- Health Check: http://localhost:8000/health
- FastMCP Endpoint: http://localhost:8000/mcp
If you prefer to run services in separate terminal windows for isolated logs and debugging:
# Cross-platform (Windows / macOS / Linux):
bun run backend
# Or via Python directly:
# Linux / macOS:
cd server && source venv/bin/activate && python src/server.py
# Windows (PowerShell):
cd server; .\venv\Scripts\python.exe src\server.py# Cross-platform (Windows / macOS / Linux):
bun run frontend
# Or directly in web/:
cd web && bun run devIf running for the first time or after a fresh git clone:
# Install root and workspace dependencies
bun install
# Prepare environment files and python dependencies
bun run setupConfigure your Agora credentials in server/.env:
AGORA_APP_ID=your_agora_app_id
AGORA_APP_CERTIFICATE=your_agora_app_certificateConfirm both services are running and healthy:
# Check backend health
curl http://localhost:8000/health
# Check API proxy through frontend
curl http://localhost:3000/api/get_configDeploy web as a Next.js app (Vercel Hobby) and server as a reachable Python service
(Render Free via render.yaml Blueprint). This is plan.md Step 6.1.
- Backend (Render): Dashboard -> New -> Blueprint -> select this repo's
render.yaml. Set secrets (AGORA_APP_ID,AGORA_APP_CERTIFICATE,SARVAM_API_KEY) in the dashboard — never commit them. After the first deploy, setBACKEND_URLto the livehttps://<service>.onrender.comURL and redeploy. - Why HTTPS matters: Agora calls
llm.mcp_serversserver-side, so/mcpmust be public HTTPS in prod.GET /healthreportsmcp_url+mcp_public_https— check it before any voice session. - Frontend (Vercel): import
web/, setAGENT_BACKEND_URLto the Render URL (seeweb/.env.example). Browser-facing/api/*routes in Next proxy to FastAPI via:
AGENT_BACKEND_URL=https://your-python-backend.example.com- Verify a deployment:
BACKEND_URL=https://your-python-backend.example.com bash scripts/verify-deploy.shThis curls /health (expects status: ok, agora_configured: true,
mcp_public_https: true) and POST /mcp tools/list. Then run one full voice
session via the production URL per plan.md 6.1.
- Without the Beta (today): use the phone-bridge fallback — start a conversation on the laptop, call it from any phone on speaker, hold the phone near the mic. Same voice loop, zero PSTN cost.
- With the Beta: request via Console → Talk to Us (mention SIH26068), set
TELEPHONY_ENABLED=true+TELEPHONY_FROM_NUMBER(+CUSTOMER_ID/CUSTOMER_SECRET), redeploy, point the Console webhook atPOST /telephonyWebhook. Then dial from the pre-call Phone Call panel (POST /dial, E.164) and end withPOST /hangup.
Set backend env values:
AGORA_APP_ID=your_agora_app_id
AGORA_APP_CERTIFICATE=your_agora_app_certificateTo export local env values from the Agora CLI-bound project:
agora project use <your-project>
agora quickstart env write .
rg "^(AGORA_APP_ID|AGORA_APP_CERTIFICATE)=" server/.envPrimary backend env file: server/.env.example.
| Variable | Required | Default | Notes |
|---|---|---|---|
AGORA_APP_ID |
✅ | — | Agora Console -> Project -> App ID |
AGORA_APP_CERTIFICATE |
✅ | — | Agora Console -> Project -> App Certificate (server only) |
PORT |
8000 |
FastAPI server port (Render injects its own) | |
AGENT_BACKEND_URL (web deploy) |
✅ | — | Required in deployed web app when proxying to external FastAPI |
BACKEND_URL (server deploy) |
✅ | — | Public https backend URL; defaults llm.mcp_servers to {BACKEND_URL}/mcp |
FRONTEND_URL (server deploy) |
✅ | — | Vercel URL (comma-separated ok) for CORS; localhost allowed by default |
Default vs BYOK — this quickstart defaults to Agora-managed STT + LLM + TTS in the backend. Enable BYOK by uncommenting provider blocks in
server/src/agent.pyand adding matching keys.
# Starting the app
bun run dev # Start both backend (8000) and frontend (3000) concurrently
bun run backend # Start FastAPI backend standalone
bun run frontend # Start Next.js frontend standalone
# Setup & Environment
bun run setup # Run full setup (env files + dependencies)
bun run setup:env # Prepare server/.env from template
# Quality & Verification
bun run verify # Full web verification (doctor + contracts + build)
bun run verify:backend # Python syntax/compilation checks
pytest server/tests # Run 200+ backend unit and integration tests
bun test # Run frontend unit tests (in web/)The browser talks to Next.js /api/* routes. In local mode, Next rewrites those routes to FastAPI using AGENT_BACKEND_URL=http://localhost:8000; FastAPI owns token generation and agent start/stop logic.
- Next.js web client (
web/) with transcript UI and agent visualizer - FastAPI backend (
server/) for token generation and agent lifecycle /api/get_config,/api/startAgent, and/api/stopAgentbrowser-facing contract- Managed default pipeline (Deepgram STT, OpenAI LLM, MiniMax TTS)
- Browser requests connection config from
/api/get_config. - Backend generates combined RTC+RTM config and returns channel + token.
- Browser joins RTC/RTM and starts streaming audio.
- Browser calls
/api/startAgent; backend starts the cloud agent session. - Browser receives transcript and state updates over RTM, and
/api/stopAgentends the session.
web/— Next.js 16 + React 19 + TypeScript frontendserver/— Python FastAPI backend + Agora Agent Server SDK integrationARCHITECTURE.md— system-level flow and ownership boundariesAGENTS.md— contributor agent instructions
- Agent does not join or transcripts are missing: run
agora project doctor --deep. - Missing credentials: run
agora quickstart env write .. - Auth errors from backend: confirm
AGORA_APP_IDandAGORA_APP_CERTIFICATEare set inserver/.env. - Frontend cannot reach backend: confirm
AGENT_BACKEND_URL=http://localhost:8000in local frontend scripts. - Unsure who owns
/api/*: Next owns browser-facing/api/*; FastAPI owns/get_config,/startAgent,/stopAgent.
- ARCHITECTURE.md
- AGENTS.md
- docs/ai/L1/02_architecture.md — full-stack topology and lifecycle
- docs/ai/L1/03_code_map.md — curated
web/+server/file map
Released under the MIT License.