← All workCH.03 · 2025

LawEasy

Local-first legal RAG that runs fully offline in 16 GB and cites what it says.

RAGLlama-3-8BQLoRAChromaDBOllama

A legal research assistant that never leaves the machine. LawEasy parses messy legal PDFs, retrieves the right passages with hybrid search and answers with a fine-tuned local model. Three separate layers guard against hallucinated law.

Approach

  1. OCR-aware PDF parsing, so scanned judgments and clean digital filings both make it into the index.
  2. Hybrid retrieval: BM25 keyword search fused with dense vectors in ChromaDB, re-ranked with MMR for diversity.
  3. Llama-3-8B fine-tuned with QLoRA and served locally through Ollama; the whole stack fits in 16 GB, fully offline.
  4. Layer 1, relevance gating: low-relevance retrievals are refused instead of being answered.
  5. Layer 2, grounded prompting: the model may only answer from retrieved context.
  6. Layer 3, post-hoc citation checks: every cited passage is verified against the source.
  7. Covered by 30+ automated tests.