Inspiration

In U.S. Housing Court, most tenants have no lawyer. They lose on procedure—defective notices, missed deadlines, not knowing what to say—more often than on the underlying rent dispute.

Generative AI fills the gap with confident wrong advice: “skip the hearing,” “guaranteed win,” invented statute numbers. That advice can produce default judgments and eviction.

LexMorph was built for LexHack 2026 to close both gaps: help people read a notice and practice a defense, and catch dangerous chatbot legal advice before someone trusts it.

What it does

LexMorph is a connected Defense Studio loop (educational prototype — not a lawyer):

1) Defense Studio (/studio) Open a practice NYC/CA example, or paste / photograph your own notice. We flag common legal problems in plain English, then help draft a court Answer (.docx). Your own cases save in the browser so a refresh doesn’t wipe them. No visitor API key needed.

2) Hearing Coach (/simulator) Rehearse what to say in Housing Court. Feedback + statute-aware phrasing. Context from Studio carries over.

3) Advice Auditor (/auditor) — AI Safety Paste ChatGPT-style advice. Deterministic danger rules catch “skip court,” overconfidence, and odd citation formats; optional server AI enriches a safer rewrite. Risk follows maximum severity. Empty match ≠ “safe” (shows “no known patterns matched”). Mini-eval: 25/25 labeled cases · 47 known-good citations · LLM cannot remove rule flags (safety floor).

How we built it

• App: Next.js 16, React 19, TypeScript, Tailwind CSS 4 • Deploy: Vercel — https://lexmorphai.vercel.app • LLMs (server-side): Groq primary (gpt-oss / Qwen); Gemini optional • Deterministic core: statutory rule KB (NY/CA), Advice Auditor regex + citation registry • Export: docx (Answer draft + editable document) • Eval: npm run eval:auditor → docs/ADVICE_AUDITOR_EVAL.md • AI coding tools (build): Cursor agent + Claude — disclosed; we can explain every product path • Visitors never paste API keys — GROQ_API_KEY on Vercel

Challenges we ran into

• Hallucination risk in legal AI → rules-first design; Auditor merge keeps deterministic flags even if the LLM softens them. • Demo reliability for judges → curated practice fixtures separate from live paste analysis; honest loading copy. • Early “photo → perfect PDF” path was brittle → pivoted to text/OCR assist + Answer/Hearing/Auditor loop (during the hackathon). • Plain language for non-lawyers without inventing win percentages.

Accomplishments that we're proud of

• Working end-to-end loop: Studio → Answer .docx → Hearing Coach → Advice Auditor • Dual-track story: Access to Justice + AI Safety in one product • Auditor mini-eval 25/25 (100% must-hit recall, 0 watch-list false positives) • 47-entry citation registry (verified / unknown / suspicious format — never auto-“fake”) • Deployed prototype with server AI; Basic mode still works offline with rules + samples

What we learned

• In A2J tools, honesty beats spectacle—false precision (% win scores) destroys trust. • AI Safety for legal advice needs a deterministic floor, not only an LLM rewrite. • Judges and scared tenants need the same UX: clear practice vs own-document paths, no key pasting.

What's next for LexMorph Defense Studio

• Expand Auditor eval with consented real chatbot logs • Primary-law link-outs for citations • Clinic partnerships / more jurisdictions after the core loop is solid • LexHack Builders Fellowship deployment support

Built With

Share this project:

Updates

Submission history