home
Mohamed Arbi Nsibi
Getting Started with Qdrant: Your First Vector Database in less than 10 Minutes

Getting Started with Qdrant: Your First Vector Database in less than 10 Minutes

July 27, 2025
· 0 views
Ever wondered how Spotify knows exactly what song you'll love next? Welcome to the world of vector databases - and today, we're diving into Qdrant, the speed demon of the vector database world.

Getting Started with Qdrant: Your First Vector Database in less than 10 Minutes

Ever wondered how Spotify knows exactly what song you’ll love next? Or how Google finds the perfect image when you search “cute cats wearing hats”? Welcome to the world of vector databases - and today, we’re diving into Qdrant, the speed demon of the vector database world.

What the Heck is a Vector Database Anyway?

Think of a traditional database like a filing cabinet. You store information in neat rows and columns, and when you want something, you ask for it exactly: “Give me all customers named John.” Simple, right?

But what if you wanted to ask: “Give me all the things that are similar to this thing I’m showing you?” That’s where vector databases shine. They’re like having a super-smart librarian who doesn’t just organize books alphabetically, but actually understands what each book is about and can recommend similar ones.

Qdrant (pronounced “quadrant”) is one of these smart librarians, but for your data. It turns your information into mathematical vectors (think of them as coordinates in a multi-dimensional space) and can find similar items lightning-fast.

Why Qdrant Will Make You Feel Like The Flash ⚡ Flash Here’s the cool part: Qdrant is ridiculously fast. We’re talking about 24 milliseconds to search through millions of vectors. To put that in perspective, it takes you about 300–400 milliseconds just to blink!

What makes it so speedy?

And the cherry on top? It’s completely free for up to 1 million vectors. That’s like getting a Ferrari with free gas for your first 100,000 miles!

Two Roads Diverged: Docker vs Python Setup 🛣️ Meme You have two main ways to get Qdrant running:

Let’s explore both!


The Docker Highway (Recommended for Most Humans)

What You’ll Need:

Step 1: Get Qdrant

docker pull qdrant/qdrant

This downloads Qdrant like downloading a movie from Netflix - but way faster.

Step 2: Start Your Vector Database

docker run -p 6333:6333 -p 6334:6334 \
-v "$(pwd)/qdrant_storage:/qdrant/storage:z" \
qdrant/qdrant

Don’t let this command scare you! Here’s what it does:

Step 3: Check if it’s alive

Open your browser and go to: http://localhost:6333/dashboard

Qdrant dashboard interface UI If you see a sleek dashboard, congratulations! You’ve just deployed your first vector database. Feel free to do a little victory dance. 💃


The Python Path (For the Code Lovers) 🐍

What You’ll Need:

Step 1: Install the Magic

pip install qdrant-client

Step 2: Create Your Database

from qdrant_client import QdrantClient

# Option 1: Keep everything in memory (like RAM)
client = QdrantClient(location=":memory:")
# Option 2: Save to your computer
client = QdrantClient(path="./my_vector_db")

That’s it! No Docker, no complications. Just pure Python simplicity.


Your First Vector Database: A City Similarity Finder 🌆

Let’s build something cool! We’ll create a system that finds similar cities based on some mysterious characteristics (represented as vectors).

Step 1: Connect to Your Database

from qdrant_client import QdrantClient

# If you used Docker:
client = QdrantClient(url="http://localhost:6333")
# If you used the Python route:
# client = QdrantClient(path="./my_vector_db")

Step 2: Create Your First Collection

Think of a collection like a folder where you’ll store similar types of data.

from qdrant_client.models import Distance, VectorParams

client.create_collection(
  collection_name="world_cities",
  vectors_config=VectorParams(size=4, distance=Distance.DOT),
)

What just happened?

Step 3: Add Some Cities

from qdrant_client.models import PointStruct

