Skip to content

Insurance AI Assistant A smart system combining PostgreSQL, Milvus, and specialized AI agents (Life/Home/Auto) to answer insurance queries accurately. Features real-time sync, semantic search via OpenAI embeddings, and a Streamlit UI. Perfect for insurance tech demos or customer service augmentation.

Notifications You must be signed in to change notification settings

SamJoeSilvano/Insurance-Agentic-AI

Repository files navigation

๐Ÿ›ก๏ธ Insurance Specialist AI System

Python PostgreSQL Milvus Streamlit OpenAI Docker Agno

A sophisticated AI-powered insurance assistant system that combines PostgreSQL database management, vector embeddings with Milvus, and specialized AI agents for insurance domain expertise.

๐ŸŒŸ Key Features

  • Multi-Database Integration: PostgreSQL for structured data + Milvus for vector embeddings
  • Real-time Sync: Continuous database synchronization between PostgreSQL and Milvus
  • Specialized AI Agents: Domain-specific insurance experts (Life, Home, Auto)
  • Intelligent Routing: Smart query routing to appropriate specialists
  • Streamlit UI: Beautiful, interactive web interface

๐Ÿ› ๏ธ Prerequisites

๐Ÿ“ฆ Docker Desktop Installation

  1. Download and install Docker Desktop
  2. Ensure Docker is running in administrator mode

๐Ÿ“ฅ Milvus Installation via Docker

# Download the installation script
Invoke-WebRequest https://raw.githubusercontent.com/milvus-io/milvus/refs/heads/master/scripts/standalone_embed.bat -OutFile standalone.bat

# Start Milvus container
standalone.bat start
Wait for Milvus starting...
Start successfully.

# Verify Milvus is running (port 19530 should be listening)
docker ps

โš™๏ธ Milvus Management Commands

# Stop Milvus
standalone.bat stop
Stop successfully.

# Delete Milvus container and data
standalone.bat delete
Delete Milvus container successfully.
Delete successfully.

# Restart Milvus
standalone.bat start

๐Ÿ—๏ธ System Architecture

graph TD
    A[PostgreSQL Database] -->|Stores Insurance Data| B[Sync Process]
    B -->|Generates Embeddings| C[Milvus Vector Database]
    D[Streamlit UI] -->|User Queries| E[Coordinator Agent]
    E -->|Routes to| F[Life Insurance Agent]
    E -->|Routes to| G[Home Insurance Agent]
    E -->|Routes to| H[Auto Insurance Agent]
    C -->|Provides Context| F
    C -->|Provides Context| G
    C -->|Provides Context| H
Loading

๐Ÿ“ File Structure

insurance-ai-system/
โ”œโ”€โ”€ creating_postgres_database.py
โ”œโ”€โ”€ first_vector_embedding.py
โ”œโ”€โ”€ syncing_databases.py
โ”œโ”€โ”€ insurance_agents_main.py
โ”œโ”€โ”€ .env.example
โ””โ”€โ”€ README.md

โš™๏ธ Installation

1. Clone the repository

git clone https://github.com/yourusername/insurance-ai-system.git
cd insurance-ai-system

2. Set up environment variables

cp .env.example .env

Edit the .env file with your credentials:

PG_DB_NAME=insurance_db
PG_USER=postgres
PG_PASSWORD=yourpassword
PG_HOST=localhost
PG_PORT=5432
MILVUS_HOST=localhost
MILVUS_PORT=19530
OPENAI_API_KEY=your_openai_key
GROQ_API_KEY=your_groq_key

3. Install dependencies

pip install -r requirements.txt

4. Initialize the system

python creating_postgres_database.py
python first_vector_embedding.py

๐Ÿš€ Usage

1. Start the database sync process

python syncing_databases.py

2. Launch the Streamlit app

streamlit run insurance_agents_main.py

๐Ÿง  AI Agent Specializations

Agent Type Specialization Example Capabilities
Life Insurance Mortality risk assessment Term vs whole life analysis
Home Insurance Property valuation HO-3 vs HO-5 comparisons
Auto Insurance State compliance Liability coverage analysis

๐Ÿ” Technical Highlights

  • PostgreSQL Schema Design: Comprehensive data model with constraints

  • Vector Embeddings: OpenAI's text-embedding-3-large

  • Real-time Triggers: PostgreSQL LISTEN/NOTIFY

  • Agent Specialization: Strict domain boundaries

  • Streamlit UI: Custom CSS styling

๐Ÿงฎ Performance Metrics

  • Embedding Generation: ~100 records in 2 seconds
  • Query Response Time: 1.5โ€“3 seconds average
  • Database Sync: Sub-second latency

๐Ÿค Contributing

  1. Fork the project
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Open a Pull Request

๐Ÿ“œ License

Distributed under the MIT License.

๐Ÿ“ง Contact

Project Maintainer - Sam Joe Silvano Putti

Project Link: https://github.com/SamJoeSilvano/Insurance-Agentic-AI


๐Ÿ–ผ๏ธ Diagram

RAG Pipeline
Reality Augmented Generation(RAG) Pipeline Overview


๐Ÿ”ฎ Future Enhancements

  • Multi-language support
  • Voice interaction
  • PDF policy analysis

About

Insurance AI Assistant A smart system combining PostgreSQL, Milvus, and specialized AI agents (Life/Home/Auto) to answer insurance queries accurately. Features real-time sync, semantic search via OpenAI embeddings, and a Streamlit UI. Perfect for insurance tech demos or customer service augmentation.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published