Skip to content

Insurance Claim Agent Demo - #315

Merged
CoderOMaster merged 4 commits into
mainfrom
keshav/demo
Jun 30, 2026
Merged

Insurance Claim Agent Demo#315
CoderOMaster merged 4 commits into
mainfrom
keshav/demo

Conversation

@CoderOMaster

Copy link
Copy Markdown
Contributor

Pull Request Checklist

Please ensure that your PR meets the following requirements:

  • I have read the CONTRIBUTING guide.
  • I have updated the documentation (if applicable).
  • My code follows the style guidelines of this project.
  • I have performed a self-review of my own code.
  • I have added tests that prove my fix is effective or that my feature works.
  • New and existing unit tests pass locally with my changes.

Description

Adds a field Insurance Claims Adjuster Voice Agent demo to examples/voice-agents/insurance-adjuster/.

A field adjuster calls in from a damaged property, speaks naturally about what they're seeing, and gets instant answers about policy coverage — hands-free, with zero perceptible retrieval latency. Damage items are dictated verbally and logged into a live Moss session that grows during the call and is pushed to the cloud at the end.

What makes this architecturally interesting beyond the existing voice agent examples:

  1. Multi-index ambient retrieval (3 parallel queries per turn)
    Every user utterance fires three SessionIndex.query() calls in parallel before the LLM responds — no tool call, no extra round-trip:

claims-kb — shared HO-3 policy language, exclusions, state guidelines (always warm)
policy-{number} — this policyholder's declarations, deductibles, endorsements (pre-selected from the frontend)
claim-{session} — live findings index for this inspection call (grows as the adjuster dictates damage)
All three run against local SessionIndex objects — 0ms latency, fully in-process.

  1. Moss Sessions for live findings storage
    Each damage item dictated by the adjuster is indexed via session.add_docs() (local embedding, no cloud round-trip). After the third finding is logged, the agent can answer "what have I logged so far?" from the findings session without a tool call. At the end of the call, session.push_index() persists the full claim record to the cloud.

  2. prewarm_fnc parallel index loading
    All four indexes (claims-kb + 3 policy indexes) are loaded simultaneously via asyncio.gather at worker startup using prewarm_fnc. By the time the first call arrives, everything is warm. Per-call entrypoint is a dict lookup, not a network call.

  3. Frontend with policy pre-selection
    A Next.js + Tailwind UI lets the adjuster select a policy before joining. The policy number is embedded in the LiveKit participant token metadata and read by the agent at job start — the agent greets with the policy already loaded, no verbal policy-number exchange needed.

Copilot AI review requested due to automatic review settings June 26, 2026 07:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new end-to-end “Insurance Claims Adjuster” voice-agent demo under examples/voice-agents/insurance-adjuster/, combining a LiveKit voice agent (Python) with a Next.js UI and supporting scripts/data to build and query multiple Moss indexes for policy + claims knowledge + live findings.

Changes:

  • Introduces a LiveKit agent that pre-warms multiple Moss sessions and performs ambient multi-index retrieval per user turn, plus tools to log findings and submit a report.
  • Adds index build tooling and ingestion utilities (crawl + chunk) along with policy fixtures and a shared claims KB dataset.
  • Adds a Next.js/Tailwind UI for policy selection and in-call visualization of transcript, findings, and (intended) retrieval telemetry.

Reviewed changes