cities_data = [
  PointStruct(id=1, vector=[0.05, 0.61, 0.76, 0.74], payload={"city": "Berlin", "country": "Germany"}),
  PointStruct(id=2, vector=[0.19, 0.81, 0.75, 0.11], payload={"city": "London", "country": "UK"}),
  PointStruct(id=3, vector=[0.36, 0.55, 0.47, 0.94], payload={"city": "Moscow", "country": "Russia"}),
  PointStruct(id=4, vector=[0.18, 0.01, 0.85, 0.80], payload={"city": "New York", "country": "USA"}),
  PointStruct(id=5, vector=[0.24, 0.18, 0.22, 0.44], payload={"city": "Beijing", "country": "China"}),
  PointStruct(id=6, vector=[0.35, 0.08, 0.11, 0.44], payload={"city": "Mumbai", "country": "India"}),
]
operation_info = client.upsert(
  collection_name="world_cities",
  wait=True,
  points=cities_data,
)
print(f"Success! Operation status: {operation_info.status}")

What are these mysterious numbers? In a real application, these vectors might represent things like:

Step 4: Find Similar Cities

Now for the magic moment! Let’s find cities similar to some mystery location:

# Our mystery city vector
mystery_city = [0.2, 0.1, 0.9, 0.7]

search_result = client.query_points(
  collection_name="world_cities",
  query=mystery_city,
  with_payload=True,
  limit=3
).points
print("Cities most similar to our mystery location:")
for point in search_result:
  print(f"🏙️ {point.payload['city']}, {point.payload['country']} (similarity: {point.score:.3f})")

Expected Output:

Cities most similar to our mystery location:
🏙️ New York, USA (similarity: 1.362)
🏙️ Berlin, Germany (similarity: 1.273)
🏙️ Moscow, Russia (similarity: 1.208)

Cool, right? Qdrant just found the most similar cities in milliseconds!

Step 5: Add Some Filtering Magic

What if we want to find similar cities, but only in specific countries?

from qdrant_client.models import Filter, FieldCondition, MatchValue

# Find similar cities, but only in the UK
uk_search = client.query_points(
  collection_name="world_cities",
  query=mystery_city,
  query_filter=Filter(
    must=[FieldCondition(key="country", match=MatchValue(value="UK"))]
  ),
  with_payload=True,
  limit=3,
).points
print("Similar cities in the UK:")
for point in uk_search:
  print(f"🇬🇧 {point.payload['city']} (similarity: {point.score:.3f})")

Checking Your Handiwork 🔍

Visit http://localhost:6333/dashboard in your browser. You’ll see a beautiful interface where you can:

UI

Want to feel like a hacker? Try this in your terminal:

curl http://localhost:6333/collections

You’ll get a JSON response showing all your collections. Very Matrix-y!

Real-World Applications (Where This Actually Matters)

Now that you’ve got the basics, here’s where vector databases like Qdrant shine in the real world:

“Customers who bought this item also viewed…” - that’s Qdrant finding similar products.

Instead of searching for exact keywords, you can search by meaning. Ask for “fast cars” and get results for “speedy vehicles.”

Instagram uses similar tech to show you posts you’ll actually want to see.

Find similar legal documents, research papers, or even duplicate customer support tickets.

Spotify’s “Discover Weekly” uses vector similarity to find new songs you’ll love.

Taking It to the Next Level

Join the Community

Common Gotchas (Learn from My Mistakes!) ⚠️

What’s Next?

You now have a production-ready vector database running! Here are some fun projects to try:

Wrapping Up

Congratulations! You’ve just:

Vector databases might seem like magic, but they’re really just very smart mathematics working incredibly fast. And now you have that power at your fingertips.

The world of AI and machine learning is moving towards understanding meaning and similarity, not just exact matches. With Qdrant in your toolkit, you’re ready to build the next generation of intelligent applications.

Happy coding, and may your vectors always find their perfect matches! 🎯


Found this helpful? Give it a clap and follow for more beginner-friendly AI tutorials. Got questions? Drop them in the comments - I love helping fellow developers on their journey!


Useful Links:

(END)