hybrid-search

Merge semantic and keyword retrieval with configurable alpha and RRF fusion in Python.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Hybrid search solves the challenge of delivering high-quality results by merging semantic vector similarity with exact keyword matching.

Core Features & Use Cases

  • Hybrid retrieval: merges vector similarity and BM25-like keyword matching using Reciprocal Rank Fusion for a unified ranking.
  • Configurable weighting: adjustable alpha to balance semantic and lexical signals according to query type.
  • Use Case: Build a search interface that understands intent and surfaces exact terms like product codes or model numbers.

Quick Start

Install llmemory and dependencies, then initialize a memory instance and execute a hybrid search with a sample query to observe blended results.

Frequently Asked Questions about hybrid-search

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

FAQPage Schema
How does hybrid search combine semantic and keyword matching?

Hybrid search applies Reciprocal Rank Fusion (RRF) to merge vector similarity scores with BM25-like keyword matching results. This fusion approach ensures that both semantic intent and exact lexical terms are accurately reflected in the final unified ranking.

How do I tune the balance between semantic and lexical search results?

You can tune the balance between semantic and lexical search results using a configurable alpha parameter. Adjusting this alpha weight allows you to prioritize vector similarity or exact keyword matching depending on your specific query type and data requirements.

When should I use hybrid search instead of standard vector search?

Use hybrid search instead of standard vector search when your queries require exact keyword matching for specific terms like product codes or model numbers alongside semantic intent. It delivers significantly improved relevance for catalogs, documentation, and general search tasks with mixed query patterns.

Does hybrid search require specific vector database backends to function?

Hybrid search supports pluggable vector and text search backends in Python using the llmemory library. This architecture allows you to configure parallel retrieval pipelines without being locked into a single specific vector database dependency.

How do I execute a basic hybrid search query in Python?

To execute a hybrid search query in Python, install the llmemory library and its dependencies, initialize a memory instance, and run a sample query. The system will execute parallel vector and text retrieval, applying fusion to output blended results.