Qdrant is a vector database built for AI applications — semantic search, recommendation systems, and RAG pipelines. REST and gRPC APIs with filtering and payload storage.
Setup
docker run -p 6333:6333 qdrant/qdrant
Create Collection
const response = await fetch('http://localhost:6333/collections/products', {
method: 'PUT',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
vectors: { size: 384, distance: 'Cosine' }
})
});
Index Documents with Embeddings
import { QdrantClient } from '@qdrant/js-client-rest';
const client = new QdrantClient({ url: 'http://localhost:6333' });
// Upsert points with vectors and payload
await client.upsert('products', {
points: [
{
id: 1,
vector: await getEmbedding('Wireless bluetooth headphones with noise cancellation'),
payload: { name: 'Headphones', price: 89.99, category: 'audio' }
},
{
id: 2,
vector: await getEmbedding('Mechanical keyboard with Cherry MX switches'),
payload: { name: 'Keyboard', price: 129.99, category: 'peripherals' }
}
]
});
Semantic Search
const queryVector = await getEmbedding('good headphones for music');
const results = await client.search('products', {
vector: queryVector,
limit: 5,
filter: {
must: [{ key: 'price', range: { lte: 100 } }]
},
with_payload: true
});
// Returns headphones (semantically similar) under $100
Recommendation API
const recommendations = await client.recommend('products', {
positive: [1, 5], // IDs user liked
negative: [3], // IDs user disliked
limit: 10,
filter: { must: [{ key: 'category', match: { value: 'audio' } }] }
});
REST API
# Search
curl -X POST http://localhost:6333/collections/products/points/search \
-d '{"vector":[0.1,0.2,...],"limit":5,"filter":{"must":[{"key":"category","match":{"value":"audio"}}]}}'
# Get collection info
curl http://localhost:6333/collections/products
# Scroll through points
curl -X POST http://localhost:6333/collections/products/points/scroll \
-d '{"limit":10,"with_payload":true}'
Why This Matters
- Built for AI: First-class support for embeddings and RAG
- Filtering: Combine vector search with exact filters
- Payload storage: Store metadata alongside vectors
- Fast: Written in Rust, optimized for billion-scale
Need custom AI search or vector database tools? I build developer tools. Check out my web scraping actors on Apify or reach out at spinov001@gmail.com for custom solutions.
Top comments (2)
In my experience with AI integration, the real challenge isn't just selecting a vector database but effectively using agents to leverage its potential. Many teams underutilize agents by not fully integrating them into their AI workflows. Agents can automate the retrieval and processing tasks, making semantic search and recommendations significantly more efficient. Rather than just storing vectors, think about how agents can dynamically interact with them to drive real-time insights and actions.
One surprising insight is that the toughest part of integrating Qdrant or any vector database isn't the tech itself, but aligning it with your existing data workflows. In our experience, teams often overlook the importance of ensuring their data pipelines are optimized for vector operations, leading to inefficient searches and poor performance. Think about how your data is structured and processed - it's crucial for unlocking the full potential of semantic search and recommendation systems.