Inspiration
Bureaucracy is not designed for people in crisis. When vulnerable individuals (like our target persona, Elena, a non-native speaker) receive high-stakes documents such as a "Notice to Quit," panic sets in. A simple web search fails her; it cannot extract her exact $2,250 debt, and searching "eviction help" traps her in a matrix of predatory legal ads and confusing statutes. People miss critical deadlines not because they lack options, but because they cannot parse the legal jargon. ClarityAI was built to bridge the gap between administrative complexity and actionable clarity.
What it does
ClarityAI is a mobile app that translates complex legal, medical, and administrative documents into actionable roadmaps. Users can snap a photo, upload a PDF, or type a query. The system immediately outputs:
- An urgency classification and a simple summary.
- A localized, step-by-step action checklist with clear deadlines.
- Agentic recommendations for verified local support (e.g., specific legal aid offices based on the user's IP).
- A conversational chat interface grounded strictly in the document to answer follow-up questions. Everything is accessible in 6 languages with native audio read-aloud support.
How we built it
- Frontend: We used Next.js 14, Tailwind CSS, shadcn/ui, and Framer Motion to build a fluid, app-like mobile experience.
- Backend: A FastAPI Python server running in a Dockerized Coolify environment orchestrates the logic. We utilize pypdf and pytesseract for multi-format text extraction.
- AI & RAG Pipeline: We leverage the NVIDIA Nemotron 3 Super via the NVIDIA Build API. To prevent hallucinations, we built an agentic Retrieval-Augmented Generation (RAG) pipeline using the Brave Search API to pull live, localized legal aid data based on the user's geolocated IP.
- Privacy Guardrails: A local PII scrubber removes Social Security Numbers and phone numbers before hitting external APIs. We engineered a strictly stateless architecture; there is no database, and all session data remains in the user's browser localStorage.
Challenges we ran into
- Strict JSON Enforcement: Tuning the Nemotron 3 Super model to consistently output complex nested JSON schemas (for tasks, process diagrams, and localized resources) required aggressive prompt engineering and defensive fallback parsing.
- Calculating Confidence: We had to implement a mathematical fallback to evaluate the model's certainty. We bounded the AI confidence score C-score based on the probability of accurate token extraction vs. hallucination constraints, ensuring the UI accurately reflects a High, Medium or Low trust metric.
- Docker/Coolify Networking: We faced severe 502 Bad Gateway timeouts bridging the Next.js reverse proxy with the FastAPI container in our production environment, requiring a complete refactor of our internal Docker routing.
Accomplishments that we're proud of
- The "Trust Shield" Personally Identifiable Information Redaction: Successfully building a visual pre-processing step that scrubs sensitive data and proves to the user their privacy is protected.
- Zero-Database Architecture: Achieving a highly personalized, agentic RAG experience while strictly refusing to store user data on our servers.
- Multilingual Accessibility: Seamlessly tying together the LLM's translation capabilities with Microsoft Azure Neural TTS to offer real-time audio guidance in 6 languages.
What we learned
Building AI for high-stress scenarios fundamentally changes UX design. We learned that adding friction can be a feature, not a bug. By gating external actions behind a Human-in-the-Loop acknowledgement, we ensure users retain agency and understand the limitations of generative AI.
What's next for ClarityAI
- Native Calendar Sync: Generating .ics files directly from extracted deadlines so users can instantly sync legal response dates to their mobile calendars.
- Image Pre-Processing AI: Implementing a lightweight model to detect extremely blurry camera uploads and prompt the user for a retake before wasting inference tokens.
- Expanded RAG: Integrating direct API dials to local 211 services to automate appointment scheduling for legal or medical aid.
Log in or sign up for Devpost to join the conversation.