Enterprise-Grade AI Contract Intelligence Platform
This document provides a comprehensive overview of KontractIQ, including its architecture, features, workflows, AI capabilities, technology stack, implementation details, user experience, security considerations, and future roadmap. It has been professionally structured and optimized for GitHub with clean formatting, badges, tables, diagrams, callouts, and well-organized sections to ensure excellent readability for recruiters, hiring managers, collaborators, and open-source contributors.
- Executive Summary
- Project Identity & Branding
- The Problem Statement
- Solution Overview
- Core Features
- Pages & Navigation
- Technology Stack
- System Architecture
- Deployment Architecture
- Unique Differentiators
- Competitor Comparison
- Future Enhancements
- Project Metrics
- User Guide
- Conclusion
KontractIQ is a production-ready, enterprise-grade contract intelligence platform that revolutionizes how organizations analyze, manage, and extract value from their contract portfolios. Built for Streamlit Community Cloud with zero financial cost, this platform serves legal, procurement, compliance, and business teams who need to analyze contracts faster and more intelligently than manual review allows.
The platform represents a fundamental shift from traditional contract analysis tools that examine documents in isolation. Instead, KontractIQ provides a holistic, portfolio-wide approach that:
- Detects numeric and date inconsistencies across multiple contracts simultaneously
- Provides rule-based AI risk detection with active learning capabilities
- Generates professionally branded reports suitable for executive presentations and compliance audits
| Promise | Status |
|---|---|
| 100% free with no financial cost | ✅ |
| Zero API keys required for core features | ✅ |
| Professional white and blue UI | ✅ |
| Deployable on Streamlit Cloud in one click | ✅ |
| Open source with no vendor lock-in | ✅ |
| Works within 1GB memory limit | ✅ |
| 100% private - session-based storage | ✅ |
| Metric | Value |
|---|---|
| Core Features | 12 |
| Pages | 15 |
| Clause Types Extracted | 8 |
| Report Types | 4 |
| Contract Templates | 6 |
| File Types Supported | 3 (PDF, DOCX, TXT) |
| Max Contracts Per Session | 20 |
| Max File Size | 10MB |
| Memory Usage | <800MB |
| Aspect | Value |
|---|---|
| Name | KontractIQ |
| Pronunciation | Kon-trakt-eye-q |
| Meaning | Contract + Intelligence Quotient |
| Tagline | "Intelligence for every clause." |
| Icon | ⚖️ (Gavel / Justice Scale) |
The name derives from the fusion of "Contract" and "Intelligence Quotient," reflecting the platform's mission to bring measurable intelligence to contract analysis.
| Role | Color Name | Hex Code | Usage |
|---|---|---|---|
| Primary Base | Deepest Navy | #0A2647 | Headers, hero sections, primary text |
| Primary Dark | Rich Navy | #1B3A5C | Secondary dark backgrounds |
| Primary Main | Corporate Blue | #2C5F8A | Primary buttons, active states, links |
| Primary Light | Vibrant Blue | #4A7FA5 | Hover states, secondary buttons |
| Primary Accent | Sky Blue | #7BA5C4 | Borders, subtle highlights, footer text |
| Primary Soft | Pale Blue | #B8D4E8 | Disabled states, light backgrounds |
| Primary BG | Ice Blue | #E8F1F8 | Main page background |
| Role | Color Name | Hex Code | Usage |
|---|---|---|---|
| Pure White | White | #FFFFFF | Cards, modals, inputs |
| Off White | Background White | #F8FAFE | Alternative card backgrounds |
| Light Gray | Border Light | #E2E8F0 | Borders, dividers |
| Medium Gray | Placeholder | #94A3B8 | Placeholder text, icons |
| Dark Gray | Secondary Text | #475569 | Labels, secondary information |
| Deep Navy | Primary Text | #0A2647 | Headings, primary text |
| Role | Hex Code | Background Hex | Usage |
|---|---|---|---|
| Success | #0D9488 | #E6F7F5 | Positive numbers, success messages |
| Warning | #D97706 | #FEF3C7 | Risk indicators, warnings |
| Danger | #DC2626 | #FEE2E2 | Critical risks, negative numbers |
| Info | #3B82F6 | #EFF6FF | Informational messages |
| Type | Size | Weight | Usage |
|---|---|---|---|
| Display | 30px | 600 | Hero numbers, balance tiles |
| Title 1 | 22px | 600 | Section headers |
| Title 2 | 20px | 600 | Card titles |
| Headline | 18px | 600 | Modal headers |
| Body Large | 16px | 500 | Important information |
| Body | 14px | 400 | Regular text |
| Small | 13px | 500 | List items, contract names |
| Caption | 12px | 500 | Labels, badges |
| Micro | 11px | 500 | Timestamps, helper text |
| Footer | 10px | 500 | Report footers, legal disclaimers |
| Token | Value | Usage |
|---|---|---|
| xs | 4px | Small gaps between icons and text |
| sm | 8px | Grid gaps, chip gaps |
| md | 12px | List item gaps, card padding |
| lg | 16px | Section padding, card padding |
| xl | 18px | Body padding |
| xxl | 22px | Hero padding |
| xxxl | 32px | Large section spacing |
| Token | Value | Usage |
|---|---|---|
| sm | 8px | Icons, small elements |
| md | 12px | Chips, small cards, buttons |
| lg | 16px | Cards, tiles, modals |
| xl | 20px | Balance tile, hero cards |
| xxl | 24px | Large containers |
| full | 50% | Avatars, circular icons |
| Token | Value | Usage |
|---|---|---|
| sm | 0 1px 2px rgba(10, 38, 71, 0.05) | Default cards |
| md | 0 4px 6px rgba(10, 38, 71, 0.07) | Elevated cards |
| lg | 0 10px 15px rgba(10, 38, 71, 0.08) | Modals, dropdowns |
| xl | 0 20px 25px rgba(10, 38, 71, 0.10) | Hero sections |
| hover | 0 8px 20px rgba(10, 38, 71, 0.10) | Card hover states |
Organizations today manage hundreds or thousands of contracts across diverse stakeholder groups including vendors, suppliers, employees, partners, and customers. This distributed contract landscape creates significant challenges that traditional manual review processes cannot adequately address.
Legal and procurement teams spend hours reading through contracts to find specific clauses like termination notice periods, liability caps, or payment terms. A single contract review typically requires 30 to 60 minutes of focused attention.
- Teams waste thousands of hours annually on manual discovery
- Strategic work suffers as resources are pulled into administrative tasks
- The problem compounds as contract volumes grow
- Creates a scaling crisis that many organizations cannot effectively manage
Contracts are stored as static documents without searchable metadata or indexes. Finding specific information requires reading each document individually, and there's no way to query across documents for specific terms or concepts.
When contracts use different payment terms (30 days vs 60 days vs 90 days) or liability caps ($1M vs $5M vs unlimited), these contradictions are rarely caught during manual review. Teams review contracts in isolation, missing critical inconsistencies across their vendor portfolio.
- Creates significant risk blind spots
- Leads to inconsistent treatment of vendors and partners
- Results in financial exposure from inconsistent terms
- Makes portfolio-wide standardization impossible
Manual review focuses on individual documents, not portfolio patterns. Without automated cross-document analysis, inconsistencies remain invisible to reviewers.
Organizations often maintain multiple versions of similar contracts (MSA v1, MSA v2, amendments, rider documents). Manually comparing versions is error-prone, time-consuming, and often incomplete.
- Working with outdated terms
- Missing critical amendments
- Legal exposure from inconsistent application
- Problems intensify during organizational changes
No systematic way to track and compare contract versions. Document management systems provide version history but don't highlight meaningful differences.
Contract knowledge lives inside documents, not in a searchable database. When someone asks "which vendors have unlimited liability?" or "who has 30-day payment terms?", there's no easy way to answer without re-reviewing every contract.
- Prevents understanding of contractual exposure
- Weakens negotiation position
- Misses opportunities for standardization
- Creates information asymmetry
Contracts are structured as documents, not as data. The information they contain isn't organized in a way that enables querying and analysis.
Risk identification is manual and inconsistent across reviewers. One reviewer might flag auto-renewal as high risk while another misses it entirely. There's no systematic way to learn from past reviews.
- Creates compliance gaps
- Increases regulatory exposure
- Misses opportunities to improve contract terms
- No institutional memory of risk identification
Risk identification relies on individual reviewer judgment rather than systematic, repeatable processes. There's no way to capture and share risk knowledge across teams.
When creating new contracts, teams start from blank documents or outdated templates. They miss standard clauses or include high-risk terms because they have no real-time guidance or warnings.
- Inconsistent contract quality
- Missed opportunities to include favorable terms
- Propagation of problematic language
- Each contract represents fresh opportunity to introduce risk
No structured contract creation process with real-time guidance. Contract creation relies on institutional knowledge that isn't captured or accessible.
| Problem | KontractIQ Solution |
|---|---|
| Time-consuming discovery | TF-IDF + keyword search finds clauses in seconds |
| Missed inconsistencies | CrossCheck compares numeric/date values across contracts |
| Version confusion | Intelligent diff shows significant changes |
| Scattered knowledge | Centralized searchable repository with 8 clause types |
| Static risk detection | Session-based feedback with export/import |
| No creation guidance | Templates with rule-based warnings |
| Capability | Description |
|---|---|
| Upload | PDF, DOCX, TXT - single or batch, 10MB limit, 20 contract max |
| Parse | Extract clean text, detect scanned PDFs |
| Extract | Identify 8 clause types with confidence scoring |
| Search | TF-IDF + BM25 hybrid search with relevance ranking |
| Compare | Version-to-version diff with change categorization |
| CrossCheck | Find numeric/date contradictions across contracts |
| RiskScan | Flag risk indicators, export/import rules |
| Ask | AI chat with free Groq API (optional) |
| Create | Contract templates with rule-based warnings |
| Report | Professional PDF and HTML reports with branded footer |
| Demo Mode | Sample contracts to test without uploading |
| Principle | Implementation |
|---|---|
| Zero Financial Cost | No API keys required for core features |
| Privacy First | Session-based storage, no permanent cloud storage |
| Accessible | WCAG AA/AAA compliant |
| Professional | White and blue theme with perfect contrast |
| Deployable | Fits within Streamlit Cloud 1GB memory |
The upload system accepts PDF, DOCX, and TXT files with support for batch upload of multiple contracts simultaneously. Users can drag and drop files or use the file browser interface. The system validates file types, sizes, and total contract count before processing.
- Uses Streamlit's file_uploader with accept_multiple_files enabled
- Comprehensive validation pipeline for each file
- DocumentParser class handles specialized parsing for each file type
- Drag-and-drop interface with visual feedback
- Progress indicators for each file
- Scanned PDF detection with clear warnings
- Contract limit counter (0/20)
- Uploaded contracts list with management capabilities
| Limit | Value | Reason |
|---|---|---|
| Max contracts per session | 20 | Memory limit |
| Max file size | 10MB | Streamlit limit |
| Max pages per contract | 50 | Processing time |
| Scanned PDF | Detected + rejected | No OCR support |
The parsing engine extracts clean text from uploaded documents, handling three file formats with specialized parsers. The system includes intelligent fallback mechanisms for challenging PDF files.
- Primary: PyPDF2 for speed
- Fallback: pdfplumber for better extraction
- Detection: Scanned PDF identification if text < 100 characters
- Uses python-docx library
- Extracts paragraphs while preserving structure
- Handles both simple and complex Word documents
- UTF-8 encoding with Latin-1 fallback
- Handles various line endings
- Broad character encoding compatibility
If extracted text is less than 100 characters, the system flags the document as likely scanned and provides clear instructions to the user.
Identifies and extracts 8 key clause types using a hybrid approach combining regex pattern matching and SpaCy NLP.
| Clause Type | Detection Method |
|---|---|
| Governing Law | Pattern matching + state detection |
| Payment Terms | Pattern + number extraction |
| Liability Cap | Pattern + value extraction |
| Termination Notice | Pattern + number extraction |
| Confidentiality Period | Keyword + duration extraction |
| Renewal Terms | Pattern + auto-detection |
| Indemnification | Keyword + party detection |
| Force Majeure | Keyword + event detection |
Each clause type has specific detection patterns optimized for accuracy and performance. The system uses compiled regex patterns for speed, with SpaCy providing additional NLP capabilities when needed.
- Clause type identified
- Extracted text snippet
- Page location (if available)
- Contract source
- Confidence score (0-1)
- Review recommendation flag
Combines TF-IDF, BM25, and metadata filtering to provide comprehensive search across all uploaded contracts. Results are ranked by relevance using Reciprocal Rank Fusion.
| Method | Technology | Purpose |
|---|---|---|
| Keyword Search | BM25 algorithm | Exact term matching |
| Similarity Search | TF-IDF + Cosine | Find related concepts |
| Metadata Filter | Session state | Filter by contract name, date |
| Hybrid Fusion | Reciprocal Rank Fusion | Combined relevance ranking |
- "payment terms 30 days"
- "liability cap"
- "termination notice period"
- "indemnification"
- "force majeure"
- TF-IDF with 10,000 max features
- BM25 with k1=1.5, b=0.75, epsilon=0.25
- N-gram range: 1-3
- Stop word removal for English
Compares two versions of a contract and highlights differences with color-coded visual diff and comprehensive change analysis.
| Change Type | Highlight Style | Description |
|---|---|---|
| Added Text | Green background | Lines present in new version |
| Removed Text | Red strikethrough | Lines present in original only |
| Modified Text | Yellow background | Lines with content changes |
| Formatting | Ignored | Whitespace changes only |
- Total added lines count
- Total removed lines count
- Total modified lines count
- Similarity percentage
- Change distribution by type
- Change impact assessment (minor/moderate/major)
- Compare original vs amended agreements
- Track changes between contract versions
- Review redlined documents
- Identify substantive changes
Analyzes all uploaded contracts to find conflicting numeric and date values across your contract portfolio.
| Comparison Type | Example Contradiction |
|---|---|
| Payment Terms | 30 days vs 60 days vs 90 days |
| Liability Caps | $1M vs $5M vs Unlimited |
| Termination Notice | 30 days vs 60 days |
| Governing Law | CA vs NY vs DE |
| Confidentiality Period | 1 year vs 3 years vs 5 years |
| Renewal Terms | Auto-renew vs manual renewal |
| Metric | Status |
|---|---|
| Most common value across your contracts | ✅ |
| Percentage of contracts using norm | ✅ |
| List of deviating contracts | ✅ |
- Clause type analyzed
- Conflict detection (true/false)
- All values found across contracts
- Most common value with percentage
- List of contracts that deviate
- Actionable recommendation
Scans contracts for predefined risk indicators and allows users to customize risk rules with export/import functionality.
| Risk Type | Default Severity |
|---|---|
| Unlimited Liability | Critical |
| Auto-Renewal | High |
| No Termination for Convenience | Medium |
| Broad Indemnification | Medium |
| Short Payment Terms (7/10/14/15 days) | Medium |
| Missing Governing Law | Low |
| Missing Confidentiality Duration | Low |
- Adjust severity levels for any risk type
- Add custom risk patterns with regex
- Export risk rules as JSON files
- Import previously exported rules
Shows current risk snapshot with comparison to previous import when users import their saved rules.
Provides AI-powered chat interface for contract questions using Groq API (free tier).
- User provides their own Groq API key
- Optional feature, not required for core functionality
- Free API key available at console.groq.com
- Answer questions about contract content
- Summarize contract terms
- Explain clause implications
- Extract specific information
- Compare contracts
- Mixtral-8x7b-32768 (default)
- Llama3-70b-8192
- Gemma2-9b-it
- Llama3-8b-8192
When no API key is provided, the system provides enhanced keyword matching to find relevant contract sections.
Provides 6 fillable contract templates with real-time validation and rule-based warnings.
| Template | Use Case |
|---|---|
| NDA (Unilateral) | One-way confidentiality |
| NDA (Mutual) | Two-way confidentiality |
| Master Services Agreement | Ongoing vendor relationship |
| Independent Contractor Agreement | Freelancers/consultants |
| Employment Offer Letter | Hiring employees |
| Software License Agreement | Software sales |
| Feature | Status |
|---|---|
| Fillable Fields | ✅ |
| Smart Defaults | ✅ |
| Real-time Validation | ✅ |
| Rule-based Warnings | ✅ |
| Field | Value | Warning |
|---|---|---|
| Liability Cap | Unlimited | High risk warning |
| Liability Cap | $100,000 | Below standard warning |
| Liability Cap | $1,000,000 | Standard checkmark |
| Payment Terms | 7 days | Very short warning |
| Payment Terms | 15 days | Short warning |
| Payment Terms | 30 days | Standard checkmark |
Provides a high-level overview of all contracts and key metrics.
- Total contracts uploaded
- Total clauses extracted
- Risk summary by severity (Critical, High, Medium, Low)
- Contract distribution charts
- Recent activity feed
- Quick action buttons
- Demo mode launcher
One-click button loads 3-5 sample contracts instantly, allowing users to explore all features without uploading their own files.
Displays all extracted clauses organized by type, contract, and relevance.
- Filter by clause type (8 types available)
- Search within clauses
- Sort by contract, clause type, or relevance
- Export clause data
- View original context
- Minimum confidence filter
- Table view for structured data
- Card view for visual browsing
- Detail view for clause content
Generates professional branded reports in PDF and HTML formats.
| Report Type | Contents |
|---|---|
| Full Analysis | All contracts, all clauses, all risks |
| Risk Summary | Only risk findings by severity |
| Clause Comparison | Cross-contract clause comparison |
| Executive Summary | High-level metrics and recommendations |
- Branded header with KontractIQ logo
- Professional white and blue theme
- Tabular data with pandas DataFrames
- Charts and visualizations (Plotly)
- Risk indicators with color coding
- Export to PDF and HTML
- Download buttons
The platform organizes 15 pages into 5 logical groups for intuitive navigation.
Purpose: Main landing page with key metrics
Components:
- Hero section with welcome message
- Key metrics cards (contracts, clauses, risks)
- Risk severity distribution chart
- Recent contracts list
- Quick action buttons for common tasks
- Demo mode launcher
Purpose: Upload single or batch contracts
Features:
- Drag-and-drop file uploader
- Support for PDF, DOCX, TXT
- Batch upload capability
- Progress indicators
- Scanned PDF detection
- Contract limit counter (0/20)
- Uploaded contracts list
Purpose: View and manage all contracts
Features:
- List of all uploaded contracts
- Contract metadata (name, size, pages, upload date)
- Search and filter contracts
- Delete individual contracts
- Clear all contracts button
- Contract preview functionality
Purpose: Browse extracted clauses
Features:
- All extracted clauses organized by type
- Filter by clause type (8 types)
- Search within clauses
- Sort options
- Export clause data as CSV/JSON
- View original context
Purpose: Hybrid search across all contracts
Features:
- Search input with suggestions
- Hybrid search (TF-IDF + BM25)
- Result ranking with relevance scores
- Highlight matched terms
- Filter by contract
- Export search results
Purpose: Version-to-version contract comparison
Features:
- Two-column contract selector
- Select version A and version B
- Visual diff highlighting
- Side-by-side or inline view
- Change summary statistics
- Export comparison report
Purpose: Find numeric/date contradictions
Features:
- Automatic cross-contract analysis
- Numeric/date contradiction detection
- Show me the norm feature
- List of deviating contracts
- Recommendations for each conflict
- Export inconsistency report
Purpose: Risk detection with export/import
Features:
- Risk detection across all contracts
- Risk summary by severity
- Detailed risk findings per contract
- Adjust severity levels
- Add custom risk patterns
- Export risk rules as JSON
- Import previously exported rules
Purpose: Analyze vendor contract patterns
Features:
- Analyze contracts by vendor
- Vendor comparison metrics
- Find inconsistent terms by vendor
- Vendor risk scoring
- Export vendor analysis report
Purpose: Find unusual contract terms
Features:
- Statistical anomaly detection
- Unusual term patterns
- Outlier identification
- Review recommendations
- Export anomaly report
Purpose: Ask questions about contracts
Features:
- Chat interface for contract questions
- Optional Groq API key input
- Local fallback for no API key
- Conversation history
- Copy responses to clipboard
- Clear conversation button
Purpose: Generate contracts from templates
Features:
- Contract template selection (6 templates)
- Fillable form fields
- Real-time validation
- Rule-based warnings
- Preview generated contract
- Download as DOCX or TXT
Purpose: Generate PDF/HTML reports
Features:
- Report type selection (4 types)
- Contract selection for report
- Format selection (PDF or HTML)
- Generate and preview report
- Download report button
Purpose: Monitor system performance
Features:
- Memory usage monitor
- Contract count and limits
- Processing time statistics
- Session information
- Export session data
| Component | Technology | Version |
|---|---|---|
| UI Framework | Streamlit | 1.32.0 |
| Charts | Plotly | 5.18.0 |
| Data Tables | Pandas | 2.0.3 |
| Icons | Tabler Icons | N/A |
The core UI framework provides reactive components, session state management, and seamless deployment to Streamlit Cloud. Streamlit's component model enables rapid development of data applications with minimal boilerplate.
Interactive charting library provides visual analytics with rich interactivity. Charts are fully responsive and support hover details, zooming, and panning. Plotly integrates seamlessly with Streamlit through st.plotly_chart.
Data manipulation library handles all tabular data operations including contract metadata, clause extraction results, risk findings, and report data. Pandas provides efficient data structures for analysis and export.
| Component | Technology | Version |
|---|---|---|
| Language | Python | 3.10+ |
| Session State | Streamlit | Built-in |
The core programming language provides robust data processing, natural language processing, and machine learning capabilities. Python's extensive library ecosystem enables all platform features.
Built-in session management provides persistence for contract data, clauses, risks, and user preferences. Session state enables the privacy-first architecture with no external database required.
| Component | Technology | Version |
|---|---|---|
| PDF Parsing | PyPDF2 | 3.0.1 |
| PDF Fallback | pdfplumber | 0.10.3 |
| DOCX Parsing | python-docx | 1.1.0 |
Primary PDF parsing library provides fast text extraction from standard PDF files. PyPDF2 handles most text-based PDFs efficiently and is the first-choice parser for speed.
Secondary PDF parsing library provides better text extraction from challenging PDFs. pdfplumber is used as a fallback when PyPDF2 extraction yields insufficient text.
Microsoft Word document parsing library extracts text from DOCX files. python-docx preserves basic document structure while extracting all paragraph text.
| Component | Technology | Memory |
|---|---|---|
| Search | scikit-learn (TF-IDF) | 15MB |
| Keyword Search | rank_bm25 (BM25) | 10MB |
| Similarity | cosine_similarity | 5MB |
| NLP | SpaCy (en_core_web_sm) | 40MB |
Machine learning library provides TF-IDF vectorization for semantic search. The TfidfVectorizer creates document vectors with 10,000 max features, stop word removal, and n-gram range of 1-3.
Information retrieval library provides BM25 scoring for exact keyword matching. The BM25Okapi implementation includes k1=1.5, b=0.75, and epsilon=0.25 parameters optimized for contract text.
Natural language processing library provides clause detection and entity recognition. The small English model (40MB) balances accuracy with memory efficiency, loading lazily only when needed.
| Component | Technology | Free Tier |
|---|---|---|
| LLM | Groq API | 30 req/min |
| Model | mixtral-8x7b-32768 | Free |
Cloud-based LLM API provides intelligent contract Q&A with free tier access. Groq offers 30 requests per minute for the mixtral-8x7b-32768 model.
| Component | Technology | Version |
|---|---|---|
| PDF Generation | ReportLab | 4.0.7 |
| HTML Templates | Jinja2 | 3.1.2 |
PDF generation library creates professional reports with proper formatting. ReportLab handles page layout, tables, charts, and branding.
HTML template engine generates interactive web reports. Jinja2 templates include styling, interactivity, and responsive design.
| Component | Technology | Version |
|---|---|---|
| Environment | python-dotenv | 1.0.0 |
| System Monitoring | psutil | N/A |
Environment variable management handles configuration and secrets. dotenv loads .env files for local development and Streamlit secrets for production.
System monitoring library provides memory usage tracking. psutil enables the System Metrics page with real-time performance data.
# Core
streamlit==1.32.0
pandas==2.0.3
numpy==1.24.3
plotly==5.18.0
# Document Processing
PyPDF2==3.0.1
pdfplumber==0.10.3
python-docx==1.1.0
# Search & ML (Lightweight)
scikit-learn==1.3.2
rank-bm25==0.2.2
# NLP
spacy==3.7.2
# Reports
reportlab==4.0.7
jinja2==3.1.2
# Utilities
python-dotenv==1.0.0The platform follows a clean three-tier architecture with clear separation of concerns:
┌─────────────────────────────────────────────────────────────────────────────┐
│ PRESENTATION LAYER │
│ Streamlit Application (15 Pages) │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │Dashboard │ │ Upload │ │ Explorer │ │ Search │ │ Compare │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │CrossCheck│ │ RiskScan │ │ Vendor │ │ Anomaly │ │ AI Chat │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ Create │ │ Reports │ │ Metrics │ │ Clause │ │
│ └──────────┘ └──────────┘ └──────────┘ └──────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ BUSINESS LOGIC LAYER │
│ Core Modules (8 Modules) │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Parser │ │ Extractor │ │ Search │ │ Comparator │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ CrossCheck │ │ RiskScan │ │ Templates │ │ Reports │ │
│ └──────────────┘ └──────────────┘ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────────────────────┐
│ DATA LAYER │
│ Session State (Memory < 500MB) │
│ │
│ ┌─────────────────────────────────────────────────────────────────────┐ │
│ │ • Uploaded contracts (text + metadata) - Max 20 contracts │ │
│ │ • Extracted clauses - Max 8 types × 20 contracts │ │
│ │ • Risk findings - Session only │ │
│ │ • User feedback - Exportable as JSON │ │
│ └─────────────────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────────────────┘
- Handles file validation, parsing, and contract creation
- Uses DocumentParser for text extraction
- Creates Contract objects with metadata
- Extracts text from PDF, DOCX, and TXT files
- Implements multiple parsing strategies for PDF files
- Falls back from PyPDF2 to pdfplumber as needed
- Identifies and extracts 8 clause types
- Uses regex patterns and SpaCy NLP
- Returns Clause objects with confidence scores
- Implements hybrid TF-IDF + BM25 search
- Handles document indexing, query processing, and result ranking
- Uses Reciprocal Rank Fusion for combined ranking
- Provides intelligent version comparison
- Categorizes changes, calculates similarity
- Generates insights and change statistics
- Analyzes contracts for numeric and date inconsistencies
- Identifies payment term, liability cap, termination notice variations
- Generates recommendations for standardization
- Scans contracts for risk indicators
- Handles rule management and risk detection
- Provides severity classification and recommendations
- Provides AI-powered contract Q&A
- Integrates with Groq API
- Includes local fallback for keyword-based answers
- Generates contracts from templates
- Handles field validation and warning generation
- Renders professional contract documents
- Generates professional PDF and HTML reports
- Creates comprehensive analysis with charts and tables
- Provides branded reporting with professional formatting
User Uploads File → File Validation → Document Parsing →
Text Extraction → Contract Creation → Session Storage
Contract Text → Clause Extraction → Confidence Scoring →
Clause Storage → Session Update
User Query → Query Processing → TF-IDF + BM25 Search →
Rank Fusion → Result Display
Contract Collection → Value Extraction → Pattern Analysis →
Norm Identification → Deviation Detection → Recommendation Generation
Contract Collection → Rule Application → Risk Detection →
Severity Classification → Result Storage
Data Collection → Template Rendering → Chart Generation →
PDF/HTML Creation → Download
- Stores only essential data with efficient data structures
- Contracts store text truncation to 100,000 characters
- Clauses store limited text snippets
- Risks store minimal metadata
- Limited to 10,000 max features
- Stop word removal reduces vocabulary
- N-gram range limited to 1-3
- Efficient sparse representation
- Optimized parameters for contract text
- Lazy loading only when needed
- Small English model (40MB) for memory efficiency
- Contract text limited to 100,000 characters
- Clause text limited to 1,000 characters
- Preview text limited to 200 characters
| Component | Memory Usage |
|---|---|
| Session State (20 contracts) | 200-300MB |
| TF-IDF Vectorizer | 15MB |
| BM25 Index | 10MB |
| SpaCy Model | 40MB |
| Application Code | 50MB |
| Overhead | 100MB |
| Total | 500-800MB |
- No data ever persists to the cloud
- All contract data remains in the browser session
- Session termination automatically clears all data
- Core features work without any API keys
- No external services required for primary functionality
- All file uploads are validated for type, size, and content
- Search queries are sanitized
- Form inputs are validated
- Streamlit Cloud enforces HTTPS for all connections
- Data transmission is encrypted
- All dependencies are current versions
- No known vulnerabilities
- Regular updates ensure security
| Requirement | Specification |
|---|---|
| Hosting | Streamlit Community Cloud (free) |
| Source Control | GitHub repository |
| Python Version | 3.10+ |
| Memory | 1GB (sufficient with optimizations) |
| Storage | Session-based only |
- Push code to GitHub repository
- Go to share.streamlit.io
- Connect GitHub account
- Select repository and branch
- Set main file to app.py
- Click Deploy
[theme]
primaryColor = "#2C5F8A"
backgroundColor = "#E8F1F8"
secondaryBackgroundColor = "#FFFFFF"
textColor = "#0A2647"
font = "sans serif"
[server]
maxUploadSize = 10
enableXsrfProtection = true
enableCORS = false
[browser]
gatherUsageStats = false
[runner]
magicEnabled = false
installTracer = false# .streamlit/secrets.toml
# Optional - only for AI Chat feature
GROQ_API_KEY = "your_groq_api_key_here"
# Optional - disable telemetry
STREAMLIT_TELEMETRY = "false"| Component | Minimum | Recommended |
|---|---|---|
| RAM | 4GB | 8GB |
| Storage | 1GB free | 2GB free |
| CPU | Any modern CPU | Intel i5 / Ryzen 5 |
| OS | Windows, Mac, Linux | Any |
- Clone repository
- Create virtual environment
- Install dependencies
- Download SpaCy model
- Run streamlit run app.py
| Differentiator | KontractIQ | Competitors |
|---|---|---|
| Cross-Contract Numeric Detection | ✅ | ❌ |
| Session Feedback with Export/Import | ✅ | ❌ |
| "Show Me the Norm" Feature | ✅ | Limited |
| Local/Session Deployment | ✅ | No (or expensive) |
| Template Rule-Based Warnings | ✅ | No |
| Scanned PDF Detection | ✅ | Varies |
| Demo Mode | ✅ | No |
| Open Source | ✅ | No |
| Zero Financial Cost | ✅ | No |
| Works on Streamlit Cloud 1GB | ✅ | N/A |
Most tools analyze one contract in isolation. KontractIQ finds payment term, liability cap, and notice period conflicts across your entire contract portfolio.
Your risk preferences aren't lost between sessions. Download your rules as JSON and reuse them anytime.
Instantly see the most common term across your contracts. Identify which contracts deviate from your portfolio norm.
No database required. Privacy-focused with no permanent storage. Deploys anywhere with zero infrastructure.
Test all features without uploading files. Perfect for evaluation and demonstrations.
| Aspect | KontractIQ | Evisort | Kira | Ironclad |
|---|---|---|---|---|
| Price | $0 | $50k+/year | $42k+/year | $30k+/year |
| Cross-Contract (Numeric) | ✅ | ❌ | ❌ | ❌ |
| Session Learning | ✅ | ❌ | ❌ | ❌ |
| Local/Session Deployment | ✅ | ❌ | $$$ | ❌ |
| Open Source | ✅ | ❌ | ❌ | ❌ |
| Works in 1GB Memory | ✅ | ❌ | ❌ | ❌ |
| Demo Mode | ✅ | ❌ | ❌ | ❌ |
KontractIQ vs Evisort: Evisort charges $50,000+ per year. KontractIQ provides cross-contract numeric detection, session learning, local deployment, open source, and demo mode - all features Evisort lacks. KontractIQ works within 1GB memory, while Evisort requires enterprise infrastructure.
KontractIQ vs Kira: Kira Systems costs $42,000+ per year. Kira lacks cross-contract numeric detection, session learning, and local deployment. KontractIQ offers all these capabilities for free.
KontractIQ vs Ironclad: Ironclad charges $30,000+ per year. KontractIQ provides superior analysis capabilities with cross-contract inconsistency detection, active learning, and professional reporting.
| Aspect | KontractIQ | ClauseGuard | PAKTON | RAG Analyzer |
|---|---|---|---|---|
| Price | $0 | Subscription | $0 | $0 |
| Cross-Contract (Numeric) | ✅ | ❌ | ❌ | ❌ |
| Multi-Contract | ✅ | ❌ | ❌ | ❌ |
| Version Compare | ✅ | ❌ | ❌ | ❌ |
| Templates | ✅ | ❌ | ❌ | ❌ |
| Reports | ✅ | ❌ | ❌ | ❌ |
| Production Ready | ✅ | ✅ | ❌ | ❌ |
| Demo Mode | ✅ | ❌ | ❌ | ❌ |
KontractIQ vs ClauseGuard: ClauseGuard is a subscription-based tool with limited free tier. KontractIQ provides all features completely free. ClauseGuard lacks cross-contract numeric detection, multi-contract analysis, version comparison, templates, and professional reports.
KontractIQ vs PAKTON: PAKTON is open source but limited to basic contract extraction. KontractIQ provides comprehensive intelligence with 12 features, 15 pages, and professional reporting.
KontractIQ vs RAG Analyzer: RAG Analyzer is experimental and not production-ready. KontractIQ is fully production-ready with comprehensive features.
| Enhancement | Priority |
|---|---|
| 5 more clause types (13 total) | High |
| Risk trend over time (with import history) | High |
| PDF OCR support (Tesseract) | Medium |
| Custom user templates | Medium |
| Batch export all contracts as ZIP | Low |
5 More Clause Types: Expanding to 13 clause types will capture more contract provisions. Planned additions include assignment, entire agreement, severability, waivers, and amendment clauses.
Risk Trend Over Time: With import history tracking, users will see how risk profiles change over time. This enables trend analysis and remediation tracking.
PDF OCR Support: Integration with Tesseract OCR will enable processing of scanned PDFs. This removes the biggest limitation for users with legacy scanned contract archives.
| Enhancement | Priority |
|---|---|
| Optional sentence-transformers | Medium |
| Anonymous peer comparison | Medium |
| Team collaboration | Medium |
| API access for programmatic use | Low |
| Mobile app | Low |
Optional Sentence-Transformers: User-opt-in for more advanced semantic search. Provides better relevance for complex queries while maintaining the option for lightweight operation.
Anonymous Peer Comparison: Opt-in data sharing for anonymous benchmarking. Organizations can compare their contract terms to industry peers.
Team Collaboration: Shared sessions for team analysis. Multiple users can work on the same contract portfolio simultaneously.
| Metric | Value |
|---|---|
| Clause Types Extracted (Phase 1) | 8 |
| Pages in App | 15 |
| Report Types | 4 |
| Risk Severity Levels | 4 |
| File Types Supported | 3 (PDF, DOCX, TXT) |
| Max Contracts Per Session | 20 |
| Max File Size | 10MB |
| Search Methods | 3 (TF-IDF, BM25, Metadata) |
| Contract Templates | 6 |
| Quick Search Queries | 8 |
| Metric | Value |
|---|---|
| Memory Usage | <800MB (fits in 1GB) |
| Processing Time | <5 seconds per contract |
| Search Speed | <1 second for 20 contracts |
| Report Generation | <10 seconds for full analysis |
| Component | Lines of Code |
|---|---|
| Core Modules | ~3,000 |
| Pages | ~5,000 |
| Components | ~1,500 |
| Models | ~800 |
| Utilities | ~700 |
| Total | ~11,000 |
| USP | Description |
|---|---|
| Cross-Contract Numeric Detection | Detects payment term, liability cap, notice period conflicts |
| Session Learning with Export | Your risk rules exportable/importable |
| Zero Financial Cost | Enterprise features at $0 |
| Open Source | No vendor lock-in |
| Professional Reports | PDF and HTML with branding |
| Beautiful UI | White and blue theme |
| Streamlit Deployable | Fits in 1GB memory |
| Demo Mode | Try instantly without uploading |
Navigate to Upload Contracts and upload your PDF, DOCX, or TXT files. Use batch upload for efficiency. The system will parse and extract text automatically.
View key metrics on the Dashboard. Understand your contract portfolio health at a glance. Use quick actions for common tasks.
Use Search to find specific clauses across all contracts. Filter results by contract, file type, or clause type. Export findings for offline analysis.
Analyze all contracts for inconsistencies. Review payment term, liability cap, and notice period variations. Identify deviations from portfolio norms.
Run RiskScan to identify high-risk clauses. Review findings by severity. Adjust severity levels as needed. Export risk rules for team sharing.
Create professional reports for stakeholders. Choose from 4 report types. Export as PDF or HTML for distribution.
- Upload 5-10 contracts at a time for best results
- Use text-based PDFs rather than scanned documents
- Name contracts clearly for easy identification
- Run CrossCheck after uploading all contracts
- Export risk rules for team consistency
- Review critical risks immediately
- Address high risks within 7 days
- Monitor medium risks monthly
- Track low risks quarterly
- Export rules to share with team
- Use Full Analysis for comprehensive reviews
- Use Risk Summary for executive updates
- Use Clause Comparison for standardization
- Use Executive Summary for board presentations
- Start with a template for consistency
- Review all warnings before finalizing
- Use smart defaults as starting points
- Export as DOCX for professional formatting
- Save templates for team use
| Tip | Description |
|---|---|
| 💡 | Upload multiple contracts at once for cross-contract analysis |
| 🎯 | Use the Search feature to find specific clauses across all contracts |
| Run RiskScan to identify high-risk clauses automatically | |
| 📊 | Generate professional reports for stakeholders and compliance |
| 🎮 | Load demo data to explore all features without uploading |
| 🔒 | Your data stays private - all processing is session-based |
| 📈 | Check System Metrics to monitor memory usage and performance |
Issue: PDF appears scanned
- Solution: Use text-based PDFs or upload as DOCX/TXT
- Detection: System automatically detects scanned PDFs
Issue: Memory limit reached
- Solution: Reduce number of contracts or contract size
- Detection: System Metrics page shows memory usage
Issue: Search returns no results
- Solution: Try different keywords or broader query
- Tip: Use quotes for exact phrases
Issue: RiskScan shows no risks
- Solution: Check risk rules configuration
- Tip: Add custom rules for specific risks
KontractIQ represents a significant advancement in contract intelligence technology. It combines enterprise-grade capabilities with complete accessibility, providing professional contract analysis tools to organizations of all sizes. The platform's 12 core features, 15 intuitive pages, and comprehensive reporting capabilities deliver value across legal, procurement, compliance, and business teams.
The platform demonstrates sophisticated technical architecture with optimized memory usage, efficient algorithms, and robust error handling. The hybrid search engine combining TF-IDF and BM25 provides enterprise-grade search capabilities. The cross-contract inconsistency detection engine reveals insights that manual review cannot identify.
The professional white and blue theme with complete design system delivers premium user experience. Consistent typography, spacing, colors, and interactions create a polished, professional application suitable for enterprise use.
Organizations can analyze contracts faster than manual review, detect inconsistencies across their portfolio, compare versions intelligently, and generate professional reports for stakeholders. The platform's zero-cost model democratizes contract intelligence, making it accessible to organizations of all sizes.
KontractIQ uniquely combines cross-contract numeric detection, active learning, session-based deployment, and zero financial cost. This combination of features is unmatched in both commercial and open-source alternatives.
KontractIQ is a production-ready, deployable contract intelligence platform built for Streamlit Community Cloud with zero financial cost. It helps legal, procurement, compliance, and business teams analyze contracts faster than manual review.
Unlike traditional tools that analyze one document in isolation, KontractIQ detects numeric and date inconsistencies across multiple contracts, provides rule-based AI, and generates professional branded reports.
The platform handles 20 contracts per session with 10MB file size limits, all within 1GB memory. It extracts 8 clause types, provides hybrid search, intelligent comparison, cross-contract inconsistency detection, risk scanning with active learning, and professional reporting.
With 15 pages and 12 core features, it provides comprehensive contract intelligence capabilities previously only available to large enterprises with significant budgets.
KontractIQ represents the future of contract intelligence: powerful, accessible, and free. It delivers on its core promise of "Intelligence for every clause" through thoughtful design, sophisticated technology, and unwavering commitment to user value.
| Aspect | Summary |
|---|---|
| Name | KontractIQ |
| Tagline | "Intelligence for every clause." |
| Type | Contract Intelligence Platform |
| Price | $0 (100% free) |
| Deployment | Streamlit Cloud (1-click) |
| Open Source | Yes |
| Core Features | 12 features |
| Pages | 15 pages (grouped navigation) |
| Report Formats | PDF and HTML with branded footer |
| API Required | Optional (only for AI Chat) |
| Memory Usage | <800MB (fits in 1GB) |
| Clause Types | 8 (Phase 1), more coming |
| Contract Templates | 6 |
| Risk Severity Levels | 4 |
| File Types Supported | 3 (PDF, DOCX, TXT) |
| Max Contracts Per Session | 20 |
| Max File Size | 10MB |
| Search Methods | 3 (TF-IDF, BM25, Metadata) |
| Aspect | Details |
|---|---|
| Developer | Hassan Subhani |
| hassansubhani822@gmail.com | |
| GitHub | @Hassan0397 |
| itshassansubhani |
- Streamlit for the amazing framework
- Groq for free AI API access
- All open-source libraries used in this project
- The legal and procurement professionals who inspired this tool
This project is licensed under the MIT License.
MIT License
Copyright (c) 2026 KontractIQ
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This app is Built by Hassan Subhani