Skip to content

pradhankukiran/claims-intake-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Claims Intake Bot

AI-powered FNOL (First Notice of Loss) insurance claims intake platform

A full-stack microservices application featuring a conversational chatbot that guides users through filing insurance claims, with smart claim type detection, real-time policy validation, and event-driven processing.

.NET React TypeScript Tailwind CSS PostgreSQL RabbitMQ Rasa Docker Vite License


Overview

Claims Intake Bot is a microservices-based insurance platform centered around a conversational FNOL chatbot. Instead of filling out forms, policyholders describe their incident in natural language. The bot validates their policy in real-time, auto-detects the claim type from their description using weighted keyword matching with fuzzy tolerance, confirms all details, and submits the claim through the backend pipeline.

Key Highlights

  • Smart claim type detection — Weighted keyword scoring with Levenshtein fuzzy matching auto-detects claim types from free-text descriptions
  • Natural language date parsing — Duckling entity server understands "last Tuesday", "March 15th", "two days ago"
  • Real-time policy validation — Bot calls Claims Service API mid-conversation to verify policy exists and is active
  • Confirmation flow — Shows structured summary card, allows field-by-field corrections before submission
  • Event-driven architecture — Claim submission publishes events to RabbitMQ, consumed by Notification Service
  • Rich chat responses — Structured cards for policy info, claim summaries, and submission confirmations

Architecture

                              ┌─────────────────────────────────────────────┐
                              │              Docker Compose                 │
                              │                                             │
┌──────────┐    nginx    ┌────┴─────┐    YARP     ┌──────────────┐         │
│  React   │───────────→│   API    │───────────→│   Claims     │         │
│  SPA     │   :3000    │  Gateway │   proxy    │   Service    │         │
│          │            │  :5000   │            │   :8080      │         │
└──────────┘            │          │            │              │         │
                        │  JWT     │            │  EF Core     │         │
                        │  Auth    │            │  PostgreSQL ─┼──→ [PostgreSQL :5432]
                        │          │            │              │         │
                        │          │  /api/chat │  RabbitMQ ───┼──→ [RabbitMQ :5672]
                        │          │───────┐    │  Publisher   │         │
                        └──────────┘       │    └──────────────┘    ┌────┴───────────┐
                                           │                        │  Notification  │
                                           ▼                        │  Service       │
                                    ┌─────────────┐                │  (consumer)    │
                                    │    Rasa     │                └────────────────┘
                                    │    :5005    │
                                    │             │    ┌────────────┐
                                    │  NLU +      │───→│   Rasa     │
                                    │  Dialogue   │    │   Actions  │
                                    │             │    │   :5055    │
                                    └─────────────┘    │            │
                                           │           │  Validates │
                                    ┌──────┴──────┐    │  against   │
                                    │  Duckling   │    │  Claims    │
                                    │  :8000      │    │  Service   │
                                    └─────────────┘    └────────────┘

9 containers orchestrated with Docker Compose, health checks, and dependency ordering.


Tech Stack

LayerTechnologyPurpose
FrontendReact 19, TypeScript, Tailwind CSS v4, ViteSPA with full-page chat UI, claims dashboard
API Gateway.NET 10, JWT Bearer, YARP Reverse ProxyAuth, routing, Rasa proxy
Claims Service.NET 10 Minimal APIs, EF CoreClaims CRUD, policy management
Notification.NET 10 Worker ServiceRabbitMQ event consumer
ChatbotRasa 3.6, Python, DIET ClassifierNLU, dialogue management, form filling
Date ParsingDucklingNatural language date/time extraction
DatabasePostgreSQL 16Claims, policies, event store
MessagingRabbitMQ 3.13Async event-driven processing
InfrastructureDocker, Docker ComposeContainer orchestration

Quick Start

Prerequisites

Run

git clone https://github.com/pradhankukiran/claims-intake-bot.git
cd claims-intake-bot
cp .env.example .env
docker compose up --build

Once all containers are healthy (~2-3 minutes for initial build), open http://localhost:3000.

Credentials

Username Password Role
adjuster demo123 Claims Adjuster
admin demo123 Admin

Features

Conversational FNOL Chatbot

The centerpiece of the application. A full-page chat experience with an FNOL progress panel.

Conversation Flow:

  1. User says "I want to file a claim"
  2. Bot asks for policy number → validates against Claims Service API → shows policy info card
  3. Bot asks for incident date → Duckling parses natural language ("last Tuesday" → 2025-04-01)
  4. Bot asks for description → auto-detects claim type using weighted keyword matching
  5. Bot shows structured summary card with confirmation buttons
  6. User can correct individual fields or confirm → claim submitted
  7. Success card with claim number and link to dashboard

NLU Capabilities:

  • 50+ training examples per intent with typo tolerance
  • Regex patterns for policy numbers (POL-YYYY-NNN)
  • Entity synonyms mapping natural language to claim types
  • Fuzzy matching with Levenshtein distance for keyword detection
  • Confidence thresholds to avoid ambiguous auto-detection
  • Out-of-scope handling and mid-form recovery

