Skip to content

srinivasangr/Rag-chatbot-from-pdf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

6 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🧠 Ask Your PDF: Semantic Search & Chatbot using Qdrant, LangChain, and OpenAI

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.

Architecture


πŸš€ Features

  • Load any PDF document
  • Split and embed using SentenceTransformer
  • Store in Qdrant vector database
  • Query using natural language
  • Retrieve semantic context
  • Generate concise answers using OpenAI GPT-4 or GPT-3.5

🧰 Tech Stack


πŸ“¦ Installation

1. Clone the Repository

git clone https://github.com/srinivasangr/Rag-chatbot-from-pdf.git
cd Rag-chatbot-from-pdf

2. Create a Virtual Environment

python -m venv venv
source venv/bin/activate  # Windows: venv\Scripts\activate

3. Install Dependencies

pip install -r requirements.txt

4. Set Environment Variables

Create a .env file in the root directory:

OPENAI_API_KEY=your_openai_api_key

πŸ§ͺ Run the Application

  1. Start Qdrant (via Docker)
docker run -p 6333:6333 -p 6334:6334 qdrant/qdrant
  1. Run the Script
python app.py

πŸ“ File Structure

β”œβ”€β”€ app.py β”œβ”€β”€ mahabharata.pdf β”œβ”€β”€ .env β”œβ”€β”€ requirements.txt └── README.md

About

Semantic search chatbot

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages