Skip to content

Settings

Configure the analysis engine and manage local data.

Google Gemini analysis

Optional — the app works fully offline without a key

Not configured

Paste a free Gemini API key (get one at aistudio.google.com/apikey) to analyze messages with Gemini 2.5 Flash. The key is stored only in your browser and sent per-request — it never touches the server's storage.

Saves automatically while typing
Model

Models change (and get discontinued) — CCG Portal queries the Gemini API for what is actually available under your key, so you always pick a working one.

Server-side alternative: set GEMINI_API_KEY in .env.local to make Gemini available to every browser without pasting a key. This is currently not set.
Model in use:

Offline analyzer

Built-in — zero API cost, deterministic results

Pakistan taxonomy
  • Classifies every message into complaint / suggestion / idea / praise / request / other using a keyword + sentiment engine tuned for Pakistani English and Roman Urdu.
  • Tags 14 sectors (electricity, water, roads, health, education, police, corruption, taxes, garbage, agriculture, gas, inflation, employment, digital), urgency, intensity, locations and government entities.
  • Detects exact and near-duplicate complaints (token + character-gram similarity) across all files.
  • Flags persistent issues, infers root causes, computes severity and volume trends, and drafts policy interventions.
  • With a Gemini key, the top issues get an AI-written policy brief replacing the template recommendations.

WhatsApp integration

Receive WhatsApp messages (text + voice) directly into the analysis pipeline

Inactive

Connect a Meta WhatsApp Business Cloud API number: CCG Portal exposes a webhook that receives messages (including voice notes, which Gemini transcribes) and feeds them into the live analysis file automatically. Text is analyzed in English, Roman Urdu and Urdu script.

Setup: Meta Developer app → WhatsApp → API Setup → copy the phone-number ID & a system-user token (with whatsapp_business_messaging permission) → set your chosen verify token → add /api/whatsapp/webhook as the webhook URL with the messages field subscribed. Voice messages need a Gemini key (Settings above) for transcription.

Appearance

Theme and font-size preferences are stored in your browser

Theme

Font Size

AI Fallback Provider

OpenAI-compatible endpoint used when Gemini is unavailable or over quota

Free options: OpenRouter (endpoint: https://openrouter.ai/api/v1, model: mistralai/mistral-7b-instruct:free) · Groq (endpoint: https://api.groq.com/openai/v1, model: llama3-8b-8192) · Local Ollama (endpoint: http://localhost:11434/v1, model: llama3)

Data management

Local SQLite store — everything lives on this machine

0 files · 0 messages stored
Uploads, messages, duplicate groups, issues and recommendations are persisted in data/civic-pulse.db.