Claims Dashboard

  • Summary cards: Total Claims, Submitted, Under Review, Approved
  • Sortable and filterable claims table
  • Claim detail view with event timeline
  • Status transition controls with audit trail

Event-Driven Architecture

Claim Submitted → ClaimCreatedEvent → RabbitMQ → Notification Service

Each claim submission publishes an event to RabbitMQ. The Notification Service consumes events asynchronously for downstream processing.


Services

Service Port Health Check Description
Frontend 3000 React SPA with nginx reverse proxy
API Gateway 5000 /health JWT auth, YARP routing, Rasa proxy
Claims Service 8081 /health Claims REST API, EF Core + PostgreSQL
Rasa 5005 Chatbot NLU + dialogue management
Rasa Actions 5055 Custom Python action server
Duckling 8000 Date/time entity extraction
PostgreSQL 5432 pg_isready Relational database
RabbitMQ 5672 rabbitmq-diagnostics ping Message broker
RabbitMQ UI 15672 Management console

API Reference

Authentication

POST /api/auth/login    → JWT token

Claims

POST   /api/claims              → Create claim
GET    /api/claims              → List claims (?status= filter)
GET    /api/claims/{id}         → Claim detail + events
PATCH  /api/claims/{id}/status  → Update status (validated transitions)

Policies

GET /api/policies               → List all policies
GET /api/policies/{number}      → Lookup by policy number

Chat

POST /api/chat                  → Send message to Rasa (auth required)

Project Structure

claims-intake-bot/
├── docker-compose.yml                    # 9-container orchestration
├── .env.example                          # Environment template
├── infra/
│   └── postgres/init.sql                 # DB schema + seed data
│
├── src/
│   ├── ClaimsIntake.slnx                 # .NET solution
│   │
│   ├── Shared/
│   │   └── ClaimsIntake.Contracts/       # DTOs, events (shared)
│   │
│   ├── Services/
│   │   ├── ClaimsIntake.ClaimsService/   # Claims REST API
│   │   │   ├── Entities/                 # EF Core entities
│   │   │   ├── Data/                     # DbContext, seed data
│   │   │   └── Services/                 # RabbitMQ publisher
│   │   │
│   │   └── ClaimsIntake.NotificationService/
│   │       └── Workers/                  # RabbitMQ consumer
│   │
│   ├── Gateway/
│   │   └── ClaimsIntake.ApiGateway/      # JWT + YARP + Rasa proxy
│   │
│   ├── rasa/
│   │   ├── config.yml                    # NLU pipeline + policies
│   │   ├── domain.yml                    # Intents, slots, forms
│   │   ├── data/
│   │   │   ├── nlu.yml                   # 900+ training examples
│   │   │   ├── stories.yml               # Conversation flows
│   │   │   └── rules.yml                 # Dialogue rules
│   │   └── actions/
│   │       └── actions.py                # Custom actions + detection
│   │
│   └── frontend/
│       ├── nginx.conf                    # Production proxy config
│       └── src/
│           ├── pages/                    # ChatPage, Dashboard, Claims
│           ├── components/
│           │   ├── chat/                 # Rich messages, progress panel
│           │   ├── claims/               # Table, detail, status badges
│           │   └── layout/               # Sidebar, header
│           ├── hooks/                    # useChat, useAuth, useClaims
│           ├── services/                 # API clients
│           └── types/                    # TypeScript interfaces

Development

Local .NET Development

# Claims Service (requires PostgreSQL + RabbitMQ running)
cd src/Services/ClaimsIntake.ClaimsService
dotnet run

# API Gateway
cd src/Gateway/ClaimsIntake.ApiGateway
dotnet run

Local Frontend Development

cd src/frontend
npm install
npm run dev   # Starts on :5173, proxies /api to :5000

Rasa Development

cd src/rasa
pip install rasa==3.6.21
rasa train
rasa shell    # Interactive testing

Run Tests

# .NET
dotnet build src/ClaimsIntake.slnx

# Frontend
cd src/frontend
npx tsc --noEmit
npm run build

Environment Variables

Variable Default Description
POSTGRES_DB claims_db PostgreSQL database name
POSTGRES_USER claims PostgreSQL username
POSTGRES_PASSWORD claims_dev_password PostgreSQL password
RABBITMQ_USER claims RabbitMQ username
RABBITMQ_PASSWORD claims_dev_password RabbitMQ password
JWT_SECRET (see .env.example) JWT signing key (min 32 chars)
FRONTEND_PORT 3000 Frontend exposed port

License

This project is licensed under the MIT License.

About

AI-powered FNOL insurance claims intake platform — Rasa chatbot, .NET 10 microservices, React, PostgreSQL, RabbitMQ, Docker

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors