This project enables you to upload a PDF document and interact with it through a chatbot powered by vector search and OpenAI. It leverages LangChain, SentenceTransformer, Qdrant, and OpenAI GPT-4 to perform document chunking, embedding, similarity search, and conversational responses.
- Load any PDF document
- Split and embed using
SentenceTransformer - Store in
Qdrantvector database - Query using natural language
- Retrieve semantic context
- Generate concise answers using OpenAI GPT-4 or GPT-3.5
- Python 3.11+
- LangChain
- SentenceTransformers
- Qdrant
- OpenAI API
- PyPDFLoader
git clone https://github.com/srinivasangr/Rag-chatbot-from-pdf.git
cd Rag-chatbot-from-pdfpython -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activatepip install -r requirements.txtCreate a .env file in the root directory:
OPENAI_API_KEY=your_openai_api_key- Start Qdrant (via Docker)
docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant- Run the Script
python app.pyβββ app.py βββ mahabharata.pdf βββ .env βββ requirements.txt βββ README.md
