AEGIS - AI-Powered Insurance Distribution Platform

Inspiration

The insurance industry has long struggled with inefficient lead management, manual workflow processes, and the challenge of matching the right agent with the right customer. Traditional systems require extensive manual intervention, leading to lost opportunities, delayed conversions, and inconsistent customer experiences.

We were inspired to build AEGIS after recognizing that:

  • Lead distribution is often arbitrary - Leads are assigned without considering agent expertise or customer needs
  • Workflow management is fragmented - Multiple disconnected systems require constant manual coordination
  • Customer insights are underutilized - Valuable data from calls and interactions isn't leveraged for better recommendations
  • Document processing is tedious - Manual data entry from forms and documents is time-consuming and error-prone
  • AI capabilities are underused - Modern AI can transform insurance sales but isn't integrated into core workflows

AEGIS was born from the vision of creating an intelligent, end-to-end automation platform that uses AI to make every step of the insurance distribution process smarter, faster, and more effective.

What it does

AEGIS is a comprehensive AI-powered insurance distribution platform that automates and intelligently orchestrates the entire journey from lead generation to policy issuance. Here's what it does:

🤖 Intelligent Lead Distribution

  • AI-Powered Agent Matching: Uses Google Gemini AI and Neo4j Graph RAG to analyze customer profiles and match them with the most suitable insurance agent based on expertise, past performance, and customer similarity
  • Automated Workflow Initiation: Seamlessly starts the lead-to-policy workflow with a single click

🔄 End-to-End Workflow Orchestration

  • 10-Step Automated Workflow: Orchestrates the complete process from lead qualification to policy issuance using Temporal
  • Intelligent Task Management: Automatically creates tasks for manual interventions (call completion, approvals) and tracks progress
  • Real-time Status Tracking: Provides visibility into workflow progress at every step

📞 AI-Powered Call Analysis

  • Call Recording Management: Agents upload call recordings which are automatically transcribed
  • Intelligent Transcript Analysis: Uses Gemini AI with Graph RAG to extract insights including:
    • Customer sentiment and interest level
    • Key selling points and cross-sell opportunities
    • Customer concerns and objections
    • Personalized product recommendations
    • Follow-up action items
  • Automatic Workflow Progression: Once call analysis is complete, the workflow automatically advances to the next step

📄 OCR and Document Intelligence

  • AI-Powered Form Auto-Fill: Upload images or PDFs (ID cards, forms, business cards) and let AI extract structured customer data
  • Vision API Integration: Uses Google Gemini Vision API to extract text and parse it into structured data
  • Instant Form Population: Automatically fills customer, lead, or product forms with extracted information

🎯 Personalized Product Recommendations

  • Graph RAG-Based Recommendations: Uses Neo4j to find similar customers and their product preferences
  • AI-Enhanced Analysis: Gemini AI analyzes customer profiles and graph relationships to recommend the best insurance products
  • Context-Aware Suggestions: Recommendations consider customer demographics, risk profile, and purchase history

📊 Sales Enablement

  • AI-Generated Sales Strategies: Creates personalized talking points, objection handling strategies, and next steps for each lead
  • Customer Insights: Provides deep insights into customer needs and preferences
  • Product Highlights: Identifies key product features that resonate with specific customers

👥 Role-Based Management

  • Admin Dashboard: Complete visibility into all leads, workflows, agents, and customers
  • Agent Workspace: Focused view of assigned leads, tasks, and customer interactions
  • Performance Tracking: Monitor agent productivity and conversion metrics

📁 Document Management

  • Centralized Document Hub: Upload, view, and manage documents associated with leads, tasks, and workflow steps
  • Workflow Integration: Documents are automatically linked to relevant workflow steps

How we built it

Frontend Architecture

  • Angular 17 with standalone components for a modern, modular architecture
  • TypeScript for type safety and better developer experience
  • CSS Variables for seamless light/dark mode theming
  • RxJS Observables for reactive data management
  • Component-based architecture with clear separation of concerns

Backend Architecture

  • Spring Boot 3.2 with Java 21 for robust, enterprise-grade backend services
  • RESTful API design with 12 specialized controllers handling different domains
  • Service layer architecture separating business logic from API concerns
  • JPA/Hibernate for PostgreSQL database operations
  • Spring Data Neo4j for graph database operations

Workflow Orchestration

  • Temporal 1.22 for distributed workflow orchestration
  • 10-step workflow implementation with activities for each step
  • Signal-based communication between services and workflows
  • Automatic retries and state persistence for reliability

AI Integration

  • Spring AI 1.1.2 as the abstraction layer for AI operations
  • Google Gemini 3 Flash for:
    • Natural language processing and analysis
    • Call transcription using Multimodal API
    • Vision API for OCR and document understanding
    • Structured data extraction from unstructured text
  • Neo4j Graph RAG for context-aware AI responses:
    • Customer similarity graphs
    • Product relationship mapping
    • Purchase pattern analysis

Data Architecture

  • PostgreSQL 15 for transactional data (customers, leads, tasks, calls, documents, policies)
  • Neo4j 5.15 for graph relationships and Graph RAG context
  • Dual-database strategy leveraging strengths of both relational and graph databases
  • Eager loading strategies for optimal performance

Infrastructure

  • Docker Compose for containerized deployment
  • Microservices-ready architecture with clear service boundaries
  • File storage on local filesystem with support for large files (up to 100MB)
  • CORS configuration for secure frontend-backend communication

Development Approach

  • Iterative development with continuous feature additions
  • Role-based access control implemented from the ground up
  • Error handling and resilience built into every layer
  • Comprehensive logging for debugging and monitoring

Challenges we ran into

