Skip to content

A Question Answering(Q/A) Chatbot on Insurance Documents. Powered by Retrieval Augmented Generation(RAG), LlamaIndex and LangGraph. Inspired from my Upgrad_IIITB PG Course.

License

Notifications You must be signed in to change notification settings

SandeepGitGuy/Insurance_Documents_QA_Chatbot_RAG_LlamaIndex_LangGraph

Repository files navigation

Insurance Documents QA RAG Chatbot

Your Intelligent Chat Assistant for Insurance and General Queries

GitHub license Python


✨ About the Project

This chatbot leverages the advanced capabilities of LangGraph to deliver precise and context-aware responses. It dynamically retrieves data from insurance documents or conducts web searches based on user queries, enabling a seamless and intelligent interaction. LangGraph's graph-based orchestration and stateful design ensure optimal performance for multi-agent workflows.


🔍 Key Features

  • Sophisticated Query Resolution: Handles document-specific and general queries using intelligent orchestration.
  • Efficient Data Retrieval: Utilizes LlamaIndex for focused and accurate insurance data extraction.
  • Agentic Generation: Implements LangGraph's stateful framework to manage dynamic agent interactions.
  • Scalable Embedding Storage: Employs ChromaDB for efficient data storage and query operations.
  • 🔑 Advanced Caching: Integrates multi-layer caching at embedding and query levels for enhanced efficiency.
  • 🔄 Dynamic Workflow Management: LangGraph ensures flexible and optimized agent transitions.
  • 🕒 Real-Time Adaptability: Determines the most suitable workflow (document retrieval or web search) on-the-fly.

🛠️ Tech Stack

  • Language: Python
  • Frameworks/Libraries: LangGraph, LangChain, LlamaIndex, ChromaDB
  • APIs/Models:
    • OpenAI's Embedding Model for vector creation
    • OpenAI for high-quality generative responses
    • LlamaIndex for document ingestion and querying
    • LangGraph for agent orchestration and state management
    • ChromaDB for efficient data storage.

🧪 Example Use Cases

  • "What are the exclusions in my insurance policy?"
  • "How do I claim accidental insurance?"
  • "What is Drug Abuse related death?" (via web search)

📸 Sample Output

1. Insurance Query Response

Insurance Query Response


🚀 Getting Started

Prerequisites

Ensure you have the following installed:

  • Python 3.8+
  • Docker (optional, for containerized deployment)

Installation

  1. Clone the repo: git clone https://github.com/SandeepGitGuy/Insurance_Documents_QA_Chatbot_RAG_LlamaIndex_LangGraph.git

  2. Navigate to the project directory: cd Insurance_Documents_QA_Chatbot_RAG_LlamaIndex_LangGraph

  3. Install the required dependencies: pip install -r requirements.txt

  • Please note: OpenAI API keys are required for the project to function.
  1. Run the main file from Jupyter environment: "Insurance_Docs_QA_Chatbot_RAG_Llamaindex_LangGraph.ipynb"

🚂 Challenges Faced and Fixes

  • Agent Workflow Design: Designed robust state graphs for agent interactions using LangGraph.
  • Caching Optimization: Enhanced efficiency by introducing caching layers for embeddings and responses.
  • Workflow Customization: Exploited LangGraph's graph-based orchestration for flexible agent transitions.
  • Error Recovery: Implemented memory-driven recovery mechanisms for enhanced reliability.

🌐 Future Scope

  • Extend support for multi-language documents and diverse file formats.
  • Incorporate additional generative AI models.
  • Leverage LangGraph's advanced features for interactive and hierarchical agent workflows.

🔗 Documentation

No documentation will be made available for this project since this project only uses technologies that already have their own documentation. Please refer to the following links for more information:


🛡️ Conclusion

The Insurance Documents QA RAG Chatbot powered by LangGraph exemplifies cutting-edge agentic design and multi-agent orchestration. By harnessing LangGraph's stateful workflow management, it delivers precise, adaptable, and scalable query responses. This chatbot not only addresses the challenges of document-based and general queries but also optimizes agent transitions and workflows dynamically. It stands as a testament to the potential of graph-based orchestration frameworks in building intelligent, context-aware conversational agents.


🛡️ License

Distributed under the MIT License. See LICENSE for more details.


💬 Contact

For questions, feedback, or collaboration opportunities: