DEV Community

Cover image for Building an AI Workforce for Insurance with n8n, OpenAI, LangGraph and Supabase
Gaurav Talesara
Gaurav Talesara

Posted on

Building an AI Workforce for Insurance with n8n, OpenAI, LangGraph and Supabase

#ai

AI for Preparation. Humans for Judgment.

Most AI projects today are one of these:

  • A chatbot
  • A customer support bot
  • A voice assistant
  • A Q&A system

But I wanted to explore something bigger:

What if businesses could build an AI Workforce?

Instead of one AI assistant,

imagine:

Customer

↓

AI Workforce

├── Discovery Agent

├── Research Agent

├── Policy Comparison Agent

├── Recommendation Agent

├── CRM Agent

└── Follow-up Agent

↓

Human Advisor

↓

Customer
Enter fullscreen mode Exit fullscreen mode

This article explains the architecture and design decisions behind such a system.


Why Insurance?

Insurance is an interesting industry for AI.

Because:

  • Research is repetitive.
  • Recommendations are data-driven.
  • Follow-ups are expensive.
  • Trust is critical.
  • Human judgment is still necessary.

This makes Insurance a perfect Human-in-the-Loop AI use case.


Human In The Loop

This is the core philosophy.

I don't want AI to automatically sell insurance.

I don't want AI replacing advisors.

I want:

AI prepares.

Humans decide.
Enter fullscreen mode Exit fullscreen mode

The workflow becomes:

Customer

↓

AI Workforce

↓

Human Advisor Review

↓

Customer
Enter fullscreen mode Exit fullscreen mode

This creates:

  • Faster recommendations
  • Better customer experience
  • Safer AI adoption
  • Human accountability

AI Workforce Architecture

Customer

↓

WhatsApp
Phone Call
Website Chat
Email

↓

AI Workforce

├── Discovery Agent

├── Research Agent

├── Comparison Agent

├── Recommendation Agent

├── CRM Agent

└── Follow-up Agent

↓

Human Advisor

↓

Customer
Enter fullscreen mode Exit fullscreen mode

Discovery Agent

The Discovery Agent understands the customer.

Responsibilities:

  • Collect customer profile
  • Understand goals
  • Assess risk
  • Understand existing insurance
  • Identify gaps

Example Output:

{
  "risk_level":"medium",
  "family_type":"married_with_children",
  "insurance_goal":"health_and_term",
  "recommended_health_cover":"20L",
  "recommended_term_cover":"3Cr"
}
Enter fullscreen mode Exit fullscreen mode

Research Agent

The Research Agent acts like an insurance analyst.

Responsibilities:

  • Analyze policies
  • Compare waiting periods
  • Review exclusions
  • Evaluate premiums
  • Generate recommendations

Example:

{
  "customer_profile_summary":"...",
  "top_recommendations":[
      "...",
      "...",
      "..."
  ],
  "risks":[
      "...",
      "..."
  ],
  "confidence_score":0.92
}
Enter fullscreen mode Exit fullscreen mode

Comparison Agent

Creates structured comparisons:

Feature Plan A Plan B Plan C
Coverage
Premium
Waiting Period
Claim Process

Output:

  • Best Overall
  • Best Budget
  • Best Family Plan

Recommendation Agent

Creates:

  • Customer Summary
  • Recommended Plan
  • Alternatives
  • Risk Analysis
  • Advisor Notes

Everything before the advisor joins.


CRM Agent

Updates:

  • Customer Records
  • Recommendations
  • Activities
  • Opportunity Status
  • Tasks

Follow-up Agent

Handles:

  • WhatsApp reminders
  • Renewal alerts
  • Email follow-ups
  • Call notes
  • Engagement tracking

Omnichannel AI

One important decision:

Customers should not install a new application.

The AI Workforce should operate through:

  • WhatsApp
  • Phone Calls
  • Website Chat
  • Email
  • SMS

Different channels.

Same intelligence.


Technology Stack

Frontend

  • Next.js
  • Tailwind
  • Lovable AI

Workflow Layer

  • n8n

AI Models

  • OpenAI
  • Gemini
  • Claude

Multi-Agent Framework

  • LangGraph

Database

  • Supabase
  • PostgreSQL

Memory

  • Pinecone

Monitoring

  • LangSmith
  • PostHog

Why n8n First?

I intentionally started with n8n.

Because:

  • Fast prototyping
  • Visual workflows
  • Easy OpenAI integration
  • Easy Supabase integration
  • Easy WhatsApp integration
  • Easy Email workflows

After validation:

n8n

↓

NestJS

↓

LangGraph

↓

Production AI Workforce
Enter fullscreen mode Exit fullscreen mode

The Bigger Vision

I don't think AI will replace Insurance Advisors.

I think every advisor may eventually have:

An AI Workforce working behind the scenes.

AI provides:

  • Speed
  • Consistency
  • Scale

Humans provide:

  • Trust
  • Empathy
  • Judgment

The future is not:

Human vs AI

The future is:

Human + AI Workforce


If you're building something similar, I'd love to hear your thoughts.

Top comments (0)