Qdrant’s Recommendation API enables you to find similar items based on examples rather than explicit vectors. This approach is ideal for “more like this” features, recommendation engines, and exploration interfaces.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/qdrant/qdrant/llms.txt
Use this file to discover all available pages before exploring further.
Basic Recommendations
Find items similar to positive examples and dissimilar to negative examples.Simple Recommendation Query
Python Example
How Recommendations Work
Strategy: Best Score (Default)
Finds items that are most similar to ANY positive example and least similar to ALL negative examples. Scoring algorithm:- Calculate similarity to each positive and negative example
- Take maximum similarity to positives
- Take maximum similarity to negatives
- If max_positive > max_negative: return sigmoid(max_positive)
- Otherwise: return -sigmoid(max_negative)
The sigmoid transformation ensures scores are in a bounded range and positive examples always rank higher than negative ones.
Strategy: Average Vector
Use"strategy": "average_vector" to compute the average of positive examples (minus negatives) and search for similar items:
Recommendation Strategies
- Best Score
- Average Vector
When to use: Finding items similar to ANY exampleCharacteristics:
- More diverse results
- Good for exploration
- Handles heterogeneous examples well
Discovery Search
Find items similar to a target, but specifically in the context defined by positive/negative pairs.Discovery Query
How Discovery Works
Discovery uses context pairs to define a desired direction in vector space:- Each context pair defines a “good direction” (from negative toward positive)
- Candidates are ranked by:
- Similarity to target
- Being on the “correct side” of each context pair
Use Cases for Discovery
Analogical Search
“Find products like A, but make them more like B and less like C”
Style Transfer
“Show me shoes similar to this one, but in a more casual style”
Semantic Directions
“Find documents similar to this, but more technical and less marketing”
Exploration
“Navigate from current item toward a desired attribute”
Discovery Example
Context Search
Find items that satisfy multiple context constraints without a specific target.Context Query
Context-only search (without target) finds points that best satisfy all context pairs. This is useful for multi-attribute filtering in embedding space.
Scoring for Context-Only
Using Vectors Directly
Provide vectors instead of point IDs:Recommendation with Filters
Combine recommendations with payload filtering:Python with Filters
Lookup from Another Collection
Use examples from a different collection:products collection using vectors from user_preferences collection.
Advanced Techniques
Multi-Vector Recommendations
When using named vectors, specify which to use:Batch Recommendations
Recommend for multiple queries at once:Score Threshold
Only return results above a score threshold:Real-World Examples
E-commerce: Similar Products
Content Platform: Personalized Feed
Music Discovery
Best Practices
Choose the Right Strategy
Choose the Right Strategy
- Best Score: When examples are diverse or you want exploration
- Average Vector: When examples are homogeneous or you want focused results
Balance Positive and Negative Examples
Balance Positive and Negative Examples
Too many negatives can overly constrain results. Generally use 3-5 positives and 1-2 negatives.
Use Filters Wisely
Use Filters Wisely
Combine recommendations with business rules via filters:
- Stock availability
- Price ranges
- Content ratings
- Geographic restrictions
Handle Cold Start
Handle Cold Start
For new users without history:
- Use popular items as initial positives
- Leverage demographic or context data
- Fall back to trending/featured items
Monitor Score Distributions
Monitor Score Distributions
Track recommendation scores to ensure quality:
- Low scores may indicate poor examples
- Consistent scores suggest insufficient diversity
Performance Considerations
- Recommendations are slightly slower than direct vector search (need to fetch example vectors first)
- Use
average_vectorstrategy for better performance with many examples - Batch recommendation requests when possible
- Consider caching recommendations for popular items
Related Topics
- Search API - Basic vector search capabilities
- Filtering - Combine recommendations with payload filters
- Named Vectors - Use different vector spaces for recommendations