Back to Portfolio

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.

Source IngestionEntity ResolutionRisk ScoringRAG & AgentExternal API Verification

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:

How it works

Casefile unifies claim data, resolves linkages, computes risk deterministically, and answers questions with grounded evidence. Every decision is auditable.

  1. 01Ingest claim records from five disagreeing internal systems into a unified data model, seeded with known-good claims.
  2. 02Resolve entity linkages across sources with measured precision, recall, and false-merge rates, routing low-confidence matches to a human review queue.
  3. 03Compute a deterministic, rule-based risk score for every claim in code, with per-merge audit records explaining every decision.
  4. 04Build a grounded RAG layer: an agent orchestrates over deterministic core, answers investigator questions with cited evidence and policy documents, never invents claims.
  5. 05Verify location data against a live geocoding API (Geocodio) with real authentication, retries, and circuit-breaking for production reliability.
  6. 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.

Data Ingestion Layer

Pull claims from five internal systems with conflicting schemas.

Converts each source into a canonical record type; seeded defects caught.

Entity Resolution

Link records across sources with measured blocking, matching, and review.

Precision, recall, and false-merge rate tracked. Low-confidence links stay unresolved.

Deterministic Risk Scoring

Compute rule-based risk per claim without ML black boxes.

Every score is explainable. Per-merge audit trail shows scoring logic.

RAG & Agent Layer

Orchestrate over deterministic core, answer questions with policy citations.

Agent never hallucinates. All answers traced back to adjuster notes and policy docs.

External API Integration

Verify location details against live Geocodio with auth, retries, circuit-breaking.

Idempotent writes. Every external API call proven across forced re-runs.

Security & Deployment

Deploy with broken-deploy drill, adversarial testing, PII redaction.

Security posture includes what Casefile is architecturally incapable of.

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

PythonFastAPILangChainOpenAIPineconeGeocodio APIReactTerraformPostgreSQL

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.