Inspiration
A small business owner expanding from a food truck into a brick and mortar restaurant faces the exact same regulatory complexity as a national chain (permits, zoning, health code, alcohol licensing), but without the in house legal team to navigate it.
We observed that:
- Small business owners are expected to interpret the same regulatory landscape as large enterprises, with none of the legal counsel
- Regulatory information is scattered across municipal, county, state, and agency sources with no unified source of truth
- Generic LLM chatbots happily generate plausible sounding compliance answers with zero source grounding, which is a serious liability in a legal or regulatory context
- Expansion decisions (new city, new license type, new service line) compound complexity exponentially, turning what should be a quick lookup into hours of manual cross referencing
We decided to build CivicLens around one non negotiable rule: if a compliance claim can't be traced to a verifiable government source, it doesn't get shown to the user. Everything else, including the RAG pipeline, the dashboard, and the Diff Engine, was built in service of that one rule.
What It Does
A user describes their business in plain language:
"I own a food truck in Dallas and want to open a restaurant in Austin with a beer garden."
CivicLens classifies the business, retrieves the relevant regulations from a curated knowledge base, and generates a personalized compliance dashboard, showing required permits, risks, and compliance gaps, each with a direct link to the underlying government source.
| Capability | Description | Impact |
|---|---|---|
| Natural Language Business Classification | Parses a free text business description into structured business type, location, and service attributes | Removes the need for users to know regulatory taxonomy up front |
| Regulatory Retrieval (RAG) | Vector search over a curated, embedded corpus of TX regulatory documents | Surfaces requirements relevant to this business, not generic guidance |
| Citation Validation Layer | Rejects any compliance finding that lacks a verifiable source URL | Eliminates hallucinated requirements before they reach the user |
| Regulatory Diff Engine | Side by side comparison of requirement changes between two business scenarios | Answers "what changes if I move or expand" instantly |
| Compliance Pulse | Ongoing monitoring of new ordinances, regulations, and legislation | Prevents owners from being blindsided by regulatory changes |
| Personalized Compliance Dashboard | Aggregates findings, risks, and source links into a single view | One place to act instead of a pile of government PDFs |
Snapshot of the build:
- [x] 1 fully validated end to end expansion scenario (food truck to restaurant, Dallas to Austin)
- [x] Citation enforced RAG pipeline over a curated Texas regulatory corpus (TABC, city ordinances, state licensing guides)
- [x] pgvector backed semantic search, no separate vector database required
- [x] Structured, citation required prompting pattern enforced at the application layer
- [x] Built in 11 days, validated through 15+ full demo rehearsals
==Every compliance finding shown to a user carries a verified source link. No exceptions.==
System Architecture
| Layer | Technology | Role |
|---|---|---|
| Frontend | Next.js 14, React, Tailwind CSS | Business intake form, compliance dashboard, Diff Engine UI |
| API Layer | NestJS (Express) | Orchestrates classification, retrieval, validation, and response |
| Database & Search | PostgreSQL + pgvector | Stores regulatory document embeddings, semantic search with no separate vector store |
| Data Pipeline | Python, LangChain | Ingests, chunks, and embeds public regulatory sources |
| Embeddings | OpenAI text-embedding-3-small |
Converts regulatory text chunks into searchable vectors |
| Reasoning & Generation | Claude (structured, citation required prompt) | Synthesizes retrieved context into findings, never freeform |
Keeping pgvector inside the primary Postgres instance, rather than standing up a separate vector database, was a deliberate trade off for the 11 day build window. One less moving part is one less thing that could break during demo week.
How We Built It
Phase 1: Problem Scoping & Knowledge Base Definition
Rather than attempting to cover all of Texas, we picked a narrow, deeply validated slice: a small set of highly regulated business types (food service, alcohol service) in a single expansion scenario, food truck to restaurant, Dallas to Austin. Primary sources identified for ingestion: the Texas Licenses & Permits Guide, TABC requirements, relevant city ordinances, and recent legislation.
Phase 2: RAG Pipeline Construction
A Python and LangChain ingestion pipeline chunks regulatory documents, embeds them with OpenAI's text-embedding-3-small, and stores them in pgvector for semantic retrieval.
// Example: compliance finding object, as enforced by the citation validation layer
{
id: "F-RESTAURANT-001",
category: "Health & Safety Permit",
description: "New permit required when transitioning from mobile food
service to a fixed restaurant location",
citation: {
source: "Texas Licenses & Permits Guide",
url: "<verified-government-source-url>"
},
status: "validated"
}
Every finding generated downstream must conform to this shape. No citation.url, no display to the user.
Phase 3: Compliance Analysis & Citation Enforcement
Retrieved regulatory context is passed to Claude using a structured prompt that requires a citation for every finding. A validation layer sits between model output and the dashboard:
Claude Output
|
v
Citation Validation Layer
|
+------+------+
v v
Valid source No source
URL present URL found
| |
v v
Shown to user Rejected,
never shown
Phase 4: Regulatory Diff Engine
The signature feature. Rather than generating diffs on the fly and risking hallucinated deltas, the Diff Engine runs on pre validated expansion scenarios, food truck to restaurant being the primary one, with manually verified requirements on both sides of the comparison.
Scenario A (Current) Scenario B (Target)
Food Truck Restaurant
Dallas Austin
| |
+-------------+--------------+
v
Regulatory Diff Engine
|
v
New Requirements + Risk Deltas
Phase 5: Demo Hardening & Documentation
Every citation included in the demo was manually checked against its original government source. We ran 15+ full practice runs to surface edge cases ahead of time.
Full System Flow
Business Description
("I own a food truck and want to open a restaurant")
|
v
Business Classification
|
v
Regulatory Retrieval
(pgvector Search + RAG)
|
v
Citation Validation
|
v
Compliance Analysis
& Risk Detection
|
v
Regulatory Diff Engine
|
v
Personalized Dashboard
& Actionable Guidance
Data Flow & Validation
| Flow | Path | Validation / Protection |
|---|---|---|
| F1 | User input to Business Classifier | Input parsing, business type normalization |
| F2 | Classifier to pgvector Search | Embedding based relevance threshold on retrieval |
| F3 | Retrieved context to Claude (structured prompt) | Generation constrained to retrieved context only |
| F4 | Claude output to Citation Validation Layer | Source URL required, unsourced claims rejected |
| F5 | Validated findings to Diff Engine | Only pre validated, manually verified scenarios are diffed |
| F6 | Findings to Dashboard | Manual spot check during MVP, direct links to gov sources |
Challenges We Ran Into
Challenge 1: RAG Hallucinations
The Problem: Large language models are confident even when they're wrong, and in a compliance product, a confidently wrong answer is worse than no answer at all.
Our Approach: A citation validation layer sits between model output and the user. Any finding without a valid, verifiable source is automatically rejected.
Result: Zero unsourced compliance claims reach the dashboard. The trade off is coverage, not correctness.
Challenge 2: Regulatory Complexity
The Problem: Requirements vary significantly across industries, cities, and agencies, with no clean, unified schema to query against.
Our Approach: We narrowed to a small set of highly regulated business types and municipalities, building a scalable architecture while keeping accuracy high within scope.
Result: A narrow but trustworthy product, with an architecture designed to widen later without a rebuild.
Challenge 3: Time Constraints (11 Days)
The Problem: Eleven days is not enough time to build broad regulatory coverage and a polished, reliable demo.
Our Approach: We prioritized aggressively. The RAG pipeline and one fully polished scenario took precedence over geographic breadth or additional business categories.
Result: One scenario that works end to end and holds up under scrutiny, instead of many that don't.
Challenge 4: Accuracy Verification
The Problem: A single incorrect permit requirement is enough to undermine trust in the entire platform.
Our Approach: Every citation included in the demo was manually checked against its original government source before being shown.
Result: Time consuming, but non negotiable, and the reason the demo could survive hard questioning.
Accomplishments That We're Proud Of
1. Citation Enforced Regulatory Intelligence, Built in 11 Days
Most teams exploring regulatory AI end up with generic chatbots that produce plausible but unreliable answers. CivicLens was designed from day one to prioritize verifiable information over coverage.
2. The Regulatory Diff Engine
Technically straightforward, but it answers a question business owners constantly face: "what changes if I move or expand?" It delivers, in seconds, guidance that normally takes hours of legal research.
3. Accuracy & Trust Risk Matrix
Reframing our core challenges as a risk register helped us prioritize where engineering effort actually mattered:
| Risk | Likelihood | Impact | Mitigation |
|---|---|---|---|
| Unsourced or hallucinated compliance claim | High (default LLM behavior) | Critical (legal/financial harm to user) | Citation validation layer rejects unsourced findings |
| Geographic or industry scope gaps | High (broad regulatory landscape) | Medium | Deliberately narrowed MVP scope to TX, limited business types |
| Outdated regulation shown to user | Medium | High | Compliance Pulse monitoring (in progress) |
| Conflicting information across government sources | Medium | Medium | Manual spot check against original source during MVP |
4. Demo Reliability Through Repetition
15+ full practice runs let us identify edge cases ahead of time and walk into the final demo with confidence instead of hope.
5. Grounding in a Real Business Owner's Story
Anchoring the entire presentation in a real small business journey, food truck to restaurant, turned an abstract regulatory problem into something a judge, or any small business owner, could immediately feel.
What We Learned
1. LLMs Are Powerful, But High Stakes Domains Require Guardrails
The instinct to let a model answer everything quickly breaks down in legal and regulatory contexts. Source grounding, citation validation, and human review aren't optional polish. They are the product.
2. Regulatory Data Is Messier Than Expected
Government websites use inconsistent terminology, update on different schedules, and occasionally contradict each other. Working against real government data taught us things a clean dataset never could.
3. Focus Wins Hackathons
We deliberately said no to multi state coverage, predictive legislation features, and user accounts. Those "no"s are what let us invest in accuracy, polish, and a memorable demo instead of spreading thin.
4. Technology Alone Doesn't Solve Civic Problems
The real value comes from understanding the underlying problem, choosing the right technical approach, and designing for trust, not from picking the flashiest model.
What's Next for CivicLens
Phase 2: Near Term Implementation
| Priority | Item | Timeline | Impact |
|---|---|---|---|
| P0 | Compliance Pulse email delivery | 2-3 weeks | Closes the loop on ongoing regulatory monitoring |
| P0 | User authentication + saved profiles | 1-2 weeks | Enables persistent, returning user dashboards |
| P1 | Expand Diff Engine beyond food truck to restaurant | 4-6 weeks | Generalizes the signature feature across scenarios |
| P1 | Broaden Texas business category coverage | 1-2 months | Moves past the narrow MVP scope |
Phase 3: Monetization & Coverage
| Priority | Item | Timeline | Impact |
|---|---|---|---|
| P1 | Launch subscription tier ($9.99 to $19.99/mo) | 1-2 months | Establishes a sustainable monetization path |
| P2 | Multi location support | 2-3 months | Serves owners operating across multiple jurisdictions |
| P2 | Advanced compliance insights | 2-3 months | Deepens value beyond basic permit lookup |
Phase 4: Distribution & Partnerships
- Partner with Small Business Development Centers, chambers of commerce, and local economic development organizations to offer CivicLens as a member benefit
- Position partnerships as the primary distribution channel for reaching small business owners who wouldn't otherwise find a tool like this
Phase 5: National Scale & Platform Integration
- Expand regulatory coverage nationally beyond Texas
- Integrate with accounting and point of sale platforms via API, embedding CivicLens into existing business workflows
- Launch a mobile experience
Key Targets, End of Q4 2026
- [ ] 100% of compliance findings remain citation validated: zero unsourced claims shown to users, no exceptions
- [ ] Regulatory Diff Engine covers 5+ fully verified expansion or relocation scenarios, up from 1 at MVP
- [ ] Compliance Pulse live for an initial pilot cohort of small businesses
- [ ] At least one Small Business Development Center or chamber of commerce partnership in active discussion
Built With
- 3
- actions
- autoprefixer
- beautiful-soup
- ci
- class-transformer
- class-validator
- compose
- concurrently
- css
- docker
- eslint
- express.js
- github
- gl
- gsap
- jest
- jsdom
- langchain
- library
- lucide
- maplibre
- nestjs
- next.js
- node.js
- npm
- openai
- pgvector
- platform
- postcss
- postgresql
- prettier
- prisma
- psycopg2
- python
- python-dotenv
- radix
- railway
- react
- requests
- rxjs
- sdk
- splitters
- supertest
- tailwind
- testing
- text
- typescript
- ui
- vercel

Log in or sign up for Devpost to join the conversation.