Case studyIncome-protection insuranceQ4 2025 · 2 monthsReact + FastAPI

OptimAssur

Intelligent analysis and comparison of income-protection insurance contracts

A specialized focus on spinal coverage (back pain, herniated discs) and psychiatric coverage (depression, burnout, anxiety disorders) — the most underestimated conditions in income-protection contracts.

Discuss a similar project

Réponse courte

OptimAssur is a platform for automated analysis of income-protection insurance contracts developed by Digit-AI. It extracts text from PDFs through a 3-tier OCR pipeline (Mistral OCR, pdfplumber, Tesseract), then analyzes each contract with Claude AI to produce specialized scoring from 1 to 10 on spinal and psychiatric coverage. The result: a structured, reproducible comparison in under 30 seconds per contract, versus 30 to 60 minutes of manual reading (−98%).

Context

Context & Challenges

An opaque market and a complex comparison

Income-protection insurance contracts are dense documents (50-200 pages), written in complex legal language. Coverage for spinal and psychiatric conditions — even though they are among the leading causes of work absence in France — is often poorly documented or buried in the exclusions.

!

Complex and heterogeneous documents

PDFs of 50 to 200 pages in varied formats: native text, scans, nested tables. No standardized structure across insurers.

!

Opaque coverage

Spinal and psychiatric guarantees are buried in the general terms, with exclusions and limitations that are hard to identify.

!

Time-consuming manual comparison

Brokers spend hours reading and comparing contracts line by line, with a high risk of oversight or misinterpretation.

!

Subjective assessment

Without a dedicated tool, the quality of coverage depends on the analyst's experience. No standardized scoring exists for these conditions.

Functional scope

Insurance brokers, individuals looking for income protection. Covered processes: PDF contract import, automatic text extraction, structured AI analysis, specialized scoring, multi-contract and line-by-line comparison, PDF/Excel export.

Technical constraints

Support for scanned (OCR) and native PDFs · Max size ~50 MB per file · Binary storage in the database · 50,000-character limit per submission to Claude · Containerized Docker deployment, compatible with Railway and on-premise.

Objectives

Objectives & Scope

Three strategic pillars, each tied to measured KPIs

Strategic objective

Give brokers and individuals an objective comparison tool for income-protection contracts, with a unique focus on spinal and psychiatric conditions.

Spinal + psych focusScoring 1-10Comparison of N contracts

Operational objective

Automate contract extraction and analysis to cut study time from 30-60 minutes to under 30 seconds, with a smart cache for repeat lookups.

Analysis < 30 sCache < 1 sReal-time SSE

Technical objective

Deploy a multi-tier PDF extraction pipeline able to handle all document formats, with a containerized architecture and a database caching system.

3-tier OCRDocker + RailwayCascade cache
Stack

Tech Stack

A 3-tier OCR pipeline with Claude AI analysis and multi-format export

Frontend

React 18Vite 5Tailwind CSS 3AxiosLucide ReactReact Markdown

Backend

FastAPIPython 3.11SQLAlchemy 2Pydantic 2Uvicorn

AI & OCR

Claude API (Anthropic)Mistral OCRpdfplumberTesseract OCR

Database

PostgreSQL 15

Infrastructure

DockerDocker ComposeRailwayNginx

Export

ReportLab (PDF)openpyxl (Excel)

Differentiating pattern — 3-tier PDF extraction: Mistral OCR is used first for its ability to preserve table structure. If unavailable or if the extracted text is insufficient (< 100 characters), the system falls back to pdfplumber (native-text PDFs), then to Tesseract OCR (scanned PDFs) as a last resort. No document stays unreadable.

Architecture

Technical Architecture

Application-level overview and detailed analysis pipeline

APPLICATION ARCHITECTURE — OPTIMASSURUSERWeb browser — Broker / IndividualHTTPSFRONTEND — React 18 + Vite 5Document ListSpinal / psych scoresDocument DetailSummary, coverageComparisonGlobal N docs, lineDrop ZoneDrag & drop, multiProgressReal-time SSE trackingCoverageTable, scoresReactViteTailwindAxiosREST API + SSEBACKEND — FastAPI + Python 3.11API Router — /api/documents/*List docsUpload multiAnalyzeAnalyze allCompareCompare linesDownloadPDF ServiceMulti-level text extractionpdfplumberTesseractMistral OCRClaude ServiceAI analysis and comparisonExtractionScoringJSON repairExport ServicePDF and Excel reportsReportLabopenpyxlClaude API (Anthropic)External APIMistral API (optional)External APISQLAlchemy ORMDATABASE — PostgreSQL 15documentsanalysescoverage_rowscomparisonsline_by_line_comp
Results

Results & Impact

Measured gains across the entire income-protection contract analysis cycle

< 30 s
Full analysis
Per PDF contract
< 1 s
Cache return
Repeat lookups
3 tiers
OCR pipeline
Automatic fallback
1–10
Specialized scoring
Spinal & psychiatric
CriterionBefore (manual)With OptimAssurGain
Analysis time per contract30 to 60 minutesUnder 30 seconds~98% reduction
Comparison of 5 contracts2 to 4 hoursUnder 2 minutes~98% reduction
Spinal coverage detectionFull contract readingAutomatic scoring 1-10Standardized
Psychiatric coverage detectionExpertise requiredAutomatic scoring 1-10Standardized
Coverage extractionManual copy-pasteAutomatic structured extractionAutomated
Comparison consistencyVaries by analystStandardized by AIReproducible

Qualitative gains

💡

Accuracy

Exhaustive extraction of clauses, conditions, deductibles and exclusions through Claude AI analysis with automatic JSON repair.

🧠

Specialization

A unique focus on spinal and psychiatric conditions — the most underestimated coverage in French income-protection contracts.

Transparency

Objective, reproducible scoring from 1 to 10, with a detailed markdown summary and color coding (green, yellow, red).

🚀

Productivity

Batch analysis with real-time progress (SSE), smart database caching, one-click PDF and Excel export.

🔒

Reliability

A 3-tier OCR pipeline with automatic fallback. No document stays unreadable, even poor-quality scans.

🎨

Easy adoption

Modern React interface with drag & drop, embedded PDF viewer, coverage tables and interactive comparisons.

Let's start by talking it through

No aggressive sales pitch. No 12-step form. Just 30 minutes to understand your situation and see if we can help. First conversation free, no strings attached.