1. Workflow Orchestration Complexity

  • Challenge: Implementing a 10-step workflow with multiple decision points, manual interventions, and state management was complex
  • Solution: Used Temporal's workflow capabilities to handle state persistence, retries, and long-running processes. Implemented signal-based communication for async operations

2. Graph RAG Integration

  • Challenge: Integrating Neo4j graph queries with LLM prompts to provide context-aware responses required careful prompt engineering
  • Solution: Built a service layer that queries Neo4j for similar customers and products, formats the graph context, and injects it into AI prompts for more accurate recommendations

3. AI Model Configuration

  • Challenge: Finding the right balance between response quality and speed with Gemini AI, especially for structured data extraction
  • Solution: Experimented with different temperature settings (0.1-0.7), implemented prompt templates, and added fallback mechanisms for when AI responses need parsing

4. File Upload and Processing

  • Challenge: Handling large file uploads (call recordings, documents) with proper error handling and progress tracking
  • Solution: Configured Spring Boot multipart limits (100MB), implemented proper file validation, and added async processing for transcription and analysis

5. Real-time UI Updates

  • Challenge: Keeping the frontend synchronized with backend workflow state changes and task updates
  • Solution: Implemented polling mechanisms for agents, auto-refresh for admins, and proper state management in Angular components

6. Database Relationship Loading

  • Challenge: Lazy loading of relationships (e.g., Task → Lead → Customer) caused issues when data wasn't available in API responses
  • Solution: Created custom JPA queries with JOIN FETCH to eagerly load necessary relationships, ensuring complete data in responses

7. Role-Based Access Control

  • Challenge: Implementing different views and permissions for Admin vs Agent roles while maintaining code reusability
  • Solution: Built role-aware services, conditional UI rendering, and route guards that check user roles before allowing access

8. OCR Data Extraction Accuracy

  • Challenge: Extracting structured data from OCR text with varying formats and quality
  • Solution: Used a two-step approach: first extract raw text with Vision API, then use Gemini AI with low temperature (0.2) to parse structured JSON, with fallback error handling

9. Workflow State Synchronization

  • Challenge: Keeping Temporal workflow state in sync with database entities and UI display
  • Solution: Created WorkflowStatusService that queries Temporal for current state and formats it for UI, with proper error handling for missing workflows

10. Theme and UI Consistency

  • Challenge: Implementing a cohesive light/dark mode theme across all components
  • Solution: Used CSS variables extensively, created a centralized theme system, and ensured all components use theme-aware colors

Accomplishments that we're proud of

🎯 Complete End-to-End Automation

We successfully built a platform that automates the entire lead-to-policy journey, from initial lead capture to final policy issuance, with intelligent orchestration at every step.

🤖 Advanced AI Integration

  • Successfully integrated multiple AI capabilities (NLP, Vision, Graph RAG) into a cohesive system
  • Achieved accurate structured data extraction from unstructured documents using Vision API
  • Implemented context-aware AI responses using Neo4j Graph RAG

🔄 Robust Workflow Orchestration

  • Built a 10-step workflow that handles complex business logic, manual interventions, and long-running processes
  • Implemented automatic retries, state persistence, and error recovery
  • Created seamless integration between Temporal workflows and Spring Boot services

📊 Intelligent Lead Distribution

  • Developed an AI-powered system that matches customers with agents based on multiple factors
  • Achieved better lead-agent matching using graph relationships and AI analysis
  • Reduced manual assignment overhead significantly

📞 Comprehensive Call Analysis

  • Built a system that extracts deep insights from call transcripts
  • Integrated Graph RAG to provide context-aware analysis
  • Automated workflow progression based on call analysis results

🎨 Modern, Polished UI

  • Created a beautiful, responsive interface with seamless light/dark mode
  • Implemented role-based views that adapt to user permissions
  • Built intuitive workflows for complex operations (OCR, call analysis, workflow management)

🏗️ Scalable Architecture

  • Designed a microservices-ready architecture with clear separation of concerns
  • Implemented proper error handling and resilience at every layer
  • Created a system that can scale horizontally

📈 Performance Optimization

  • Optimized database queries with eager loading strategies
  • Implemented efficient polling mechanisms for real-time updates
  • Created caching strategies where appropriate

🔒 Security and Access Control

  • Implemented comprehensive role-based access control
  • Ensured data isolation between agents
  • Built secure authentication and authorization flows

📚 Comprehensive Documentation

  • Created detailed architecture documentation
  • Documented all API endpoints and data flows
  • Provided clear diagrams and textual descriptions for system understanding

What we learned

Technical Learnings

  1. Workflow Orchestration is Powerful: Temporal transformed how we think about long-running business processes. The ability to handle state, retries, and async operations declaratively is game-changing.

  2. Graph RAG Enhances AI Accuracy: Combining Neo4j graph queries with LLM prompts significantly improves the relevance and accuracy of AI responses, especially for recommendations.

  3. Vision AI is Mature: Google Gemini's Vision API can reliably extract text and structured data from images, making OCR-based form auto-fill a reality.

  4. Dual-Database Strategy Works: Using PostgreSQL for transactions and Neo4j for relationships leverages the strengths of both database types effectively.

  5. Spring AI Simplifies Integration: The Spring AI abstraction layer makes it much easier to work with multiple AI providers and switch between them.

What's next for AEGIS

  1. Enhanced OCR Capabilities
  2. Real-time Collaboration
  3. Advanced Analytics Dashboard
  4. Mobile Application
  5. Enhanced AI Features
  6. Compliance and Audit
  7. Performance Optimization
  8. AI Model Fine-tuning
  9. Predictive Analytics Platform
  10. Advanced Personalization

AEGIS is just getting started. We're excited to continue building features that make insurance distribution smarter, faster, and more effective for everyone involved.

Built With

Share this project:

Updates