This project provides a tool to extract and query information from PDFs and websites using Retrieval-Augmented Generation (RAG) techniques. It leverages Streamlit for the user interface, LangChain for text processing, and Hugging Face models for embeddings and language generation.
- Extract text from websites and PDFs
- Split text into manageable chunks
- Generate embeddings using Hugging Face models
- Perform similarity search on the text chunks
- Answer questions based on the extracted text
- Clone the repository:
git clone https://github.com/yourusername/rag-project.git cd rag-project - Create a virtual environment:
python -m venv venv source venv/bin/activate venv\Scripts\activate (for Windows)
- Install the required dependencies:
pip install -r requirements.txt
- Set up your environment variables:
- Create a .env file in the root directory.
- Add your Hugging Face API token to the .env file:
HUGGINGFACEHUB_API_TOKEN=your_huggingface_api_token
- Run the Streamlit app for websites:
streamlit run rag_web.py
- Enter the URL of the website you want to query.
- Ask your question in the provided input box.
- Run the Streamlit app for PDFs:
streamlit run rag_pdf.py
- Upload the PDF file you want to query.
- Ask your question in the provided input box.