Git Product home page Git Product logo

arpan65 / insurance-rag-chatbot Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 16.75 MB

Insurance-RAG-Chatbot(IVA): An open-source project featuring a retrieval-augmented chatbot developed using Bedrock, LLM, LangChain, Docker, and more. Contribute to advancing insurance interaction with the power of open collaboration

Home Page: https://youtu.be/1su9Ymr__wY

Python 15.72% Dockerfile 1.04% CSS 53.99% JavaScript 6.60% TypeScript 5.94% HTML 15.85% Shell 0.86%
aws bedrock langchain rag

insurance-rag-chatbot's Introduction

IVA: Retrieval-Augmented-Generation Chatbot

IVA(Insurance Virtual Agent) is a prototype chatbot designed to retrieve and generate answers to policy holders' queries based on policy documents. The chatbot leverages AWS Bedrock and other AWS services such as Lambda, EC2, S3, along with LangChain and Docker, to deliver efficient and accurate responses.

IVA Screensot

Features

  • Retrieval-Augmented-Generation (RAG): Combines retrieval of relevant document snippets with natural language generation to provide detailed answers.
  • AWS Integration: Utilizes AWS Bedrock for the language model, with infrastructure support from AWS Lambda, EC2, and S3.
  • LangChain Framework: Employs LangChain for building and managing the conversation flow and document retrieval.
  • Dockerized Deployment: Packaged in Docker for easy deployment and scaling.

Architecture

IVA Architecture

Components

  1. AWS Bedrock: Provides the core language model capabilities for understanding and generating natural language responses.
  2. AWS Lambda: Used for serverless computing tasks to handle backend processes and integrations.
  3. Amazon EC2: Hosts the chatbot application and handles processing tasks.
  4. Amazon S3: Stores policy documents and vector embeddings for quick retrieval.
  5. LangChain: Framework used to integrate the language model with document retrieval mechanisms.
  6. Docker: Ensures the chatbot can be easily deployed, managed, and scaled across different environments.

How It Works

  1. Document Ingestion: Policy documents are ingested and stored in Amazon S3.
  2. Vectorization: Documents are vectorized using embeddings and stored for efficient retrieval.
  3. User Query: A policy holder submits a query through the chatbot interface.
  4. Retrieval: The chatbot retrieves relevant document snippets based on the query.
  5. Generation: Using the retrieved snippets, the chatbot generates a detailed response.
  6. Response Delivery: The generated response is sent back to the user.

Getting Started

Prerequisites

  • AWS account with necessary permissions for Bedrock, Lambda, EC2, and S3.
  • Docker installed on your local machine or server.
  • Python installed for running LangChain and other necessary scripts.

Installation

  1. Clone the repository:

    git clone https://github.com/arpan65/Insurance-RAG-Chatbot
    cd Insurance-RAG-Chatbot
  2. Set up AWS services:

    • Ensure you have the required IAM roles and permissions for accessing bedrock from the chatbot.
    • Set up AWS Bedrock Model Permissions and EC2 instances as needed.
  3. Deploy the chatbot on EC2:

    • Deploy the chatbot on EC2 using the commands in setup/chatbotdeploy.txt file.
  4. Deploy the AWS Services:

    npm install -g aws-cdk
    cdk bootstrap aws://YOUR-AWS-ACCOUNT-ID/YOUR-AWS-REGION
    cdk deploy

    This will create and configure the following resources:

    • S3 bucket for hosting the static website and deploying the contents of the website directory automatically.
    • S3 bucket for storing document sources.
    • IAM roles for Lambda functions.
    • Lambda functions for document processing and embedding generation.
    • S3 event notifications to trigger Lambda functions.
    • Update the chatbot URL in website/index.html.
  5. Configure Nginx for HTTPS (optional):

    • If you need to secure your application with HTTPS, set up Nginx as a reverse proxy and configure SSL certificates.

Usage

  • Create a /docs folder in rag-source bucket.
  • Upload the policy document in the docs folder with proper naming convention (i.e sample_policy_doc_{policy number}.
  • Browse the static webpage from the S3 website bucket.
  • Access the chatbot interface from the webpage.
  • Enter your policy ID and submit queries to get detailed responses based on your policy documents.

Example Questions for Demo

  • Accidental Damage Coverage: "What is covered under accidental damage in my policy?"

  • Damage to Underground Pipes: "Does my policy cover damage to underground pipes?"

  • Exclusions for Storm Damage: "What are the exclusions for storm damage in my policy?"

  • Claim Process for Fixed Glass Breakage: "How do I claim for accidental breakage of fixed glass according to my policy?"

  • Limits for Finding Damage Source: "What are the limits for finding the source of damage to my home in my policy?"

Troubleshooting

  • Ensure all AWS services are correctly configured and accessible.
  • Check Docker logs for any errors during container runtime.
  • Verify that all required ports are open and not blocked by security groups or firewalls.

Contributing

Contributions are welcome! Please fork the repository and submit pull requests for any enhancements or bug fixes.

License

This project is licensed under the MIT License.

insurance-rag-chatbot's People

Contributors

arpan65 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.