Citation-verified AI research engine for a legal-tech startup
A legal-tech startup needed a defensible AI layer over Indian case law without the hallucinated citations that were destroying trust with senior counsel.
- Citation accuracy in blind evaluation Citation accuracy in blind evaluation: 94%
- Judgments processed automatically Judgments processed automatically: 1,200/day
- Reduction in lawyer research time Reduction in lawyer research time: 70%
- Enterprise pilots signed post-launch Enterprise pilots signed post-launch: 3
- Python
- React
- PostgreSQL + pgvector
- GROBID
- Claude
- Supabase
- Client industry
- Legal-tech SaaS
- Timeline
- 16 weeks · MVP to pilot · fixed scope
- Technology stack
- Python, React, PostgreSQL + pgvector, GROBID, Claude, Supabase
Junior lawyers were spending 8–12 hours per matter manually reading judgments to extract parties, statutes, and precedents. Existing general-purpose LLMs confidently returned wrong citations, which made enterprise clients nervous and stalled paid pilots. The founders needed a system that could cite every answer back to a real paragraph in the source document.
- Automate structured extraction of parties, statutes, and holdings from Indian judgments.
- Guarantee every AI answer resolves to a real paragraph in the source PDF.
- Reach 90%+ citation accuracy in blind evaluation before pilot handover.
- Ship a reviewer console so in-house lawyers can correct extractions in-flow.
- Weeks 1–2 · Discovery + evaluation set
Sat with senior counsel to define what a correct citation looks like; built a 500-judgment blind evaluation set before writing pipeline code.
- Weeks 3–6 · Ingestion pipeline
Parsed judgment PDFs with GROBID, structured into parties, statutes, holdings, and paragraphs; loaded into Postgres with pgvector.
- Weeks 7–10 · Retrieval + answer engine
Hybrid BM25 + vector retrieval, followed by a citation-verification step that rejects any claim not anchored to a real paragraph.
- Weeks 11–13 · Reviewer console
Built the lawyer-in-the-loop UI: accept, reject, or correct extractions; corrections feed back into evaluation.
- Weeks 14–16 · Pilot hardening
Ran the blind evaluation with two enterprise buyers, tuned thresholds, and shipped the pilot handover doc.
- OCR quality on older scanned judgments was poor; a pre-clean step and a per-court PDF quality profile were required.
- Statute references use inconsistent shorthand across courts, so a normalisation layer had to be maintained by hand initially.
- Enterprise legal teams wanted a full audit log of every AI decision — added append-only citation logging late in the build.
- Judgment ingestion pipeline. PDFs are parsed, structured into parties, statutes, holdings, and paragraphs, and indexed with hybrid BM25 + vector search for fast retrieval.
- Citation-verified answer engine. Every AI-generated claim must anchor to a source paragraph before it is shown to the user — no hallucinated precedents.
- Lawyer-in-the-loop feedback loop. A reviewer console lets in-house lawyers accept, reject, or correct extractions, with corrections feeding back into model improvement.
“We needed citations that wouldn't get us laughed out of court. Ampex delivered a system that junior lawyers actually trust to do the heavy lifting.”
- In regulated verticals, an auditable citation chain sells more than any raw accuracy number.
- The evaluation set is the product — write it first, revisit it every fortnight.
- Lawyer-in-the-loop is not a fallback; it is the reason the system is trustworthy enough to sell.
Illustrative workflow example. Named client case studies are shared on request where permitted.