βββββββββββ βββββββββ βββ ββββββ βββ βββ ββββββ βββββββββ ββββββ βββ
βββββββββββ βββββββββ ββββββββββββββββ ββββββββββββββββββββββββββββββββ
ββββββββββββββββββββββββββ ββββββββ βββββββ ββββββββ βββ βββββββββββ
ββββββββββββββββββββββββββ ββββββββ βββββ ββββββββ βββ βββββββββββ
βββββββββββ βββββββββ ββββββ βββ βββ βββ βββ βββ βββ ββββββ
βββββββββββ βββββββββ ββββββ βββ βββ βββ βββ βββ βββ ββββββ
AI-Powered Civic Complaint Resolution System for Karachi
ShikayatAI is a bilingual (Urdu & English) civic complaint resolution platform engineered specifically for the citizens of Karachi, Pakistan. Built for the Google x Kaggle AI Agents: Intensive Vibe Coding Capstone Project, it leverages a multi-agent AI pipeline built on Google's ADK and the Groq Llama 3.3 70B model to instantly categorize, route, and draft formal civic complaints based on natural language input.
Instead of citizens navigating complex bureaucracy or figuring out which department handles their specific issue (e.g., KWSB for water, KE for electricity, SSMB for garbage), ShikayatAI acts as a single intelligent portal. A user simply types their problem in plain Urdu, Roman Urdu, or English. The AI pipeline runs a safety pre-check, dynamically researches live contact info for the correct authority via Google Search, and drafts formal, reference-tracked complaint letters in both languages, ready for submission.
| Service | URL |
|---|---|
| Frontend (Cloud Run) | https://shikayatai-web-941068767562.asia-south1.run.app |
| Backend API (Cloud Run) | https://shikayatai-api-941068767562.asia-south1.run.app |
| Backend Health Check | https://shikayatai-api-941068767562.asia-south1.run.app/api/health |
- Built using the Google Agent Development Kit (ADK) and
SequentialAgentorchestration. - Three distinct, specialized agents work in tandem: Classifier, Researcher, and Drafter.
- Intercepts and rejects medical emergencies, active crimes, political rants, or gibberish.
- Returns empathetic, bilingual redirection (e.g., advising users to call 15 for police or 1122 for medical).
- Maps colloquial Karachi civic issues to official bodies (KWSB, KE, KMC, SSMB, SBCA, PTCL, SSGC).
- Assesses and assigns priority levels (
high,medium,low) to every issue.
- Executes real-time Google Searches via tool calling to scrape up-to-date official complaint portals, helplines, and physical addresses of the determined authority.
- Uses dynamically generated unique tracking reference numbers (
REF-[YEAR]-[ID]) and localized timestamps. - Generates highly formal, ready-to-print official complaint letters in both English and Urdu (Nastaliq).
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β FRONTEND β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Next.js 14 Web UI (Tailwind CSS, Urdu Nastaliq Fonts) β β
β β Single Page App -> POST /api/complaint β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββ
β JSON Payload
βββββββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββββββ
β BACKEND API β
β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β FastAPI (api/main.py) β β
β β ββ Global Error Handlers (Bilingual) β β
β β ββ Latency & Logging Middlewares β β
β βββββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ β
β β β
β βββββββββββββββββββββββββββββββΌβββββββββββββββββββββββββββββββββββ β
β β ADK Orchestrator (agents/orchestrator.py) β β
β β β β
β β 1. Safety Pre-check (Groq Llama 3.3) β β
β β If safe, triggers Sequential Pipeline: β β
β β β β
β β ββββββββββββββ ββββββββββββββ ββββββββββββ β β
β β β Classifier ββββΊβ Researcher ββββΊβ Drafter β β β
β β β Agent β β Agent β β Agent β β β
β β ββββββββββββββ βββ¬βββββββββββ ββββββββββββ β β
β ββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββ β
ββββββββββββββββββββββββββββββββββββββββββΌββββββββββββββββββββββββββββββββ
| Technology | Role |
|---|---|
| Python 3.11+ | Runtime |
| FastAPI | REST API Framework |
| Uvicorn | ASGI Server |
| Google ADK | Multi-Agent Orchestration |
| Groq API | LLM Engine (llama-3.3-70b-versatile) via LiteLLM |
Note on AI Provider: We initially built this system using Google's Gemini API (gemini-2.5-flash-lite), but the free-tier limit of 20 requests per day caused immediate quota exhaustion. To ensure a seamless user experience, we have switched to the Groq API (using llama-3.3-70b-versatile via ADK's LiteLlm wrapper), which provides extremely fast inference and significantly higher free limits!
| Technology | Role |
|---|---|
| Next.js 14 | React Framework (App Router) |
| TypeScript | Type Safety |
| Tailwind CSS v4 | Utility-first styling & theming |
| CSS/Google Fonts | Urdu typography (Noto Nastaliq Urdu) |
| Service | Purpose |
|---|---|
| Google Cloud Run | Serverless API & Frontend Hosting |
| Google Cloud Build | CI/CD Pipeline |
| Google Secret Manager | Secure API Key Injection |
Extracts the core issue, assigns the responsible administrative body in Karachi, sets urgency, and returns structured JSON outlining the problem in English and Urdu.
Receives the target authority (e.g., "KWSB"). Uses a live Google Search tool to find the exact, current complaint portal URL, helpline numbers, and physical address for that authority.
Uses pre-generated dynamic REF numbers and localized dates to write a highly formal, persuasive letter in English, and a perfectly localized Urdu letter requesting immediate action from the authority.
ShikayatAI/
β
βββ agents/ Google ADK AI Logic
β βββ orchestrator.py Pipeline manager & Safety Pre-check
β βββ classifier.py Categorization agent
β βββ researcher.py Live web search agent
β βββ drafter.py Letter generation agent
β
βββ api/ Backend Server
β βββ main.py FastAPI endpoints & CORS config
β
βββ eval/ Benchmarking
β βββ test_cases.py 15 automated test cases evaluating safety/classification
β
βββ frontend/ Next.js Web Application
β βββ src/app/
β β βββ page.tsx Main UI, form, state, and results rendering
β β βββ layout.tsx Metadata and font loading
β β βββ globals.css Tailwind configuration and custom fonts
β βββ Dockerfile Standalone image builder for Cloud Run
β βββ next.config.ts Standalone output configuration
β
βββ cloudbuild.yaml CI/CD deployment pipeline for GCP
βββ smoke_test.py Post-deployment verification script
βββ Dockerfile Backend API Docker image builder
βββ requirements.txt Python dependencies
- Python 3.11+
- Node.js 18+
- A Groq API Key
# Create virtual environment
python -m venv .venv
.venv\Scripts\activate # Windows
# source .venv/bin/activate # Mac/Linux
# Install dependencies
pip install -r requirements.txt
# Create environment file
echo GROQ_API_KEY=your_groq_key_here > .envuvicorn api.main:app --reload --port 8000Verify it's running: curl http://localhost:8000/api/health
cd frontend
# Install dependencies
npm install
# Configure environment
echo NEXT_PUBLIC_API_URL=http://localhost:8000 > .env.localnpm run devOpen http://localhost:3000 to view the ShikayatAI dashboard.
Main inference endpoint. Runs safety check and orchestrator pipeline.
Body:
{
"complaint": "Teen din se pani nahi aa raha...",
"location": "PECHS Block 2",
"user_id": "user_xyz123"
}Response:
{
"status": "ok",
"model": "groq/llama-3.3-70b-versatile",
"agents": ["Classifier", "Researcher", "Drafter"]
}We deploy both the Python Backend and the Next.js Frontend to Google Cloud Run. For automated CI/CD, use the provided cloudbuild.yaml.
Add your Groq API Key to Google Cloud Secret Manager:
printf "YOUR_GROQ_API_KEY" | gcloud secrets create shikayatai-groq-api-key --data-file=-
gcloud secrets add-iam-policy-binding shikayatai-groq-api-key \
--member="serviceAccount:COMPUTE_ENGINE_DEFAULT_SERVICE_ACCOUNT" \
--role="roles/secretmanager.secretAccessor"gcloud run deploy shikayatai-api \
--source . \
--region asia-south1 \
--platform managed \
--allow-unauthenticated \
--update-secrets=GROQ_API_KEY=shikayatai-groq-api-key:latest(Copy the resulting URL for the next step)
Deploy the web frontend, passing the backend API URL as a build argument:
cd frontend
gcloud run deploy shikayatai-web \
--source . \
--region asia-south1 \
--platform managed \
--allow-unauthenticated \
--set-build-env-vars NEXT_PUBLIC_API_URL=https://shikayatai-api-[YOUR_PROJECT].run.appThis project is open-source and available for educational and commercial use under the MIT License.
Made with β€οΈ by Abdul Hayy Khan