An enterprise-grade, AI-augmented contract management system that orchestrates the full lifecycle of commercial agreements — from inception through execution, performance, and termination.
Built to address the operational inefficiencies inherent in conventional contract management workflows, this platform eliminates fragmented email-based approval chains, manual clause review, and missed renewal windows. It serves as a centralized, auditable system of record for all contractual obligations and institutional commitments.
- Centralized contract storage with full-text search across metadata, parties, and clause content
- Immutable version history tracking every redline and editorial modification through negotiation cycles
- Confidential access controls with designated contract ownership
- Automated text extraction from uploaded PDF and DOCX artifacts via PyPDF2 and python-docx
- Pre-approved clause repository with risk-level classifications (Low, Medium, High, Critical)
- Reusable contract templates with parameterized
{{variable}}placeholder blocks - Category-driven organization enabling rapid assembly of bespoke agreements from vetted components
- Multi-stage, condition-based approval chains triggered automatically by contract category, value thresholds, or organizational rules
- Role-gated approver assignment (Legal, Finance, Executive) with granular approve/reject/change-request controls
- Complete audit trail capturing actor identity, timestamp, and decision rationale for every governance action
- Configurable escalation paths with sequential and parallel review stages
- Automated Metadata Extraction: LLM-driven parsing of uploaded contracts to extract parties, effective dates, expiry, payment terms, liability caps, governing law, and jurisdiction
- Risk Flagging Engine: Pattern-matching analysis identifying anomalous clauses — auto-renewal without notice, one-sided indemnification, unlimited liability, missing force majeure provisions
- Severity Classification: Risk flags categorized as Low, Medium, High, or Critical with actionable remediation recommendations
- Powered by Claude via the Anthropic API with token usage tracking and processing latency metrics
- Proactive renewal monitoring with 30/60/90-day advance notification windows
- Recurring obligation scheduling (Weekly, Monthly, Quarterly, Annual) with automated due-date tracking
- Overdue detection with real-time dashboard visibility into compliance gaps
- Dismissible alert system for expiring contracts and pending deliverables
- Dual-mode signature capture: typed name rendering and freehand canvas-based drawing with touch support
- SHA-256 cryptographic hash generation for signature integrity verification
- Complete signing audit log capturing actor email, IP address, user agent, and timestamp
- Sequential signing workflow with configurable signer ordering
# Clone the repository
git clone https://github.com/your-username/clm.git
cd clm
# Create and activate virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# Install dependencies
pip install -r requirements.txt
# Configure environment variables
cp .env.example .env
# Edit .env with your DATABASE_URL, ANTHROPIC_API_KEY, and SECRET_KEY
# Run migrations
python manage.py migrate
# Seed sample data (creates users, contracts, parties, approval chains)
python manage.py seed_data
# Create admin superuser
python manage.py createsuperuser
# Launch development server
python manage.py runserverANTHROPIC_API_KEY=sk-ant-...
AI_MODEL=claude-sonnet-4-20250514DATABASE_URL=postgres://user:password@localhost:5432/clm_dbCELERY_BROKER_URL=redis://localhost:6379/0Party ──────────┐
├──▶ Contract ──▶ ContractVersion
ContractCategory─┘ │
├──▶ ApprovalRequest ──▶ ApprovalAction
│ └──▶ ApprovalChain ──▶ ApprovalStep
│
├──▶ Obligation ──▶ ObligationCategory
├──▶ RenewalAlert
│
├──▶ AnalysisResult ──▶ ExtractedMetadata
│ └──▶ RiskFlag
│
├──▶ SignatureRequest ──▶ Signature
│ └──▶ SigningAuditLog
│
└──▶ ContractComment
ContractTemplate ──▶ Clause (M2M)
└──▶ ContractCategory
Clause ──▶ ClauseCategory
- Environment-based secret management via
python-dotenv - CSRF protection on all state-mutating endpoints
@login_requiredenforcement across all views.env,db.sqlite3, andmedia/excluded from version control via.gitignore- No hardcoded credentials, API keys, or secrets in source code
- SHA-256 signature hashing for tamper-evident audit records
- Set
DEBUG=Falseand configureALLOWED_HOSTS - Generate a cryptographically secure
DJANGO_SECRET_KEY - Switch from SQLite to PostgreSQL
- Configure static file serving via WhiteNoise or CDN
- Implement Celery workers for background task processing
- Add rate limiting to AI analysis endpoints
- Implement object-level authorization checks
- Configure TLS termination and security headers