← Questions

Design an insurance claims agent with RAG

0
Scale AISystem designLast asked Apr 2026

An AI system design interview question asked in Scale AI's system design round, last asked Apr 2026. It tests rag, llm agents and document processing.

An insurer receives claims by email with PDF attachments. Design a backend agent that reads each claim, pulls out the facts, retrieves the customer's policy and the relevant coverage rules, and decides approve or deny with an explanation that cites the evidence.

Cover:

  • Ingesting emails and PDFs durably, and treating a re-delivered email as the same claim.
  • Extraction, retrieval and the decision step, and sending missing, conflicting or unreadable evidence to a human instead of guessing.
  • What a claims reviewer can see: status, the decision, the cited documents and the exact policy version used.
  • Recovering from model or processing failures while keeping each claim within a token budget.

Requirements

  • Functional: ingest claim emails and PDF attachments; extract the facts; retrieve the customer's policy and the coverage rules; decide approve or deny with cited evidence; send unclear cases to a human; a reviewer view of status, decision, citations and policy version.
  • Non-functional: durable, idempotent ingest; full audit of every decision; a token budget per claim; recovery from model and processing failures; protection of personal data.

Clarifying questions

  • How many claims arrive a day, and how fast must they be decided?
  • Does the agent decide on its own, or only recommend for some claim types or amounts?
  • Are policies per-customer documents plus general coverage rules, and how often do they change?
  • Are the PDFs scanned images or handwriting that need OCR?
  • What must an explanation contain to satisfy regulators, and how long is it kept?

What a strong answer covers

  • Ingest: raw emails and attachments saved to object storage, duplicates detected by message id plus content hash, and a claim record moving through clear states (received, extracted, retrieved, decided, reviewed), with each step queued.
  • Extraction into a typed schema with confidence and the source location for each field; validation rules; missing, conflicting or unreadable fields go to a human.
  • Retrieval: the policy looked up by policy number as structured, versioned data; coverage rules found by search over versioned rule documents; the exact versions used stored with the claim.
  • A decision step with a constrained output (decision, reasons, citations to specific passages), checked so every citation exists and was retrieved; thresholds for automatic decisions against human review.
  • Steps that are idempotent and checkpointed, retries and a fallback model, a token budget tracked across steps, and evaluation on past claims with known outcomes.

Follow-ups

  • A policy is amended after a claim was decided.
  • A claim PDF contains text written to manipulate the agent.
  • How do you measure decision quality before launch and after?
  • Spotting possible fraud across claims.

Where it's asked

What it tests

rag · llm agents · document processing · human review

Your canvas
Draw your answer hereBoxes, arrows and notes, saved for you to come back to.Sign in to start drawing