Copilot reviewed 30 out of 34 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
examples/voice-agents/insurance-adjuster/README.md Documents the demo, architecture, setup, and scenarios.
examples/voice-agents/insurance-adjuster/pyproject.toml Declares Python dependencies for the demo agent and tooling.
examples/voice-agents/insurance-adjuster/.env.example Example env vars for Moss + LiveKit + LLM/voice providers.
examples/voice-agents/insurance-adjuster/agent.py LiveKit agent: prewarm indexes, ambient retrieval, log findings, submit report.
examples/voice-agents/insurance-adjuster/create_indexes.py Script to build per-policy indexes and the shared claims-kb index.
examples/voice-agents/insurance-adjuster/ingest/init.py Marks ingestion module package.
examples/voice-agents/insurance-adjuster/ingest/crawl.py Crawler to fetch public insurance sources and emit chunked docs for indexing.
examples/voice-agents/insurance-adjuster/ingest/chunk.py Utilities to chunk long-form policy PDFs/text into indexable docs.
examples/voice-agents/insurance-adjuster/data/claims_kb.json Hand-authored shared claims knowledge base documents.
examples/voice-agents/insurance-adjuster/data/policies/policy_HO3_FL001.json Florida policy fixture docs for a per-policy index.
examples/voice-agents/insurance-adjuster/data/policies/policy_HO3_CA002.json California policy fixture docs for a per-policy index.
examples/voice-agents/insurance-adjuster/data/policies/policy_HO3_TX003.json Texas policy fixture docs for a per-policy index.
examples/voice-agents/insurance-adjuster/ui/.env.example Example env vars for the UI LiveKit token server route.
examples/voice-agents/insurance-adjuster/ui/package.json UI dependencies/scripts (Next.js, LiveKit, Tailwind).
examples/voice-agents/insurance-adjuster/ui/tsconfig.json TypeScript compiler settings for the UI.
examples/voice-agents/insurance-adjuster/ui/next.config.ts Next.js config (notably serverExternalPackages).
examples/voice-agents/insurance-adjuster/ui/next-env.d.ts Next.js TypeScript env references.
examples/voice-agents/insurance-adjuster/ui/postcss.config.mjs PostCSS config for Tailwind v4 integration.
examples/voice-agents/insurance-adjuster/ui/app/layout.tsx Root layout + metadata for the UI.
examples/voice-agents/insurance-adjuster/ui/app/page.tsx Renders the main app component.
examples/voice-agents/insurance-adjuster/ui/app/globals.css Tailwind import and global theme/base styles.
examples/voice-agents/insurance-adjuster/ui/app/api/connection-details/route.ts API route to mint LiveKit access tokens for the UI.
examples/voice-agents/insurance-adjuster/ui/lib/utils.ts UI helpers (cn, formatCurrency).
examples/voice-agents/insurance-adjuster/ui/lib/policies.ts Policy fixtures used for UI selection/details display.
examples/voice-agents/insurance-adjuster/ui/hooks/useClaimState.ts Client hook to track claim state from LiveKit data messages.
examples/voice-agents/insurance-adjuster/ui/hooks/useMossInsuranceEvents.ts Client hook to parse and display Moss context telemetry events.
examples/voice-agents/insurance-adjuster/ui/components/app/app.tsx UI state machine + LiveKitRoom wiring.
examples/voice-agents/insurance-adjuster/ui/components/app/welcome-screen.tsx Policy selection + adjuster ID capture/validation.
examples/voice-agents/insurance-adjuster/ui/components/app/session-view.tsx In-call view wrapper wiring hooks into the main UI.
examples/voice-agents/insurance-adjuster/ui/components/app/voice-center.tsx Main voice UX: agent state, transcript, retrieval strip.
examples/voice-agents/insurance-adjuster/ui/components/app/policy-panel.tsx Policy details side panel UI.
examples/voice-agents/insurance-adjuster/ui/components/app/damage-worksheet.tsx Findings + totals worksheet UI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/voice-agents/insurance-adjuster/README.md Outdated
Comment thread examples/voice-agents/insurance-adjuster/agent.py
Comment thread examples/voice-agents/insurance-adjuster/ui/components/app/app.tsx
Comment thread examples/voice-agents/insurance-adjuster/ui/components/app/app.tsx Outdated
@CoderOMaster

Copy link
Copy Markdown
Contributor Author

@codex

@CoderOMaster
CoderOMaster merged commit e8d1523 into main Jun 30, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants