← ~/projects

$ cat projects/lexa-legal-ai.md

Lexa — Legal Research AI That Abstains

A grounded legal AI that says "I don't know" instead of hallucinating.

Sole developerJuly 2026AI/ML

// why: General models invent case law — one fake citation can cost a career.

$ cat projects/lexa-legal-ai.md

TL;DR

  • 3 agents: retrieve → draft with citations → independent verify
  • Abstains honestly: score floor refuses low-evidence answers
  • Offline by default: bundled corpus, live connectors optional

// what does it do?

Legal research assistant on a 3-agent pipeline: Researcher retrieves, Drafter writes with citations, independent Verifier checks every claim. Weak evidence → abstains. Streams live to UI.

// why this project?

General-purpose models happily invent case law, and they rarely push back on a weak premise. In legal research one fabricated citation can cost a career.

// what broke / learned

The verifier rejecting my own drafts hurt, which means it works.

// results

  • A deterministic citation guard enforces that every claim maps to a retrieved source
  • a score-floor abstention gate refuses low-evidence answers
  • a bounded repair loop fixes draft issues before anything reaches the user. Ships offline out-of-the-box (mock model + local embeddings + a bundled US Constitutional corpus), with optional live connectors to Federal Register, CourtListener, and GovInfo. pytest suite plus live-source E2E tests on GitHub Actions CI.
3-agent research, draft, verify pipelineVerifier rejects claims with no retrieved sourceScore-floor abstention gate

Tech stack

PythonFastAPIPostgreSQLAlembicDockerpytestGitHub Actions
Lexa — Legal Research AI That Abstains | Mrinall Samal