This project is a medical Q&A chatbot named Aegis, built using LangChain, Hugging Face, and Groq. It's designed to answer questions based on a provided set of PDF documents. The chatbot uses a Retrieval-Augmented Generation (RAG) architecture to find relevant information in the documents before generating a response.
Try Aegis now: https://aegis--the-ai-medical-chatbot-l2mrvkzmomehccz2hvssv8.streamlit.app/
- Retrieval-Augmented Generation (RAG): Aegis retrieves information from a knowledge base (PDFs) to provide accurate answers.
- Fast and Efficient: Utilizes the high-performance Groq API for rapid inference.
- Persistent Memory: Uses FAISS for an efficient vector store to remember and retrieve information from the documents.
- Streamlit Interface: Provides a user-friendly web interface for interaction.
- Load and Process Documents: PDF files from the
data/directory are loaded and split into smaller chunks. - Create Embeddings: The
sentence-transformers/all-MiniLM-L6-v2model is used to convert the text chunks into numerical vectors (embeddings). - Vector Store: These embeddings are stored in a FAISS vector database (
vectorstore/db_faiss). This acts as the chatbot's long-term memory. - User Query: When a user asks a question, the query is also converted into an embedding.
- Retrieval: Aegis retrieves the most semantically similar text chunks from the FAISS database.
- Generation: These retrieved chunks, along with the user's question, are fed to a large language model (LLM) hosted by Groq to generate a final, contextually relevant answer.
- Python 3.8+
- A Groq API Key and a Hugging Face API token.
git clone https://github.com/your-username/your-repository-name.git
cd your-repository-name