multi-query

Generate multiple query variants and fuse results with Reciprocal Rank Fusion.

6|1|Updated Aug 11, 2025
One-click install
npx skills add https://github.com/juanre/llmemory --skill multi-query
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: multi-query
Source: https://github.com/juanre/llmemory/tree/main/skills/multi-query
Command: npx skills add https://github.com/juanre/llmemory --skill multi-query

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Multi-query expansion improves search recall by generating multiple variants of a user query, querying each variant, and fusing results using Reciprocal Rank Fusion (RRF) to yield a unified, deduplicated result set.

Core Features & Use Cases

  • Variant generation: heuristic keyword variants, OR variants, and exact phrase variants to widen recall without relying on large language models.
  • Fusion strategy: combine results from all variants using Reciprocal Rank Fusion to boost chunks appearing across variants.
  • Flexible deployment: supports heuristic mode by default and optional LLM-based expansion for semantic diversity, with per-query configuration and performance tuning.

Quick Start

Enable query expansion for a hybrid search to generate multiple variants and fuse results with RRF. Example: memory.search(owner_id='workspace-1', query_text='improve customer retention', search_type=SearchType.HYBRID, query_expansion=True, max_query_variants=3, limit=10).

Frequently Asked Questions about multi-query

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How does multi-query expansion improve vector search recall?

Multi-query expansion improves vector search recall by generating multiple query variants, executing searches for each, and fusing the deduplicated results using Reciprocal Rank Fusion (RRF) to boost consistently relevant chunks.

How do I generate query variants without using an LLM?

You can generate query variants without an LLM by using heuristic mode, which automatically creates keyword variants through stopword removal, OR logic, and exact phrase matching to widen search recall.

What is Reciprocal Rank Fusion in hybrid search?

Reciprocal Rank Fusion (RRF) is a fusion strategy that combines and deduplicates result sets from multiple query variants, boosting chunks that appear across different variant searches to yield a unified list.

Can I use LLM-based query expansion for semantic search diversity?

Yes, you can enable optional LLM-based expansion to generate semantically diverse query variants, providing an alternative to the default heuristic keyword generation for handling ambiguous queries.

How do I configure per-query overrides for multi-query search?

You can apply per-query overrides and performance tuning by configuring parameters such as search_type, query_expansion, max_query_variants, and limit directly within your hybrid search request.

When should I use multi-query expansion for information retrieval?

Use multi-query expansion for information retrieval when facing ambiguous or under-specified queries, as generating multiple variants and fusing results with RRF ensures efficient, accurate recall across hybrid vector and text scenarios.