Preparing your design workspace

Loading the problem and your latest saved attempt…

Design an Insurance Claims RAG Agent

Process claim emails and PDFs into evidence-backed approval or denial outcomes while controlling model costs and recovering from failures.

Problem statement

For this exercise, assume one insurer receives claim emails with PDF attachments. Build a backend agent that extracts claim facts, retrieves relevant policy information, and produces an approval or denial with an explanation tied to the evidence.

The insurer supplies a service that resolves the applicable immutable customer-policy snapshot and a small set of coverage rules; designing those business rules is outside this exercise. Accepted claims and their documents are immutable.

Missing, conflicting, unsupported, or unreadable evidence must lead to a review-required outcome rather than a guessed decision. An authorized claims reviewer can read processing status, the outcome, cited document passages, and the policy snapshot used.

Duplicate delivery of the same email must refer to the same claim and must not create a second decision. A model failure must not lose an accepted claim. Control LLM tokens across all attempts for a claim, and explain which static or repeated data may safely be reused. Restrict claim reads to authorized reviewers.

Payment execution, fraud investigation, model training, claimant-facing UI, and reviewer decision-editing workflows are out of scope. Describe infrastructure capabilities; no particular cloud provider is required.

What to build

  1. Accept claim emails and PDF attachments durably, return a claim identity, and map repeat delivery of the same email to that identity.
  2. Extract facts and retrieve relevant evidence and the applicable customer-policy snapshot, then produce one durable approve, deny, or review-required outcome with an explanation and evidence references.
  3. An authorized reviewer can retrieve processing status, the outcome, cited evidence, and the exact policy snapshot used.
  4. Recover accepted work after processing or model failures while respecting the cumulative per-claim model-token budget; escalate unresolved work to review.

At scale

  • For this exercise, assume 10,000 claims per day with short bursts at ten times the average rate and up to 20 MB of email/PDF evidence per claim.
  • For this exercise, acknowledge a durably accepted claim within 2 seconds and finish 95% of healthy claims within 5 minutes; ingestion remains usable while model processing is delayed.
  • For this exercise, model usage is capped at 20,000 input-plus-output tokens per claim across every attempt; work that cannot complete within that budget becomes review-required.
  • For this exercise, an acknowledged claim survives a process restart, and concurrent or repeated processing must not publish conflicting terminal outcomes.