This project demonstrates how to perform Retrieval-Augmented Generation (RAG) using Qdrant for vector storage and OpenAI for language generation. The setup involves loading documents, generating embeddings, storing them in Qdrant, and querying them to generate responses using OpenAI.
-
Clone the repository:
git clone https://github.com/yourusername/rag-with-qdrant.git cd rag-with-qdrant
-
Create a virtual environment (optional but recommended):
python -m venv venv source venv/bin/activate
-
Install the dependencies:
pip install -r requirements.txt
-
Ensure you have a running instance of Qdrant. You can use Docker to run Qdrant:
docker compose up -d
-
Create a
.env
file in the project directory and add your OpenAI API key:OPENAI_KEY=your-openai-api-key
Use the ingest.py
script to load and process documents, generate embeddings, and store them in Qdrant.
python ingest.py
Use the rag.py
script to query the vector database and generate responses using OpenAI.
python rag.py
- Qdrant: Ensure Qdrant is running on http://localhost:6333.
- OpenAI API Key: Store your OpenAI API key in a .env file in the project directory.
This project is licensed under the MIT License. See the LICENSE file for details.