MCP HubMCP Hub
Вернуться к навыкам

qdrant-hybrid-search-prefetches

qdrant
Обновлено 5 days ago
154
18
154
Посмотреть на GitHub
Другоеgeneral

О программе

Этот навык помогает разработчикам реализовать гибридный поиск в Qdrant, объединяя лексический (ключевые слова/BM25) и семантический (плотные векторы) поиск в одном запросе. Он объясняет использование API `prefetch` для параллельного поиска по разным векторным представлениям или запросам и правильной настройки индексации полезной нагрузки. Используйте его, когда требуется объединить разреженные/плотные методы поиска или оптимизировать стратегии поиска по нескольким полям.

Быстрая установка

Claude Code

Рекомендуется
Основной
npx skills add qdrant/skills -a claude-code
Команда плагинаАльтернативный
/plugin add https://github.com/qdrant/skills
Git клонированиеАльтернативный
git clone https://github.com/qdrant/skills.git ~/.claude/skills/qdrant-hybrid-search-prefetches

Скопируйте и вставьте эту команду в Claude Code для установки этого навыка

Документация

Different Searches in One Query API Request

Each prefetch runs exactly one search per one query.

Understand if user wants to run several parallel searches on:

  1. The same vector representations but different queries or filters.
  2. Different vector representations but the same raw query.

If first, help user to design logic of constructing query or/and filters on application side and then check Combining Searches. Don't forget to create indices on filterable payload fields, immediately after collection creation, prior to building HNSW, so filterable HNSW could be constructed.

If second, use named vectors, which allow to store multiple vector types per point in one collection. Beware that named vectors currently can be configured only at collection creation. To choose vectors, check following recommendations.

Missed Keyword Matches

Use when: pure vector search misses exact term or keyword matches and you need lexical retrieval alongside semantic search.

Most likely you need a sparse vector for exact text search alongside the dense one. Qdrant uses sparse vectors for lexical searches, as payload filtering doesn't provide any ranking score.

Choose a Sparse Vector for Text

  • BM25 statistical representations, built into Qdrant core (computed server-side). Good baseline, works out-of-domain, usually for long texts. Can be used for non-English content, but needs to be configured per language (tokenization, stemming, stopwords, etc) at indexing and retrieval time. More in Text Search Guide
  • BM42 learned sparse, based on BM25, but better for small chunks of text & with meaning understanding. Works only on English. Requires fine-tuning for domain-specific retrieval. Requires FastEmbed (Python/REST only, not available in all SDKs). Not maintained.
  • miniCOIL learned sparse, BM25 with additional understanding of words meaning in context. Works only on English. Requires fine-tuning for domain-specific retrieval. Requires FastEmbed. Usage shown in FastEmbed miniCOIL documentation.
  • SPLADE++ learned sparse with term expansion. Heavier inference and resources usage but better performance due to term expansion. Requires fine-tuning for domain-specific retrieval. Provided in Qdrant Cloud Inference and FastEmbed versions work only on English. To use with FastEmbed, check FastEmbed SPLADE documentation.
  • External learned sparse embeddings, for example BAAI/bge-m3.

What to remember when using sparse vectors for lexical search:

  • tokenization and stemming affect exact matches, especially on custom codes, terms, etc.

What to remember when using Qdrant BM25 and miniCOIL (based on BM25):

  • avg_len in formula is not computed server-side, it is a user responsibility and passed as a parameter
  • BM25 might be not good for small chunks of text, as BM25 algorithm was initially created for search on long documents; consider adjusting document statistics in sparse vectors (TF & IDF, k, b).
  • Qdrant BM25 vectors are configured per language, so consider customizing stop words, stemming & tokenization when users documents mix several languages or carefully configure vectors per point when they are monolingual.

More on Sparse Vectors for Text Search

Need to Combine Multiple Representations of the Same Item

Use when: the same item is embedded in multiple ways (e.g. different models, languages, or modalities) and you want to search across different representations in one request (don't have to be all of them, can be even one).

Use multiple named vector prefetches, each prefetch covers one representation.

  • If you have groups and subgroups of representations (document -> chunk, image -> patch), you could use searching in groups. To not store identical payloads several times, check Lookup in Groups

You can also search directly on multivectors, a matrix of dense vectors, in a prefetch.

However, it comes with several considerations, as multivectors were designed to support late interaction models using max similarity metric, so it's impossible to retrieve the list of individual max similarity scores for each query vector.

Moreover, multivectors are rarely a good pick for prefetch:

There are ways to make multivector retrieval cheaper (MUVERA, pooling), you can see more in "Evaluating Tradeoffs of Multi-stage Multi-vector Search"

What NOT to Do

  • Choose any search method (for example, BM25) without evaluation of its quality & resources used.
  • Use any search method (for example, BM25) without paying attention to the specifics of their configuration and applicability to the use case.

GitHub репозиторий

qdrant/skills
Путь: skills/qdrant-search-quality/search-strategies/hybrid-search/search-types
0
agent-skillsai-agentsclaude-codecodexcursorembeddings

Похожие навыки

llamaguard

Другое

LlamaGuard — это модель от Meta с 7–8 миллиардами параметров для модерации входных и выходных данных больших языковых моделей по шести категориям безопасности, таким как насилие и разжигание ненависти. Она обеспечивает точность 94–95% и может быть развернута с помощью vLLM, Hugging Face или Amazon SageMaker. Используйте этот навык, чтобы легко интегрировать фильтрацию контента и защитные механизмы в ваши ИИ-приложения.

Просмотреть навык

cost-optimization

Другое

Этот навык Claude помогает разработчикам оптимизировать облачные расходы за счет правильного подбора ресурсов, стратегий тегирования и анализа затрат. Он предоставляет framework для сокращения облачных расходов и внедрения управления затратами в AWS, Azure и GCP. Используйте его, когда вам нужно проанализировать расходы на инфраструктуру, оптимизировать ресурсы или уложиться в бюджетные ограничения.

Просмотреть навык

quantizing-models-bitsandbytes

Другое

Этот навык выполняет квантизацию LLM до 8-битной или 4-битной точности с использованием библиотеки bitsandbytes, обеспечивая сокращение использования памяти на 50-75% при минимальной потере точности. Он идеально подходит для запуска больших моделей при ограниченной памяти GPU или для ускорения вывода, поддерживая форматы INT8, NF4 и FP4. Навык интегрируется с HuggingFace Transformers и позволяет использовать обучение QLoRA и 8-битные оптимизаторы.

Просмотреть навык

dispatching-parallel-agents

Другое

Этот навык Claude распределяет нескольких агентов для исследования и устранения трёх и более независимых проблем параллельно. Он предназначен для сценариев с несвязанными сбоями, которые можно устранить без общего состояния или зависимостей. Ключевая возможность — параллельное решение проблем, где за каждую независимую предметную область назначается отдельный агент для максимальной эффективности.

Просмотреть навык