Insurance Claim Agent Demo - #315
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
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.
Contributor
Author
ashvathsureshkumar
approved these changes
Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
Please ensure that your PR meets the following requirements:
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:
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.
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.
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.
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.