πŸ›‘οΈ Contract Simplifier β€” AI-Powered Contract Risk Analysis

🌍 Inspiration

Business contracts often carry hidden risks that can affect compliance, finances, or security β€” yet reviewing them manually is slow, subjective, and prone to oversight. Our team wanted to build an AI system that helps organizations evaluate vendor risk before signing a deal, in real time. We were inspired by the growing use of AI in due diligence and compliance automation and wanted to make risk intelligence accessible even to small teams without requiring a dedicated legal department.


🧠 What We Built

Contract Simplifier is a real-time, AI-powered risk analysis system that identifies, evaluates, and visualizes potential vendor risks before an organization enters into a business contract.

It combines LangGraph, ChromaDB, Bright Data, FastAPI, and React to form an intelligent end-to-end pipeline:

  1. User enters a query such as β€œAnalyze Tesla with high criticality.”
  2. The backend orchestrates multiple components:
  • LangGraph controls the AI workflow as a state machine.
  • Bright Data scrapes credible company data in real time.
  • ChromaDB stores and retrieves context embeddings.
  • OpenAI GPT-4 analyzes risk factors and scores vendors.
    1. The React frontend displays a live-streaming visualization of each analysis stage, showing how data moves from collection to insight.

This flow allows users to see the reasoning behind AI-driven conclusions, increasing transparency and trust.


βš™οΈ How We Built It

We followed a modular micro-frontend and microservice approach:

  • Backend (FastAPI + LangGraph):

    • Designed a pipeline with multiple β€œnodes” for classification, scraping, validation, and LLM evaluation.
    • Implemented streaming responses via Server-Sent Events (SSE) for real-time updates.
    • Integrated ChromaDB as a semantic memory layer for contextual recall.
  • Frontend (React + Tailwind CSS):

    • Developed a split-screen interface β€” chat panel on the left, risk visualization on the right.
    • Used animated progress indicators to show each step of the risk workflow.
    • Rendered color-coded risk scores with smooth transitions and responsive layout.
  • Data Layer:

    • Leveraged Bright Data for trusted source collection.
    • Applied domain-based filtering to prioritize credible sites (e.g., .gov, .edu, Bloomberg, Reuters).

πŸ” Key Features

  • AI Risk Scoring across four critical dimensions:

    • 🏦 Financial Risk
    • πŸ” Security Risk
    • πŸ“‰ Reputation Risk
    • 🧩 Resilience Strength
  • Streaming Visualization: View live updates of the analysis pipeline.

  • Source Verification: Automatically filters unreliable or duplicate data.

  • Vector Search with ChromaDB: Enhances context relevance for LLM queries.

  • Smart Classification: Detects whether the user request is a risk query or general chat.


🧩 Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   React     β”‚ ◄─SSE──►│   FastAPI    β”‚ ◄──────►│  LangGraph  β”‚
β”‚   Frontend  β”‚         β”‚   Backend    β”‚         β”‚   Pipeline  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                               β”‚                         β”‚
                               β–Ό                         β–Ό
                        β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”         β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                        β”‚  Web Scraper β”‚         β”‚  ChromaDB   β”‚
                        β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜         β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

πŸ’‘ What We Learned

  • AI pipelines benefit from clear state management. LangGraph helped us structure complex workflows that involved multiple data sources and LLM reasoning stages.
  • Streaming enhances user trust. Showing every step of analysis makes AI decisions more explainable and engaging.
  • Data credibility is crucial. Many scraped sources are unreliable, so integrating domain verification was key.
  • Frontend performance tuning matters. Handling SSE in React required careful optimization to avoid UI lag during real-time updates.
  • Cross-team collaboration is smoother with modular design. Each team member could iterate independently on backend, frontend, or AI pipeline.

🧠 Challenges We Faced

  • Latency management: AI and web scraping operations can be slow, so we used asynchronous FastAPI tasks and caching.
  • LLM consistency: Different runs could produce slightly varied risk ratings, so we implemented post-processing checks.
  • Data validation: Ensuring only credible, non-duplicate sources reached the model required multiple iterations of our filtering logic.
  • Frontend synchronization: Coordinating the live streaming events with changing backend states was initially tricky but solved using an event-driven architecture.

πŸš€ Impact

The system demonstrates how AI can act as an assistant for contract risk evaluation β€” performing tasks that would normally take analysts hours. By providing real-time transparency, contextual memory, and automated reasoning, Contract Simplifier has the potential to help organizations reduce decision-making time and improve compliance readiness.


🧰 Tech Stack

Layer Technology
AI Workflow LangGraph, LangChain
Backend FastAPI (Python 3.8+)
Frontend React 18+, Tailwind CSS
Vector Database ChromaDB
Web Scraping Bright Data API
LLM Engine OpenAI GPT-4
Streaming Server-Sent Events (SSE)

πŸ§ͺ Future Enhancements

  • Batch contract analysis for multiple vendors
  • Integration with CRM or ERP systems
  • Historical risk trend tracking
  • PDF report export
  • Multilingual support
  • Custom risk factor weighting

🀝 Team

  • Sanjay Sakthivel β€” AI & Backend (LangGraph, ChromaDB, FastAPI)
  • Aman Nindra β€” Frontend & Streaming & Database Integration (React, Tailwind, Firebase, AWS)
  • Rajbir Longia β€” Web Scraping & API Integration (Bright Data, REST)

❀️ Closing Thoughts

We built Contract Simplifier to show how AI can transform due diligence from a static checklist into a dynamic, explainable, and data-driven process. It’s not just about predicting risk β€” it’s about understanding it in real time.

β€œContracts define trust. Our AI ensures that trust is measurable.”


Built With

Share this project:

Updates