All work
Conversational E-Governance AI

Bilingual Citizens AI Assistant

Developed a state-level bilingual chatbot with Next.js, Google GenAI SDK, and custom Nastaliq CSS, solving stream parsing failures and dynamically generating stateful forms in the viewport.

Sector
Conversational E-Governance AI
Timeline
5 months
Role
Lead AI Architect
  • Next.js
  • Prisma
  • PostgreSQL
  • Google GenAI SDK
  • Gemini 2.5
  • Urdu Nastaliq CSS
Bilingual Citizens AI Assistant
Instant
Form Ingestion Time

Self-prefilling known profiles dynamically

100%
JSON Parsing Success

Ensured by self-healing stream interceptors

The problem

Ensuring structural JSON schema output consistency during multi-turn chats under high API traffic, and creating dynamic user intakes without static layouts.

The solution

Formulated a server-side JSON-repair interceptor and designed a stateful chatbot pre-filling user files and injecting custom intake inputs directly into stream contexts.

Approach

How it was built.

01

Structured Parsing Safeties

Implemented server-side parser middleware that monitors incomplete stream packets and repairs brackets, maintaining absolute JSON compliance.

02

Stateful Form Injection

Programmatically mapped profile data and dynamically evaluated fields inside the conversation context, generating specialized forms inside chat viewports.

Technical detail

The parts worth explaining.

Stream JSON Repair Interceptor

Self-healing parser resolving unescaped keys or trailing commas mid-stream.

const cleanJSON = (str) => { return str.replace(/\,\s*\}/g, '\u0027}\u0027').replace(/\,\s*\]/g, '\u0027]\u0027'); };
What I took from it
  • Stream validators must handle packet fragmentation
  • Nastaliq typography requires specialized CSS container constraints
Where it goes next
  • Deploy native text-to-speech outputs in localized regional Urdu dialects
  • Integrate government citizen portal SSO APIs

Got a problem shaped like this?

If something here looks like what you're facing, tell me about it. The first conversation is an architecture discussion, not a sales call.