Skip to content

Likhith083/Insurance-Policy-RAG

Repository files navigation

Insurance Policy RAG Web Application

A comprehensive web application that allows users to upload insurance policy documents (PDF, Word, Text) and interact with them using RAG (Retrieval Augmented Generation) technology.

Features

  • 📁 Document Upload: Support for PDF, DOCX, and TXT files
  • 🔍 Vector Search: ChromaDB for efficient document embeddings
  • 🤖 AI Chat: Interactive chat with insurance documents via Ollama
  • 📊 Document Management: View, manage, and delete uploaded documents
  • 🎯 Semantic Search: Find relevant information across all documents
  • 💬 Context-Aware Responses: Answers based on uploaded documents
  • 📱 Responsive UI: Modern React interface

Tech Stack

Backend

  • FastAPI: High-performance Python web framework
  • ChromaDB: Vector database for embeddings
  • Ollama: Local LLM for embeddings and chat
  • PyPDF2: PDF text extraction
  • python-docx: Word document processing
  • Uvicorn: ASGI server

Frontend

  • React: Modern UI framework
  • Tailwind CSS: Utility-first CSS framework
  • Axios: HTTP client
  • React Router: Client-side routing

Prerequisites

  1. Python 3.8+
  2. Node.js 16+
  3. Ollama installed and running locally
    # Install Ollama from https://ollama.ai
    # Pull required models
    ollama pull llama3.2:3b
    ollama pull mxbai-embed-large:latest

Installation

Backend Setup

cd backend
pip install -r requirements.txt

Frontend Setup

cd frontend
npm install

Running the Application

Start Backend

cd backend
uvicorn main:app --reload --port 8000

Start Frontend

cd frontend
npm start

The application will be available at:

Usage

  1. Upload Documents: Drag and drop or select insurance policy files
  2. Processing: Documents are automatically processed and vectorized
  3. Chat: Ask questions about your insurance policies
  4. Search: Use semantic search to find specific information
  5. Manage: View and delete uploaded documents

API Endpoints

  • POST /upload: Upload and process documents
  • POST /chat: Chat with documents
  • GET /documents: List all uploaded documents
  • DELETE /documents/{doc_id}: Delete a document
  • POST /search: Semantic search across documents

Configuration

Environment variables can be set in .env file:

  • OLLAMA_BASE_URL: Ollama server URL (default: http://localhost:11434)
  • CHROMADB_PATH: ChromaDB storage path (default: ./chroma_db)
  • MAX_FILE_SIZE: Maximum upload file size in MB (default: 50)

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors