An intelligent contract review platform built with LangGraph, OpenAI, and modern web technologies. Automatically analyzes contracts, identifies risks, researches unclear terms, and delivers comprehensive summaries.
This system revolutionizes contract review by leveraging state-of-the-art AI technology. Built on LangGraph and OpenAI GPT-5-mini, it provides intelligent analysis tailored for both general legal contracts and creator/influencer brand deals.
Legal & Creator modes for different contract types
AI identifies & researches unclear terms automatically
Auto-creates Google Calendar events for deliverables
Professional summaries delivered to your inbox
Uses LLM + regex fallback to identify the primary company/brand for email subject line
Extracts clauses, deliverables, payment terms, legal flags, and key obligations
Identifies content ownership, exclusivity, usage rights, and payment risks with severity scoring
AI identifies complex legal terms → web search → generates creator-friendly explanations
Identifies due dates, times, timezones for Google Calendar integration
Generates markdown summary with risk highlights and research explanations
Emails summary + creates calendar invites with deliverable reminders
Each node in the LangGraph workflow performs a specialized function with robust error handling and state management:
Dual-approach extraction using LLM with regex fallback. Identifies company name for personalized email subjects.
Extracts structured data from contracts with JSON validation. Handles malformed responses gracefully.
Evaluates legal and business risks specific to creators. Rates severity and provides recommendations.
LLM identifies unclear terms → web search → summarization. Adapts to any contract language.
Parses dates, times, and timezones. Creates structured calendar-ready data.
Creates creator-friendly summaries with risk highlights and term explanations in markdown.
Resend API email delivery + Google Calendar API integration for cloud-native hosting.
The system was migrated from CrewAI to LangGraph for better production reliability and control:
| Aspect | CrewAI (Original) | LangGraph (Current) |
|---|---|---|
| Architecture | Agent-based orchestration | State machine with explicit flow |
| Telemetry | Interactive prompts causing hangs | No telemetry issues |
| Error Handling | Opaque agent failures | Per-node error handling with fallbacks |
| Performance | Slower agent orchestration | 30-50% faster execution |
| Debugging | Difficult to trace state | Clear state flow, easy debugging |
| Production | Required workarounds | Production-ready out of box |
Legal Mode: General contract analysis
Creator Mode: Brand deal focus with deliverables and calendar integration
Password-protected interface with session management. Hashed credentials via Werkzeug.
AI identifies which terms need clarification per contract. No predefined lists, fully adaptive.
Multi-method extraction handles malformed LLM responses. Graceful fallbacks ensure continuity.
DuckDuckGo search for legal definitions. Google Calendar API for deliverable tracking.
Clean interface with loading states, toast notifications, and mode switching.
Simple Flask-based web interface with mode switching between Legal and Creator analysis. Users upload PDF contracts, enter email, and receive comprehensive analysis within minutes.
Users receive professionally formatted email summaries with:
Deployed on Railway with the following considerations:
OPENAI_API_KEY, SENDER_EMAIL, RESEND_API_KEY, GOOGLE_CALENDAR_TOKEN_JSON, SECRET_KEY, APP_PASSWORD_HASH
Resend API for reliable cloud-native email delivery. No SMTP port restrictions.
Werkzeug password hashing, session management, HTTPS endpoints.
Gunicorn with 500s timeout and 2 workers for long-running LLM workflows.