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.
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.
- LangChain
- Ollama LLM
- FAISS Vector Store
- HuggingFace Embeddings
- RecursiveCharacterTextSplitter
- PromptTemplate
- Selenium WebDriver
- Extracting Web Data (UnstructuredURLLoader)
- LLM Chains & Function Invocation
- SystemMessage for AI role definition
- RAG-based Information Retrieval
- Llama3.2
- ConversationBufferMemory
- pathlib
- 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.
- 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
This project is licensed under the MIT License.
Please feel free to contribute to this project by submitting issues or pull requests.
Any enhancements, bug fixes, or optimizations are extremely welcomed!