Complete Build · Discovery to Deployment
Casefile
Investigation Copilot
An end-to-end build showcasing the full discovery-to-delivery motion: ingesting claims from five disagreeing data sources, resolving entities with measured accuracy, computing deterministic risk scores, answering investigator questions with cited evidence, verifying against live external APIs, and deploying with production-grade security.
Status: In Progress
A complete 10-phase build tutorial demonstrating discovery-brief through live rehearsal. Uses synthetic claim data; no real customer or PII data in any phase.
The problem
Insurance claim investigation is a multi-day, manual process. Claim data lives in five disagreeing internal systems (billing, medical, property, liability, fraud detection). Investigators must:
- •Manually look up the same claim across systems and reconcile contradictions
- •Check location details by hand against maps and weather databases
- •Compute risk by reading policies and guidelines, prone to inconsistency
- •Answer follow-up questions by re-digging through the same records
How it works
Casefile unifies claim data, resolves linkages, computes risk deterministically, and answers questions with grounded evidence. Every decision is auditable.
- 01Ingest claim records from five disagreeing internal systems into a unified data model, seeded with known-good claims.
- 02Resolve entity linkages across sources with measured precision, recall, and false-merge rates, routing low-confidence matches to a human review queue.
- 03Compute a deterministic, rule-based risk score for every claim in code, with per-merge audit records explaining every decision.
- 04Build a grounded RAG layer: an agent orchestrates over deterministic core, answers investigator questions with cited evidence and policy documents, never invents claims.
- 05Verify location data against a live geocoding API (Geocodio) with real authentication, retries, and circuit-breaking for production reliability.
- 06Deploy to a real URL with CI/CD, security hardening, PII redaction in logs, encryption, and adversarial testing that names what Casefile is architecturally incapable of doing.
Architecture
Python backend with FastAPI, LangChain for orchestration, deterministic risk logic, RAG over policy documents, external API integration with Geocodio, and React frontend for investigator workflows.
Why deterministic risk scoring
Machine learning models are fast but inscrutable; investigators need to understand why a claim scored high. Casefile uses rule-based scoring: policy rules (age limits, coverage verification) map directly to risk. Every score is explainable because the logic is code, not weights in a neural network.
The tradeoff is effort: building comprehensive rules takes more upfront work than feeding data to an ML pipeline. But in regulated insurance, explainability beats accuracy.
What I'd do for production
Casefile is end-to-end but not production-hardened; the build tutorial emphasizes judgment and trade-offs, not perfection.
Blocking & matching evaluation
Labeled dataset of claim pairs (should-match / should-not-match) to catch regressions when adding sources or rule changes.
Score calibration
Validate risk scores against real investigator decisions and case outcomes, recalibrate rules to match ground truth.
Query classification
Route questions to the right sub-system: entity lookups, policy checks, score justification, or conversational context.
Conversational memory
Multi-turn dialogue over a single claim, so investigators can ask follow-up questions in context.
Audit trail completeness
Ensure every field, score, and decision is auditable to a source, timestamp, and user for compliance.
Stack
See the full build
The complete tutorial walks through all 10 phases: discovery brief, data ingestion, entity resolution, risk scoring, RAG layer, external API integration, deployment, security, technical communication, and live rehearsal.