A fully private, RAG-powered legal document assistant deployed inside Meridian's Azure VPC — reviewing NDAs, service agreements, and due diligence packs in under 60 seconds with full source citations, zero data leaving the Azure tenant.
Meridian Law Partners spent 40% of junior associate time on document review — reading through NDAs, service agreements, employment contracts, and due diligence documents to extract key clauses, flag risks, and summarise obligations. Partners wanted a private, secure AI tool that could replace this grunt work without sending client documents to third-party AI services.
We built LexAI: a fully private RAG-powered legal document assistant that runs inside their own Azure VPC, trained on 12,000 precedent documents, and accessible via a clean web interface integrated with their existing document management system (NetDocuments). A 150-page contract now returns a risk summary in 47 seconds.
The firm's professional indemnity insurer prohibited sending client documents to any third-party AI service. Required 100% private deployment with no data leaving the Azure tenant — a hard blocker from day one.
Standard LLMs hallucinate on UK-specific legal terminology, jurisdiction references, and clause structures. Required domain-adapted prompting and fine-tuning on UK common law precedents — generic models were rejected in early testing.
Lawyers needed to query across 50–200 documents simultaneously during due diligence — "find all clauses restricting IP assignment across all 84 agreements in this acquisition folder" — in under 2 minutes.
Documents needed to flow from their existing DMS (NetDocuments) into the AI pipeline automatically, with bi-directional status updates and no double-entry workflow — the firm had 12 years of documents in NetDocuments and would not migrate.
Every AI-generated output needed a verifiable source citation for professional liability purposes — lawyers must be able to trace every AI claim back to the exact sentence and page number in the source document.
A 150-page contract needed to return a risk summary in under 60 seconds. Standard RAG chunking strategies with sequential embedding weren't fast enough at full document scale — early benchmarks showed 4–6 minute processing times.
Deployed entirely within Meridian's existing Azure tenant using Azure OpenAI private endpoints. Documents never leave their environment — same GPT-4o inference capabilities, zero third-party data exposure. Passed insurer audit on first submission.
Built a 4-layer prompt system: system context (UK law jurisdiction), document type classifier, clause extraction prompts per contract type (NDA / SLA / employment / M&A), and risk flagging instructions — calibrated against 200 human-reviewed test cases from Meridian's senior associates.
Implemented a two-tier retrieval system: fast BM25 keyword filtering for initial candidate selection, followed by dense vector search (pgvector + FAISS) for semantic relevance scoring. Multi-document queries fan out in parallel across document shards with result merging.
Built a real-time webhook listener that ingests new documents from NetDocuments automatically, processes them through the embedding pipeline (chunking → embedding → indexing), and returns structured metadata tags back to the DMS — no manual intervention required.
Every LexAI response includes exact source citations: document name, page number, paragraph, and a highlighted excerpt. Built a custom answer verification layer that cross-checks generated text against retrieved chunks — flagging any response where citations don't directly support the claim.
Implemented SSE streaming responses so users see output within 3 seconds of query submission. Large documents are chunked in parallel with 8 async FastAPI workers, reducing a 150-page contract from 4+ minutes to a 47-second average — comfortably under the 60-second requirement.
Pilot with 8 junior associates on NDA and service agreement review. The average 4-hour document review dropped to 51 minutes. Associates reported the AI's source citations made spot-checking faster than reading from scratch.
Rolled out across all 85 attorneys. The firm's operations team calculated $380K in annualised billable hour recovery — time previously spent on non-billable document parsing now redirected to client-facing work.
Three senior partners independently reviewed 340 AI-extracted clause sets against manual review. 99.1% accuracy was confirmed — with errors limited to highly ambiguous cross-referenced clauses that junior associates also frequently missed.
"LexAI has fundamentally changed how our junior associates spend their time. What used to take a first-year 4 hours now takes 8 minutes — with better accuracy and full source citations. The fact that it runs entirely within our Azure environment was non-negotiable for us, and Digivance delivered exactly that."
Ready to turn your AI idea into a production-grade product? Let's talk.