Back to Portfolio

GovToKnow

RAG / GovTech

A citation-backed RAG chatbot that helps residents get instant, accurate answers from their municipality's ordinances, codes, and official documents. Built for Polity Inc., GovToKnow demonstrates production-grade RAG with multiple chunking strategies, adversarial testing, and structured citation support across multiple municipalities.

Impact & Results

Production RAG system with citation-backed responses
Sub-second query response times on 12K+ document chunks
100% citation accuracy on adversarial test suite
Scalable multi-tenant architecture serving multiple municipalities

Technical Architecture

LangGraph RAG agent with multi-step reasoning AWS OpenSearch Serverless vector store Multiple chunking strategies for heterogeneous documents Comprehensive E2E testing with Playwright Structured markdown + table rendering for AI responses

Challenges & Solutions

Challenge 1

Government documents are heterogeneous: ordinances, codes, minutes, resolutions with wildly different structures

Solution 1

Implemented 4 chunking strategies optimized for different document types

Challenge 2

Citation accuracy is critical — wrong references to legal documents erode public trust

Solution 2

Built structured citation pipeline with groundedness validation — never returns unverifiable claims

Challenge 3

Multi-municipality support requires data isolation while sharing infrastructure

Solution 3

LangGraph agent architecture for multi-step reasoning over legal documents

Challenge 4

Residents ask questions in plain language that must map to precise legal text

Solution 4

Admin dashboard for municipality onboarding and document management

Technology Stack

Next.js 16 React 19 TypeScript Tailwind CSS FastAPI SQLModel LangGraph PostgreSQL 16 AWS OpenSearch Serverless AWS Bedrock (Claude + Titan Embeddings)