💡 Inspiration

Over 80% of eviction judgments in the United States are entered by default. Tenants lose not because they lack legal merit, but because panic and confusion run out the statutory clock before they can ever consult an attorney. Meanwhile, a staggering proportion of landlord notices are procedurally defective on arrival—bearing shorted notice periods, missing statutory disclosures, or improper delivery under state law.

Legal aid organizations are overwhelmed, turning away the vast majority of income-eligible applicants. The 30 seconds between discovering a notice taped to an apartment door and understanding whether a statutory defect exists is the most underserved bottleneck in the civil justice system. I engineered CounterNotice to occupy that 30-second gap.

⚙️ What It Does

CounterNotice converts an eviction notice photo into a cited, court-ready defense in 20 seconds. It delivers:

  • 🚨 The Verdict Card: Instant determination of procedural defects without legal jargon.
  • 🔍 The Why Panel: Side-by-side diff comparing the notice's exact text directly against verbatim statutory language from the Texas Legislature.
  • ⏰ The Deadline Shield: Automated calculation of the tenant's jurisdictional response window under Texas time-computation rules, exporting directly into Google Calendar via .ics.
  • 📄 Print-Ready Dispute Letter: Generates a formal, cited dispute letter formatted with @media print for zero-friction printing at a public library.
  • 🤝 The Honest Path: When a notice is legally compliant, CounterNotice refuses to invent false defenses. Instead, it pivots to drafting a good-faith negotiation letter and routing to legal aid resources.

🛠️ How I Built It

I implemented a strict architectural separation of concerns to solve the primary hazard in legal AI: hallucination and Unauthorized Practice of Law (UPL).

  1. Extraction (LLM Only): Google Gemini Flash acts strictly as an OCR and structured-data parser. Its output is bounded by an immutable TypeScript responseSchema that returns raw facts—never legal conclusions.
  2. Evaluation (Pure Deterministic Code): The extracted facts are fed into a standalone rules engine written in pure TypeScript. Every rule encodes statutory conditions from Tex. Prop. Code § 24.005 with zero runtime LLM intervention.
  3. Accessibility: Integrated pre-rendered audio synthesis and a browser speech-synthesis fallback, ensuring users with limited English proficiency or low literacy can listen to their rights.
  4. Stack: Built with Next.js App Router, TypeScript, and Tailwind CSS, fully deployed on Vercel.

🧗 Challenges I Ran Into

The hardest engineering challenge was building a system where the AI is structurally barred from having an opinion on the law. LLMs tend to offer confident legal opinions if unconstrained. I resolved this by stripping the model of any adjudicative role: Gemini extracts the text into strict JSON, and deterministic boolean logic decides compliance.

Translating statutory nuances (such as day-counting exclusions where the day of delivery does not count toward the notice period) required rigorous edge-case modeling and dedicated test fixtures.

🏆 Accomplishments I'm Proud Of

  • Automated Safety Firewall Audit: I wrote an end-to-end CI audit (src/lib/guardrails/verify.test.ts) that runs alongside our 30 passing unit tests. It mathematically proves that unreadable documents or out-of-jurisdiction notices return unknown rather than false legal accusations.
  • Sub-5ms Execution: Once OCR data is extracted, the entire legal evaluation runs client-side in under 5 milliseconds with zero external API calls.

📚 What I Learned

High-stakes civic domains cannot tolerate probabilistic guesswork. The winning paradigm for AI in legal aid is not an LLM posing as a lawyer, but an LLM acting as an efficient OCR parser feeding an auditable, deterministic rules engine.

🔮 What's Next for CounterNotice

  • Expanding the rules engine across the 10 highest-volume eviction jurisdictions in the US.
  • Direct API integration with local legal aid case management systems (LegalServer/JustFix) to hand off flagged defects directly to human pro-bono attorneys.

Built With

Share this project:

Updates

Submission history