Skip to content

The project uses Memory Based- RAG for healthcare queries, searching FAISS vector database for relevant answers. If no results are found, an AI fallback mechanism steps in. The AI Agent employs Selenium headless drivers, automation, web scraping, etc techniques to enhance search efficiency, ensuring accurate, real-time responses.

License

Notifications You must be signed in to change notification settings

sambhu431/Healthcare-Assistant-RAG-Integrated-AI-Agent

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LLM Healthcare-Assistant-RAG-Integrated-AI-Agent

Project Overview

LLM Healthcare-Assistant-RAG-Integrated-AI-Agent is an AI-powered system designed to provide reliable healthcare-related responses using Memory Based Retrieval-Augmented Generation (RAG) and AI Agent.

  • Primary Approach: Searches FAISS vector database for answers.

  • Memory: Saves conversations between user and AI.

  • Fallback Mechanism: If no relevant results are found, an AI agent dynamically generates a response using Selenium-driven web automation, web scraping, and crawling techniques.

  • Search Optimization: Utilizes DuckDuckGo, structured querying, and real-time data extraction for precise answers.


Features & Workflow

Vector Database Search:

  • Retrieves healthcare-related answers from FAISS-based embeddings.
  • Uses HuggingFace embeddings for storing and fetching relevant content.

Fallback Mechanism (AI-Agent Driven Response):

  • If no valid results exist in the vector database, the AI agent autonomously takes over.
  • Uses Selenium headless drivers for automated searches and retrievals.

Intelligent Web Search & Data Extraction:

  • Generates search-engine-friendly queries using "query_chain".
  • Fetches structured content from URLs with "UnstructuredURLLoader".
  • Cleans extracted data and refines meaningful insights with "process_extracted_content".

Conversational Memory & Interaction:

  • Integrates conversation history using ConversationBufferMemory.
  • Utilizes LangChain’s chat-based prompting for structured responses.

Tech Stack & Libraries Used

Prerequisites

  1. LangChain
  2. Ollama LLM
  3. FAISS Vector Store
  4. HuggingFace Embeddings
  5. RecursiveCharacterTextSplitter
  6. PromptTemplate
  7. Selenium WebDriver
  8. Extracting Web Data (UnstructuredURLLoader)
  9. LLM Chains & Function Invocation
  10. SystemMessage for AI role definition
  11. RAG-based Information Retrieval
  12. Llama3.2
  13. ConversationBufferMemory
  14. pathlib

How It Works (Step-by-Step Execution)

  • User submits a healthcare-related query.
  • Vector database (FAISS) is searched using embeddings.
  • If a valid response is found, it is returned to the user.
  • Utilizes ConversationBufferMemory for llm to have memory.
  • If no answer exists, the AI agent activates DuckDuckGo Search + Selenium Automation.
  • Web scraping extracts relevant data, cleans it, and returns a structured response.
  • AI memory and retrieval mechanisms ensure accurate follow-up interactions.

Future Enhancements

  • Integrate additional vector databases for larger knowledge retrieval
  • Fine-tune query generation using NLP models for optimized search
  • Expand AI agent's automation capabilities using multi-layered crawling
  • Enhance real-time data extraction for up-to-date healthcare responses

License

This project is licensed under the MIT License.

Contributions

Please feel free to contribute to this project by submitting issues or pull requests.

Any enhancements, bug fixes, or optimizations are extremely welcomed!

About

The project uses Memory Based- RAG for healthcare queries, searching FAISS vector database for relevant answers. If no results are found, an AI fallback mechanism steps in. The AI Agent employs Selenium headless drivers, automation, web scraping, etc techniques to enhance search efficiency, ensuring accurate, real-time responses.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published