This project implements a Retrieval-Augmented Generation (RAG) chatbot using Streamlit. The chatbot can answer user queries by retrieving context from uploaded documents (PDF or text) and generating responses using a language model. It supports processing and storing documents in a vector database, enabling efficient similarity searches.
- File Upload: Supports PDF and text files for document uploads.
- Text Extraction: Extracts text from uploaded files and splits it into manageable chunks for vector storage.
- Custom Embeddings: Uses a tailored embedding model for document indexing and similarity search.
- Query Handling: Handles natural language queries with context-based responses.
- Dynamic Interface: Interactive chat interface using Streamlit.
- Error Handling: Alerts users about unsupported file types, empty files, and large uploads.
- Streamlit: For creating the web interface.
- LangChain: For document processing, embeddings, and prompt management.
- Chroma: As the vector database for similarity search.
- PyPDF2: For PDF text extraction.
- Custom Embeddings: For tailored representation of document text.
- OpenAI GPT-4o: For natural language understanding and response generation.
Ensure you have the following installed:
- Python 3.11+
- Pip
-
Clone the repository:
git clone https://github.com/satvika-eda/RAG_based_document_assistant.git cd RAG_based_document_assistant -
Create and activate a virtual environment:
python -m venv venv source venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
- Replace the
REPLACE_MEfor the OPENAI_API_KEY variable in the config.py by creating a new openai key. - Execute the App using :
streamlit run streamApp.py
- Start the application using the command above. The interface will open in your browser.
- Upload a file (PDF or text) using the "📎 Attach File" button.
- Once the file is processed, you can ask questions related to its content in the chat box.
- View responses generated by the chatbot in real-time.