Case study · Government · Kenya

Nairobi City County revenue assistant

Revenue reports in seven Excel layouts, loaded into one database, and an assistant that answers plain-language questions about them on the web and on WhatsApp.

Client
Nairobi City County
Sector
Government
Year
2026

The problem

The county's revenue figures arrived as Excel reports in seven different layouts. Answering a plain question meant working across those files.

What we built

  • Parsers for all seven report layouts that load the figures into a PostgreSQL database.
  • An AI agent that answers plain-language questions about the revenue data, on the web and on WhatsApp.

How it stays safe and accurate

  • The agent can only run validated, read-only SELECT queries. It cannot change data.
  • Those queries run through a PostgreSQL role with the least access the assistant needs.
  • Only whitelisted WhatsApp numbers can use the assistant.
  • We ran several accuracy audits on the answers and fixed double-counting and period-scoping errors.
  • If the main language model is unavailable, the assistant falls back to another one.

Stack

  • Next.js
  • TypeScript
  • Supabase / PostgreSQL
  • NVIDIA NIM LLMs with fallback
  • Vitest

Outcome

The assistant is in use at Nairobi City County.

Back to all work

Book a 20-minute call

Tell us which process is costing you time. We will tell you whether AI and automation can help.

Email us with one process you want fixed, and we will reply with times for a call: waynewilliams@pneumalabs.app