📜 My Contract Whisperer - Hackathon Pitch
Inspiration
“Every day, millions of people sign contracts they barely understand.”
Job offers. Freelance deals. NDAs. Rental agreements. All filled with complex legal terms that can hide risks, omissions, and obligations — and most of us just… sign and hope for the best.
That’s where My Contract Whisperer comes in. It’s a privacy-first AI assistant that helps you truly understand any contract — right in your browser. Using Chrome’s built-in AI APIs, it analyzes your document locally, so nothing ever leaves your device. It then gives you a clear summary of risks, obligations, missing clauses, and even drafts polite questions you can send back to the other party.
In our demo story, Sam — an ordinary job seeker — turns anxiety into empowerment thanks to My Contract Whisperer. It’s not just about reading contracts; it’s about restoring trust and confidence in digital agreements.
Our mission is simple: To make “understanding before you sign” a universal right, not a privilege.
What it does
My Contract Whisperer is an AI-powered contract analysis application that transforms complex legal documents into clear, actionable insights—all processed 100% locally on your device.
Core Capabilities:
🔍 Intelligent Contract Analysis
- Extracts key risks (High/Medium/Low severity)
- Identifies missing clauses and potential gaps
- Lists party-specific obligations and responsibilities
- Generates relevant questions for contract negotiation
🎯 Perspective-Based Insights
- Automatically detects parties in contracts (employer/employee, landlord/tenant, etc.)
- Filters obligations from the user's perspective
- Supports dual-perspective mode to see both parties' obligations
🌐 Multi-Language Support
- Detects contract language automatically
- Compares with user's preferred language
- Translates analysis results in real-time across multiple languages
- Full RTL (Right-to-Left) support for Arabic and other RTL languages
✏️ Professional Email Drafting
- Generates professional emails with suggested questions
- Customizable tone (formal, friendly, assertive) and length (concise, detailed)
- Helps users communicate effectively with contract providers
💾 Complete Privacy & Offline Capability
- All AI processing runs on-device using Chrome's Gemini Nano
- Works completely offline after initial model download
- Zero data transmission—contracts never leave your device
How we built it
Technology Stack and Architecture
- Frontend: Angular 20.2 with standalone components, signals, and zoneless architecture
- State Management: Signal-based stores for reactive, performant state
- Styling: Tailwind CSS v4 for modern, responsive design
- AI Engine: Chrome Built-in AI APIs powered by Gemini Nano
- Service Worker: Angular Service Worker for offline PWA capabilities
┌────────────────────────────────────────────────────────┐
│ Contract Whisperer Architecture │
├────────────────────────────────────────────────────────┤
│ │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ UI Layer │───▶│ Store Layer │ │
│ │ (Angular) │ │ (NgRx Signals)│ │
│ └──────────────┘ └──────────────┘ │
│ │ │ │
│ │ ▼ │
│ │ ┌──────────────────────┐ │
│ │ │ Service Layer │ │
│ │ │ - Contract Parser │ │
│ │ │ - AI Orchestrator │ │
│ │ │ - Translation Cache │ │
│ │ └──────────────────────┘ │
│ │ │ │
│ │ ▼ │
│ │ ┌──────────────────────────────┐ │
│ │ │ Chrome Built-in AI APIs │ │
│ └───▶│ - Prompt API (Risks, │ │
│ │ Obligations, Omissions,..)│ │
│ │ - Summarizer API │ │
│ │ (Quick Take Summary) │ │
│ │ - Translator API │ │
│ │ - Writer/Rewriter API │ │
│ │ (Email Drafting) │ │
│ │ - Language Detector API │ │
│ └──────────────────────────────┘ │
│ │
│ All processing happens locally on-device │
│ No external API calls, complete privacy │
└────────────────────────────────────────────────────────┘
Chrome AI API Integration
We leverage 6 powerful Chrome Built-in AI APIs working in harmony:
- Prompt API - Extracts risks, obligations, omissions, and questions from contracts
- Summarizer API - Generates the "Quick Take" summary
- Translator API - Real-time translation across multiple languages
- Writer/Rewriter API - Drafts professional emails with customizable tone and length
- Language Detector API - Detects contract language and compares with user preferences
Architecture Highlights
- Progressive Loading: Results stream in incrementally as AI processes the contract
- Smart Caching: Translated results cached locally for instant switching and improved performance
- Error Recovery: Automatic retry with exponential backoff
- Optimistic UI: Immediate feedback while processing in background
Key Implementation Details
- Party Detection & Role Selection: Built intelligent extraction logic that identifies parties from contract text and allows users to select their perspective
- Multi-Language Workflow: Implemented sophisticated language detection → translation pipeline with caching to minimize redundant API calls
- Progressive Analysis: Designed a streaming architecture where different contract sections (risks, obligations, omissions) load progressively for better UX
- Translation Caching: Created a smart caching layer that stores translated analysis results, allowing instant language switching without reprocessing
Challenges we ran into
1. Navigating New Chrome AI APIs
The Chrome Built-in AI APIs are cutting-edge and relatively new, with limited documentation and community examples. We spent significant time:
- Understanding API availability and compatibility
- Testing different language pairs with Translator API, to end up with 'en' first input language strategy to make sure it works for all languages.
- Optimizing prompts for Prompt API to get consistent, structured outputs
- Handling edge cases when APIs weren't available on certain systems
- Implementing retry strategy: Even with JSON schemas provided to the Prompt API, sometimes the returned JSON objects were invalid or malformed. We implemented a robust 3-retry strategy with exponential backoff to handle these cases and ensure reliable data extraction
- Coordinating multiple APIs: Having 6 different Chrome AI APIs (Prompt, Summarizer, Translator, Writer/Rewriter, Language Detector) working together significantly increased complexity. Each API has different response formats, error handling patterns, and availability requirements. Orchestrating them to work seamlessly while maintaining offline capability and proper error handling was a major architectural challenge
2. Offline-First Architecture
Building a fully offline-capable application while maintaining excellent UX was challenging:
- Managing model download progress and user feedback
- Implementing smart caching strategies for translated results
- Handling cases where the model wasn't available yet
- Creating graceful degradation when AI features were unavailable
- Service Worker Limitations: Unfortunately, Chrome AI APIs cannot be called from service workers, which limits our ability to process contracts in the background. For long contracts, this impacts performance significantly as all processing must happen on the main thread. For this MVP version, we've focused on contracts of moderate length, accepting this limitation while planning for future improvements
3. Language Detection & Translation Complexity
Multi-language support required sophisticated logic:
- Detecting contract language accurately from various document formats
- Comparing detected language with user preferences
- Handling cases where translation wasn't available for certain language pairs
- Implementing RTL layout support for Arabic and other RTL languages
4. State Management at Scale
Managing complex state with signals across multiple stores required careful architecture:
- Coordinating contract parsing, analysis, translation, and caching
- Handling progressive loading states
- Managing error states and recovery across multiple async operations
- Ensuring UI stays responsive during heavy AI processing
5. User Experience Flow
Designing an intuitive onboarding flow was tricky:
- Balancing information (language selection, party selection) without overwhelming users
- Handling contract upload → analysis → perspective selection → results display flow
- Creating clear error messages
6. Error Handling & Edge Cases
- What happens if a contract has no clear parties?
- How to handle contracts that are too large?
- Managing translation failures gracefully
- Providing helpful messages when Chrome AI isn't available on user's system
Accomplishments that we're proud of
🏆 Technical Achievements
First-Class Chrome AI Integration: Successfully integrated 6 different Chrome AI APIs working together seamlessly, creating one of the first comprehensive applications using these cutting-edge technologies
100% Local Processing: Built a fully offline-capable application where all AI operations run on-device—a true privacy-first solution that demonstrates the power of on-device AI
Smart Progressive Loading: Implemented a streaming architecture where users see results as they're generated, dramatically improving perceived performance
Robust Error Handling: Built a comprehensive retry mechanism (3 attempts with exponential backoff) to handle invalid JSON responses from AI APIs, ensuring reliability even when schemas don't guarantee valid outputs
Multi-Language Excellence: Created a sophisticated language detection and translation system that works across 8+ languages with proper RTL support
Beautiful, Responsive UI: Designed and built a modern interface that works flawlessly on desktop with dark mode support
🎯 User Experience Wins
Intuitive Onboarding: Created a smooth flow from contract upload → language detection → party selection → analysis results
Clear Communication: Fixed error messages to show human-readable language names instead of codes, making the app more user-friendly
Professional Email Generation: Built a feature that helps users communicate effectively with contract providers, turning analysis into action
🚀 Innovation Highlights
Perspective-Based Analysis: First-of-its-kind contract analysis that adapts to user's role (employee, tenant, client, etc.)
Privacy by Default: Demonstrated that powerful AI features can work completely offline without compromising functionality
Real-World Problem Solving: Created a tool that solves a genuine, widespread problem affecting millions of people
What we learned
Technical Learnings
Chrome AI APIs are Powerful: Working with Chrome's Built-in AI APIs opened our eyes to the future of on-device AI. The ability to run sophisticated language models locally while maintaining privacy is game-changing.
Schema Validation Isn't Guaranteed: Even when providing JSON schemas to the Prompt API, we learned that AI outputs can still be invalid. This taught us the importance of robust error handling, retry strategies, and validation at the application level.
Signal-Based State Management: Deep dive into Angular signals and signal-based stores taught us how reactive programming can simplify complex state management while improving performance.
Offline-First Architecture: Learned the importance of progressive enhancement and graceful degradation when building apps that work offline.
Multi-Language UX: Discovered the complexity of building truly international applications—from RTL support to translation caching strategies.
Progressive Loading Patterns: Implemented streaming data patterns that dramatically improve user experience, especially for AI-powered features that take time to process.
Retry Logic is Essential: Building a 3-retry strategy with exponential backoff for AI API calls taught us that reliability in AI applications requires expecting failures and gracefully handling them.
General-Purpose AI Can Deliver Domain-Specific Results: Working with Gemini Nano—a general-purpose language model not specifically fine-tuned for legal or contract law—we discovered that well-crafted prompts and careful orchestration can produce impressive, actionable results. However, this experience highlighted an exciting future possibility: a fine-tuned legal AI model that considers jurisdiction-specific nuances could be transformative. Legal terminology, clause interpretations, and even risk assessments vary significantly across countries and legal systems. A model trained specifically on contract law across different jurisdictions could provide even more accurate, culturally-aware, and legally-relevant analysis—turning contract understanding from impressive to truly expert-level.
Product & UX Learnings
Error Messages Matter: Small details like showing "العربية" instead of "ar" make a huge difference in user experience and trust.
Transparency Builds Trust: Being upfront about first-time model download (requiring internet) and explaining what's happening builds user confidence.
Visual Feedback is Critical: During long-running AI operations, clear progress indicators and loading states keep users engaged.
Development Process Learnings
Documentation is Essential: When working with new APIs, thorough documentation and clear examples save hours of debugging.
Test Early, Test Often: Testing Chrome AI APIs across different systems and configurations early prevented major issues later.
User Feedback is Invaluable: Features like email drafting came from thinking about what users actually need after analysis—not just what's technically impressive.
AI-Powered Knowledge Management: NotebookLM proved to be an indispensable tool for this project—an AI-powered knowledge management system that became a game-changer for learning and integrating Chrome AI APIs. By actively using NotebookLM to build a comprehensive "database" of knowledge about all the APIs, documentation, examples, and best practices in one centralized location, we transformed what could have been months of scattered research into an organized, accessible knowledge base. This approach was crucial in enabling us to build a sophisticated application integrating 6 different Chrome AI APIs while managing a full-time job and other commitments—demonstrating how the right AI tools can amplify productivity and accelerate complex projects. NotebookLM didn't just store information; it helped synthesize and connect concepts, turning fragmented documentation into actionable insights that directly informed our implementation strategy.
What's next for My Contract Whisperer
Short-Term Enhancements
Multimodal Contract Analysis: Support for image-based contracts using multimodal Prompt API capabilities, allowing users to upload contract photos or scanned documents directly
Multi-Party Contract Support: Extend analysis capabilities to handle contracts with more than two parties (currently supports two-party contracts)
Specialized Contract Types: Add support for wills, trusts, and other specialized legal documents that require domain-specific understanding
Export Functionality: Allow users to export analysis reports as PDFs with highlights and annotations
Contract Comparison: Enable side-by-side comparison of contract versions or similar contracts
Notification System: Remind users about important dates, obligations, and renewal deadlines from their contracts
Medium-Term Vision
Long Contract Support via Chunking Strategy: Implement a sophisticated chunking strategy to analyze very long contracts by processing them in segments. This will be particularly challenging as we need to maintain context across chunks, merge results intelligently, and ensure that risks and obligations are identified across the entire document—not just individual segments. This addresses the current MVP limitation where very long contracts aren't supported.
Conversational Q&A Interface: Build a chat interface where users can ask questions about their contract in natural language (future feature using Prompt API)
Contract Redlining: Allow users to suggest edits and generate a redlined version for negotiation
Team Collaboration: Enable sharing analysis with colleagues or lawyers while maintaining privacy
Contract Repository: Secure local storage for multiple contracts with search and filtering
AI-Powered Negotiation Assistant: Generate counter-proposals based on identified risks and market standards
Long-Term Aspirations
Legal Compliance Checking: Verify contracts against regional laws and regulations
Risk Scoring Algorithm: Machine learning model trained on contract outcomes to provide predictive risk assessment
Integration Ecosystem: Connect with contract management systems, e-signature platforms, and legal databases
Enterprise Version: Multi-user workspace for legal teams and organizations
Community Features: Anonymous contract insights database (privacy-preserving) to help users understand market norms
Technical Roadmap
Comprehensive Testing Suite: Implement unit tests, integration tests, and end-to-end tests to ensure reliability and maintainability as the codebase grows
Performance Optimization: Further optimize AI processing speed and reduce memory footprint
Expanded Language Support: Add more languages as Chrome Translator API support expands
Advanced Caching: Implement more sophisticated caching strategies for better offline experience
Open Source Community: Encourage contributions and build a community around privacy-first contract analysis
Closing Statement
My Contract Whisperer represents our vision of making legal document analysis accessible to everyone while respecting privacy and enabling complete offline functionality. By harnessing the power of Chrome's Built-in AI APIs, we've created a tool that demonstrates what's possible when cutting-edge technology meets real-world problems.
We're proud to have built something that:
- ✅ Solves a genuine problem affecting millions
- ✅ Respects user privacy completely
- ✅ Works entirely offline
- ✅ Uses the latest AI technology responsibly
- ✅ Provides a beautiful, intuitive user experience
We believe the future of AI applications lies in on-device processing that empowers users without compromising their data. My Contract Whisperer is our contribution to that future.
Built with ❤️ for future users.
Built With
- angular.js
- chrome
- language-detector
- prompt
- rewriter
- summarizer
- translator
- writer
Log in or sign up for Devpost to join the conversation.