Skip to content

Repository files navigation

⚖️ ContractIQ – Multi-Agent Legal Contract Review Platform

ContractIQ is an AI-powered legal contract review platform that automates contract analysis, risk assessment, redline generation, and executive reporting using a multi-agent architecture built with LangGraph and OpenAI.

The platform enables users to upload contracts and receive a professional legal review report within seconds.


🚀 Features

📄 Contract Classification

Automatically identifies the contract type, including:

  • NDA
  • Employment Agreement
  • Vendor Agreement
  • Professional Services Agreement
  • Consulting Agreement
  • Custom Contracts

🔍 Clause Extraction

Extracts critical legal clauses, including:

  • Confidentiality
  • Liability
  • Indemnification
  • Termination
  • Payment Terms
  • Intellectual Property
  • Non-Compete
  • Governing Law

⚠️ Risk Analysis

Evaluates each clause and identifies:

  • High Risk Clauses
  • Medium Risk Clauses
  • Missing Clauses
  • Potential Legal Exposure

📊 Contract Risk Scoring

Generates an overall contract risk score:

0–39   Low Risk
40–69  Medium Risk
70–100 High Risk

✍️ Redline Recommendations

Automatically generates suggested contract revisions to reduce legal and business risk.

Examples:

  • Limit excessive liability exposure
  • Improve confidentiality protections
  • Clarify payment obligations
  • Add missing governing law clauses

📑 Executive Report Generation

Produces executive-ready reports containing:

  • Contract Type
  • Risk Score
  • Executive Summary
  • High Risk Areas
  • Medium Risk Areas
  • Missing Clauses
  • Recommended Actions

📄 PDF Export

Generates a professional PDF report for stakeholders and decision makers.


🏗️ Multi-Agent Architecture

Contract PDF
      ↓
Parser Agent
      ↓
Contract Classification Agent
      ↓
Clause Extraction Agent
      ↓
Risk Analysis Agent
      ↓
Risk Scoring Agent
      ↓
Redline Recommendation Agent
      ↓
Executive Report Agent
      ↓
PDF Report Generator

Powered by LangGraph for workflow orchestration.


🛠️ Tech Stack

AI & Agent Framework

  • LangGraph
  • OpenAI GPT-4o Mini

Backend

  • FastAPI
  • Pydantic

User Interface

  • Chainlit

Document Processing

  • PDFPlumber
  • ReportLab

Language

  • Python

📂 Project Structure

ContractIQ
│
├── app
│   ├── agents
│   ├── api
│   ├── reporting
│   ├── models
│   └── services
│
├── contracts
│
├── tests
│
├── run_contract_review.py
│
├── requirements.txt
│
└── README.md

⚡ FastAPI API

Review Contract

POST /review-contract

Upload a PDF contract and receive:

{
  "contract_type": "Professional Services Agreement",
  "risk_score": 58,
  "pdf_file": "ContractIQ_Report.pdf"
}

💡 Example Workflow

Input

Upload:

Professional_Services_Agreement.pdf

Output

Contract Type:
Professional Services Agreement

Risk Score:
58 / 100

High Risk Areas:
• Liability

Missing Clauses:
• Confidentiality
• Intellectual Property

Recommendations:
• Add confidentiality clause
• Limit liability exposure

🎯 Business Value

ContractIQ helps organizations:

  • Reduce contract review time
  • Identify legal risks faster
  • Improve contract consistency
  • Support legal and procurement teams
  • Generate executive-ready reports

🔮 Future Enhancements

  • Contract Comparison Agent
  • Compliance Review Agent
  • Clause Library
  • Multi-Language Contracts
  • Azure Deployment
  • Role-Based Access Control
  • Legal Knowledge Base
  • Contract Version Comparison

👨‍💻 Author

Sifat Ullah Khan

Microsoft Certified AI Engineer Associate (AI-102)

GitHub: https://github.com/Sifatkhan91

LinkedIn: https://www.linkedin.com/in/sifatullahkhan


⭐ If you found this project useful, consider giving it a star.

About

Multi-Agent Legal Contract Review Platform powered by LangGraph, OpenAI, FastAPI, and Chainlit. Automatically classifies contracts, extracts clauses, analyzes legal risks, generates redline recommendations, and produces executive PDF reports.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages