AI-powered insurance claims processing agent using LangGraph for triage, fraud detection, and settlement recommendations. Implements real-time WebSocket updates and structured AI outputs.
An AI-powered insurance claims processing system that uses LangGraph to orchestrate multi-step claim assessment workflows with real-time updates.
This skill guides Claude through working with Clem AI, a monorepo-based insurance claims processing platform featuring:
The system uses a LangGraph agent with two main nodes:
1. **Triage Node**: Analyzes severity, fraud indicators, and initial assessment
2. **Recommend Node**: Calculates settlement amounts with justifications
All outputs use structured Zod schemas for type safety.
Backend modules (`apps/backend/src/modules/`):
When asked about the system architecture:
When implementing or debugging claims workflows:
```typescript
// Entry point: ClaimsService.processNewClaim()
// Location: apps/backend/src/modules/claims/claims.service.ts
// Key implementation details:
// - State initialization with claim input
// - LangGraph agent streaming through nodes
// - State reconstruction from chunks (lines 76-83)
// - WebSocket broadcasting on completion
// - Audit log generation
```
**State schema location**: `apps/backend/src/modules/claims/claims.state.ts`
**Important**: Agent uses structured outputs via Zod. Do not return raw strings.
When working with the database:
```bash
npx prisma studio # Inspect data
npx prisma migrate dev --name <name> # Create migration
npx prisma generate # Regenerate client after schema changes
```
**Schema location**: `apps/backend/prisma/schema.prisma`
**After any schema changes**: Must run `npx prisma generate` to update the client.
When setting up or running the application:
```bash
pnpm install # Install dependencies
docker-compose up -d postgres # PostgreSQL
npx prisma migrate dev
docker-compose up -d # All services
pnpm dev # Backend + Frontend
pnpm --filter backend start:dev # Backend only
pnpm --filter frontend dev # Frontend only
```
**Service ports**:
When working with the Next.js dashboard:
**Route structure** (`apps/frontend/app/`):
**Key patterns**:
When writing or running tests:
```bash
pnpm test # All workspaces
pnpm test:backend # Backend unit tests
pnpm test:frontend # Frontend tests
pnpm run test:watch # Watch mode
pnpm run test:e2e # End-to-end tests
cd services/ai-service && pytest tests/
```
Before committing changes:
```bash
pnpm lint # Check linting
pnpm lint:fix # Auto-fix issues
pnpm format # Format code
pnpm format:check # Check formatting
```
**Configuration locations**:
When working with Python AI microservices:
**AI Service** (`services/ai-service/`, port 8000):
**Running**:
```bash
cd services/ai-service
uvicorn src.main:app --reload --port 8000
```
**Environment**: Requires `GOOGLE_API_KEY` for Gemini integration.
**Critical environment variables**:
Backend:
Frontend:
**Examples**: See `.env.example` and `.env.production.example`
**Adding a new claim field**:
1. Update `prisma/schema.prisma`
2. Run `npx prisma migrate dev --name add_field_name`
3. Update Zod schemas in `claims.state.ts`
4. Update DTOs in `claims/dto/`
5. Update frontend forms and display components
**Adding a new LangGraph node**:
1. Define node function in `claims.service.ts`
2. Update state schema in `claims.state.ts`
3. Add node to workflow graph in `buildAgent()`
4. Update WebSocket payload in `ClaimsGateway`
**Adding a new module**:
1. Create module structure in `src/modules/<name>/`
2. Implement service, controller, DTOs
3. Import in `app.module.ts`
4. Add tests in `<name>/<name>.service.spec.ts`
**User**: "Help me add a new 'estimated_repair_time' field to claims that the AI should calculate"
**Claude should**:
1. Update `prisma/schema.prisma` to add the field
2. Run migration command
3. Update `ClaimTriageResult` Zod schema in `claims.state.ts`
4. Modify triage node prompt to include repair time estimation
5. Update frontend claim detail view to display the field
6. Suggest testing the end-to-end flow
**User**: "The dashboard isn't receiving real-time updates"
**Claude should**:
1. Check WebSocket connection in browser console
2. Verify `ClaimsGateway` is emitting events after claim creation
3. Check CORS configuration in gateway
4. Verify frontend Socket.IO client initialization
5. Confirm backend and frontend URLs match environment variables
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/clem-ai-claims-adjuster-workflow/raw