Skip to content

LemmaLegalConsulting/CLELegalAidDrafting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cleveland Legal Aid Drafting MVP

Agentic legal drafting MVP for Ohio landlord/tenant work. The app is structured around human-reviewed drafting: matter intake, candidate legal grounds, approved facts/sources, block-based drafting, validation, and DOCX export.

Stack

  • Django + Django Ninja API
  • React + Lexical editor shell
  • Postgres + pgvector for relational data and source chunk embeddings
  • Redis + Celery for AI, OCR, validation, and export jobs
  • Docker Compose for local parity with container deployment

Quick Start

Copy-Item .env.example .env
docker compose up --build

Then open:

AWS / Remote Deployment

If deploying to AWS Lightsail or EC2:

  1. Firewall: Open ports 8000 (Backend) and 5173 (Frontend) in your instance's networking settings/security groups.
  2. Environment: Update your .env file to use the public IP/DNS:
    DJANGO_ALLOWED_HOSTS=<PUBLIC_IP>
    CORS_ALLOWED_ORIGINS=http://<PUBLIC_IP>:5173
    VITE_API_BASE=http://<PUBLIC_IP>:8000/api
  3. Restart: Run docker compose up --build -d to apply changes.

Create database tables after the containers are up:

docker compose exec backend python manage.py migrate
docker compose exec backend python manage.py createsuperuser

Docker Desktop must be running before docker compose up. The backend is intended to run against Postgres because the initial migration enables the pgvector extension.

Implemented MVP Surface

  • Matter records with LegalServer-ready external IDs, problem codes, special problem codes, court, office, eviction ground, and subsidy metadata.
  • Evidence, case notes, and claimable facts with verification status.
  • Legal source and source chunk records with pgvector embeddings.
  • Draft goals, candidate grounds, draft packages, draft blocks, and AI trace records.
  • Stubbed motion-to-dismiss audit logic that proposes grounds from case signals.
  • Django Ninja endpoints for matter selection, audit, ground review, draft package creation, and block editing.
  • React/Lexical drafting workspace for reviewing the generated block package.

Development Notes

The current AI behavior is intentionally stubbed and deterministic. Replace the service functions in backend/core/services.py with provider-backed agents as each workflow matures:

  • matter audit
  • legal source retrieval
  • missing-fact questionnaire generation
  • draft-plan generation
  • block drafting
  • citation/fact validation

Keep each AI call wrapped by AITrace so Legal Aid can audit model inputs, outputs, selected sources, and human review decisions.

MVP Workflow

  1. Create or sync a matter.
  2. Select a drafting goal, such as motion_to_dismiss.
  3. Run a matter audit to generate candidate grounds.
  4. Advocate selects grounds, facts, and sources.
  5. Generate a block-based draft plan.
  6. Edit/review in the Lexical drafting surface.
  7. Validate facts/citations and export.

This scaffold intentionally stores legal logic in database-backed objects instead of burying it in DOCX/Jinja templates. DOCX files should become layout shells; clauses, source rules, and use conditions should live in the app.

About

Cleveland Legal Aid drafting tool using AI

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages