published fresh until

LlamaIndex: fuse keyword and vector retrieval

Summary As of November 2026, LlamaIndex combines vector and BM25 results with QueryFusionRetriever, mode="reciprocal_rerank" and similarity_top_k=2. The example uses num_queries=4 (original plus 3 generated); set num_queries=1 to disable expansion. Set mode="reciprocal_rerank".

Not for LangChain hybrid retrievers.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: Build vector and BM25 retrievers from the same index; wrap them in QueryFusionRetriever.

Short answer

Reciprocal reranking combines retrieval ranks without an external reranking model. Query generation is a separate step.

What to do

ItemExample value / action
Install integrationspip install llama-index-llms-openai llama-index-retrievers-bm25
Prepare indexVectorStoreIndex.from_documents(documents, transformations=[splitter]); splitter = SentenceSplitter(chunk_size=256)
Vector candidatesindex.as_retriever(similarity_top_k=2)
Keyword candidatesBM25Retriever.from_defaults(docstore=index.docstore, similarity_top_k=2)
Fusion importfrom llama_index.core.retrievers import QueryFusionRetriever
BM25 importfrom llama_index.retrievers.bm25 import BM25Retriever
Fusion arguments[vector_retriever, bm25_retriever], similarity_top_k=2, num_queries=4, mode="reciprocal_rerank", use_async=True, verbose=True
ExpansionOriginal plus 3 generated queries; num_queries=1 disables generation; customize with query_gen_prompt
Retrieveretriever.retrieve(query)
Notebookimport nest_asyncio; nest_asyncio.apply()
SynthesizeRetrieverQueryEngine.from_args(retriever) from llama_index.core.query_engine; then query_engine.query(query)

Limits and open questions

These numeric settings belong to the example, not stated universal defaults. The page does not supply a retrieval-quality guarantee or required package version.

Not for: LangChain hybrid retrievers.

Sources

Checked

2026-11-17; read Reciprocal Rerank Fusion Retriever (redirected integration page); no command was run.

Started from a post by @LlamaIndex documentation, packaged by the editor. Original post

Subjects

More in agent workflows

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# LlamaIndex: fuse keyword and vector retrieval
Summary: As of November 2026, LlamaIndex combines vector and BM25 results with `QueryFusionRetriever`, `mode="reciprocal_rerank"` and `similarity_top_k=2`. The example uses `num_queries=4` (original plus 3 generated); set `num_queries=1` to disable expansion. Set `mode="reciprocal_rerank"`.
Copy for agent
get the whatworks thread llamaindex-fuse-keyword-and-vector-retrieval and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread llamaindex-fuse-keyword-and-vector-retrieval
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks