Qdrant - Vector Database
Discovery Search and Context Search
"More of the same" recommendations get boring fast. Discovery Search enables genuine exploration - when users want something new but not random, guided by their own taste.
- Netflix-like recommendations: "like this, but in a different genre"
- Fashion recommendation: balancing between office and casual style
- Iterative RAG refinement: users mark irrelevant results to guide the next query
Предварительные знания
Three Exploration Modes: Search, Recommend, Discover
Qdrant offers three different search paradigms at the core, each solving a different exploration problem. Understanding the distinction allows you to pick the right tool for each use case.
| Mode | Input | Semantics | Use case |
|---|---|---|---|
| Search | query vector | Nearest to query in the space | Find something similar to what I'm searching for |
| Recommend | positive + negative IDs | Similar to positive, dissimilar to negative | "More like this" / "Not like this" |
| Discover | target + context pairs | target guided by context | Exploration: "like A, but in the style of B" |
| Context | context pairs only | Golden middle between pairs | No specific query, only constraints |
**Discovery** is the most nuanced mode. It accepts a `target` (desired direction) and `context` (positive/negative pairs defining a "zone"). Results are found in the region satisfying the context constraints, shifted toward the target. This is not just recommend with constraints - the underlying algorithm differs at the core.
Discovery does not require a query vector from an embedder - only IDs of existing points. This makes it ideal for UI-driven exploration: the user clicks 'like/dislike', the system builds context without needing to recompute embeddings.
What is the fundamental difference between Discovery and Recommend?
Context Search: Finding the Golden Middle
**Context Search** is Discovery without a target. Only pairs (positive, negative). Qdrant finds points that sit at the "golden middle": closer to positive than to negative, satisfying all pairs simultaneously. This is not a recommendation - it's a search for balance.
**Use cases for Context Search:** 1. **Personalization without query history**: the user has only indicated what they like and dislike, without a specific search term 2. **Multimodal exploration**: positives are text descriptions, negatives are images (with multimodal embeddings) 3. **Creative search**: "like jazz, but not classical" - helps discover something new in an unfamiliar zone 4. **Negative-example driven**: sometimes it's easier to say what you DON'T want than what you do
Context Search shines combined with filters. Add `filter: {must: [{key: 'price_range', match: {value: 'mid'}}]}` - and the balance search will be constrained to the desired price range.
Context Search is just Recommend with multiple negative examples
Context Search defines a zone of space through pairs, not through separate positive/negative lists
In Recommend, positive and negative are independent lists. In Context, pairs define directions relative to each other. The result is not 'most similar to all positives' but 'points inside all context zones'.
What result does pure Context Search (Discovery without target) return?
Discovery in Production: MMR, Diversity, Relevance Feedback
Three advanced mechanisms for production recommendation and RAG systems: **MMR** (Maximal Marginal Relevance) for diversity, **Relevance Feedback** for iterative refinement, and the right choice between recommend and discovery for different tasks.
**When to use what:** - **ANN Search** → you have a clear query (text/image) - **Recommend** → the user has a browsing history, likes/dislikes - **Discovery** → exploration: the user wants something new but in a certain "spirit" - **Context Search** → personalized feed without an explicit query
Which mode is most suitable for a personalized feed without an explicit search query?
Summary
- Search → ANN nearest to query; Recommend → positive/negative lists; Discovery → target + context zones
- Context Search (Discovery without target) finds the 'golden middle' between all context pairs
- Discovery requires no embedder - only IDs of existing points in the collection
- Relevance Feedback (v1.17+): iterative refinement via Discovery with user feedback
- Production pattern: Recommend for 'more like this', Discovery for exploration, Context for personalized feed
What's Next
Discovery covers the algorithmic level. The final lesson dives into Qdrant internals: ACORN, Inline Storage, Gridstore.
- ACORN, Inline Storage, Gridstore — Qdrant v1.16-17 internal algorithms: how they speed up filtered search
- Recommend API — Foundations: recommend as the predecessor to discovery
- Universal Query — Unified API for all search modes including discovery
Вопросы для размышления
- How would you explain the difference between Recommend and Discovery to a product manager? Give a real example from your product.
- What should you consider when building a Relevance Feedback system to prevent a filter bubble?
- How could Context Search be used for A/B testing different recommendation styles?