Skip to main content
Welcome! This walkthrough demonstrates how simple it is to run a vector database locally using Qdrant and connect to it from a Jupyter Notebook with the official Python client. We’ll cover a minimal local setup (Docker), a ready-to-run container image that bundles Qdrant + Jupyter, and example Python snippets to create collections, insert embeddings, and run basic queries. This guide is ideal for developers experimenting with embeddings, similarity search, or building retrieval-augmented generation (RAG) prototypes.

Quick overview

  • Start a Qdrant instance locally (Docker).
  • Connect from a Jupyter Notebook using qdrant-client.
  • Create a collection, upsert sample points (vectors + payload), and run simple retrieval/inspection APIs.

Prerequisites

Connect from a Jupyter Notebook

The simplest import and connection looks like this:
This creates a client for the default local Qdrant HTTP endpoint (http://localhost:6333) or uses a QDRANT_URL environment variable if provided.

Requirements (notebook / container)

Add at minimum the following to your requirements.txt:
You can extend this list with your favorite embedding libraries (Transformers, sentence-transformers, OpenAI client, etc.) depending on how you generate embeddings.

Container image (Dockerfile)

This demo uses a Docker image that pulls the official Qdrant image and prepares a workspace with Python and Jupyter. Use this concise Dockerfile:

Build and run (local)

Build and run the container locally:
Qdrant exposes its HTTP API on port 6333 by default; 6334 is for gRPC. Jupyter (if used) typically runs on port 8888.
You can manage Qdrant via its dashboard (HTTP) or entirely through the Python client — the UI is mostly for administrative convenience.

Verify connection from the notebook

After starting Qdrant, run the connection cell in your notebook. Example (same as above to verify connectivity):

List collections (showing collections like tables in an RDBMS)

Programmatically list collections to confirm connectivity and inspect existing collections:

Open the Qdrant dashboard from the notebook (optional)

Display a link to the dashboard inside a Jupyter environment:

Create or recreate a collection

Define a collection to store vectors and recreate it (note: this deletes an existing collection with the same name before creating a new one). Use VectorParams to set the vector dimensionality and distance metric:
recreate_collection will delete an existing collection with the same name. Use with caution in production environments to avoid accidental data loss.

Insert points (vectors + payload)

Insert a few sample vectors (called points) along with payload metadata:

Inspect stored points

For small datasets, the scroll API is a convenient way to retrieve stored points:

What is a vector?

A vector is a list of numeric values (floats) representing an embedding for a piece of data (text, image, etc.). The vector dimensionality must match the size specified in VectorParams. Vector similarity search (nearest-neighbor search) is based on distance metrics such as cosine or euclidean.

Next steps / Common workflows

Once embeddings are stored in the vector database, typical next steps include:
  • Running nearest-neighbor similarity searches with client.search or client.search_with_payload.
  • Integrating into a RAG pipeline: store document embeddings and retrieve relevant passages at query time.
  • Combining metadata filtering with vector search for more precise retrieval.
  • Packaging the notebook or application as a Docker image and deploying to Kubernetes for production.
Examples of other vector databases you may consider:
  • Qdrant (this lesson)
  • ChromaDB
  • LanceDB
  • Pinecone
  • Weaviate

References and further reading

Thanks for following along — see you in the next lesson.

Watch Video

Practice Lab