<<<<<<< HEAD
A simple Retrieval-Augmented Generation (RAG) project using LangChain, FAISS, and OpenAI GPT on a custom PDF.
- Extracts text from PDF
- Chunks and indexes text with FAISS
- Retrieves relevant context and answers questions using GPT
-
Clone the repo:
git clone https://github.com/your-username/your-repo.git cd your-repo -
Create and activate a virtual environment:
python -m venv venv venv\Scripts\activate -
Install dependencies:
pip install -r requirements.txt -
Add your OpenAI API key to a
.envfile:OPENAI_API_KEY=your_openai_api_key -
Place your PDF (e.g.,
deep learning.pdf) in the project folder.
-
Extract text from PDF:
python extract_pdf.py -
Chunk the text:
python chunk_text.py -
Build the FAISS index:
python build_faiss_index.py -
Ask questions using GPT:
python rag_with_gpt.py
- Do not commit your
.envfile or API keys. - The
faiss_index/folder is ignored for security and size reasons.
A simple RAG system
4599b97c5d8bf431e46de393882aef4638306595