Skip to content

Retrieval-Augmented Generation (RAG) with Qdrant and OpenAI

License

Notifications You must be signed in to change notification settings

jannctu/RAG-with-Qdrant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Retrieval-Augmented Generation (RAG) with Qdrant and OpenAI

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.

Table of Contents

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/rag-with-qdrant.git
    cd rag-with-qdrant
  2. Create a virtual environment (optional but recommended):

    python -m venv venv
    source venv/bin/activate
  3. Install the dependencies:

    pip install -r requirements.txt

Setup

  1. Ensure you have a running instance of Qdrant. You can use Docker to run Qdrant:

    docker compose up -d
  2. Create a .env file in the project directory and add your OpenAI API key:

    OPENAI_KEY=your-openai-api-key

Ingesting Documents

Use the ingest.py script to load and process documents, generate embeddings, and store them in Qdrant.

python ingest.py

Running the RAG Script

Use the rag.py script to query the vector database and generate responses using OpenAI.

python rag.py

Configuration

  • 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.

License

This project is licensed under the MIT License. See the LICENSE file for details.

About

Retrieval-Augmented Generation (RAG) with Qdrant and OpenAI

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages