Inspiration
I grew up watching people around me give up on their rights — not because they were wrong, but because they didn't know they were right.
A neighbor's shop license rejected with "incomplete documents." He had submitted everything. Three years and thousands of rupees later, he still didn't have his license. Not because the law was against him — but because nobody told him the law was for him.
This happens millions of times every year across India. Citizens receive government rejection letters with vague, unexplained reasons. They don't know which law was violated. They can't afford a lawyer. So they give up.
I built CivicLens because justice shouldn't require a lawyer.
What It Does
CivicLens is an AI-powered civic legal analysis tool built on Amazon Nova 2 Lite. A citizen uploads two documents — their rejection letter and original application — and four specialized AI agents go to work.
In 60 seconds, CivicLens delivers:
- Identification of the exact governing law that applies
- Detection of procedural contradictions between the rejection and legal requirements
- A Procedural Consistency Score (0–100) showing how legally valid the rejection is
- Transparent AI reasoning — every step of the analysis visible to the user
- A formal appeal letter ready to file
- An RTI application demanding specific reasons from the department
- A chat assistant for follow-up questions about the case
No legal knowledge required. No lawyer needed. Just two documents.
How We Built It
AI Architecture — 4 Specialized Nova Agents:
Every agent makes a dedicated call to Amazon Nova 2 Lite via AWS Bedrock Runtime API:
| Agent | Role | Nova Task |
|---|---|---|
| Agent 1 — Document Parser | Reads both uploaded documents | Structured data extraction |
| Agent 2 — Law Identifier | Finds the governing regulation | Classification + dynamic retrieval |
| Agent 3 — Contradiction Detector | Compares rejection vs law | Multi-step legal reasoning |
| Agent 4 — Appeal Writer | Generates legal documents | Formal document generation |
RAG Architecture for Grounded Reasoning: Rather than relying on Nova's training memory for legal facts, we inject verified law text directly into each Nova prompt. This ensures accurate, hallucination-free legal reasoning — the same approach used by enterprise legal AI systems.
Dynamic Law Retrieval: When a case falls outside our 5 hardcoded laws, Agent 2 triggers a secondary Nova call to research and retrieve the applicable regulation dynamically — making CivicLens extensible to any government application type.
Tech Stack:
- Amazon Nova 2 Lite (us.amazon.nova-lite-v1:0) via AWS Bedrock
- Python + Flask backend
- Next.js + TypeScript frontend
- PyMuPDF for multimodal document processing (PDF + images)
- boto3 AWS SDK
- Custom 4-agent orchestration pipeline
Challenges We Ran Into
1. Cross-Region Inference
Nova 2 Lite required the us. prefix on the model ID for cross-region inference. Without this, every API call returned a ValidationException. Debugging this cost hours.
2. Circular Import Architecture
Each agent imported call_nova from main.py, while main.py imported from agents — creating circular imports that crashed Flask on startup. Solved by extracting the Nova client into a standalone utils/nova_client.py module.
3. Legal Reasoning Accuracy Early prompts caused Nova to hallucinate specific clause numbers and invent legal requirements. Solved by grounding all reasoning in verified law text using RAG — Nova reasons against provided law text, not from memory.
4. Appeal Letter Quality Internal AI reasoning text leaked into generated legal documents. Solved through strict prompt engineering with explicit CRITICAL RULES blocks instructing Nova to never include meta-commentary in formal outputs.
5. Explainable AI Design Making AI reasoning visible to non-technical users required designing a 4-step reasoning timeline that translates Nova's output into plain language steps any citizen can understand.
Accomplishments That We're Proud Of
- Built a genuine multi-agent reasoning system — not a chatbot wrapper — that performs real legal contradiction detection
- Implemented explainable AI that shows citizens exactly how and why CivicLens reached its conclusion
- Achieved production-level output quality: generated appeal letters are formally structured, legally cited, and ready to file
- Built a complete full-stack civic product — from PDF parsing to legal document generation — as a solo student developer in under 2 weeks
- Designed a system that works for any government application type, not just 5 hardcoded cases
What We Learned
- How to architect production-grade multi-agent AI systems using Amazon Nova 2 Lite
- RAG is not optional for legal AI — grounded reasoning is the difference between trustworthy and dangerous outputs
- Explainable AI dramatically increases user trust — showing reasoning steps matters more than just showing answers
- Prompt engineering is engineering — the quality of Nova's output is directly proportional to the precision of the prompt
- The best products solve problems you've personally lived with
What's Next for CivicLens
Short term (with hackathon prize credits):
- Deploy publicly on AWS
- Expand law database to 50+ Indian regulations
- Add Hindi and Kannada language support
Medium term:
- Partner with NGOs and legal aid clinics across India
- State-specific regulation coverage
- Government scheme eligibility checker
Long term:
- Apply to Surge (Sequoia India) or Y Combinator
- Build the largest civic legal AI platform in India
- Expand to other developing countries with similar bureaucratic challenges
CivicLens is not just a hackathon project. It is the beginning of something that could genuinely change how millions of people interact with their government.
Built With
- amazon-web-services
- bedrock
- flask
- next.js
- nova
- pymupdf
- python
- typescript
Log in or sign up for Devpost to join the conversation.