Legal Contract Review Multi-Agent System
Overview
A US-based corporate law firm was spending more than 30 hours every week manually reviewing vendor and partnership contracts. Associates were extracting clauses, flagging risks, and comparing language against internal templates by hand. The process was inconsistent, created bottlenecks before every procurement and M&A cycle, and had already led to missed liability clauses resulting in costly disputes. Inkey Solutions built a four-agent AI pipeline that automated the entire review process end to end, reducing per-contract review time to under 45 minutes with full clause coverage on every document.
Challenges Faced
- More than 30 hours spent weekly on manual contract review across the associates team.
- Inconsistent risk assessment between reviewers, requiring senior partners to re-review completed work.
- Procurement cycles and M&A deals delayed by days waiting for reviewer availability.
- Liability clauses missed in dense contract language, leading to disputes that could have been avoided.
- No structured audit trail for review decisions, creating risk if decisions were ever challenged.
Solution Implemented
A four-agent AI pipeline was designed using CrewAI. Each agent owns one defined stage of the review process and passes structured output to the next.
- Document Ingestion Agent: Contracts are received as PDFs, often scanned and inconsistently formatted. Azure Document Intelligence handles OCR and layout analysis, then segments each document into clause-level chunks before any language model processes the text. Skipping this step causes structural loss and accuracy drops significantly.
- Clause Extraction Agent: A GPT-4 agent processes each segmented chunk and classifies clause types including indemnity, termination rights, IP ownership, liability caps, payment terms, and governing law. Named parties, dates, and monetary values are also extracted at this stage.
- Risk Benchmarking Agent: Each extracted clause is run through semantic search against the firm’s Golden Standard template library stored in Pinecone. The closest matching standard clause is retrieved and the deviation is scored as Critical, Review, or Acceptable. Reviewers receive a deviation report, not a raw extraction.
- Coordinator Agent: Built on CrewAI, this agent aggregates all assessments, generates a colour-coded risk report ranked by severity, and delivers it to the assigned reviewer. Reviewers only see flagged sections and never need to open the original contract.
A full contract moves through all four stages in under 45 minutes. Initial tuning of scoring thresholds against the firm’s template library added time on the first run for each new contract type, but standard agreement types are now fully automated.
Results Achieved
- Contract review time reduced from more than 30 hours per week to under 45 minutes per contract.
- Full clause coverage achieved on every contract, regardless of document length or formatting.
- Approximately 35 to 45 risk-flagged items surfaced per contract on average, ranked by severity.
- Risk thresholds standardised across the firm through the template library, removing dependence on individual reviewer judgment.
- Structured audit trail generated automatically for every review decision.
- Associates freed from full document reads and focused on legal judgment and negotiation.
Technology Used
- CrewAI for multi-agent orchestration and workflow coordination
- GPT-4 for clause extraction, entity recognition, and legal classification
- Azure Document Intelligence for PDF ingestion, OCR, and layout segmentation
- Pinecone for vector storage and semantic clause benchmarking against the Golden Standard library
- Created workflow automation and reviewer report delivery
- Python on Microsoft Azure for backend infrastructure and deployment