Skip to main content
Glama
redis

Redis MCP Server

Official
by redis

hybrid_search

Filter documents by metadata before ranking by vector similarity to enable production RAG and semantic search pipelines.

Instructions

Perform a hybrid search combining a Redis filter expression with KNN vector similarity.

Hybrid search pre-filters documents by metadata before ranking by vector similarity — the standard pattern for production RAG and semantic search pipelines.

Filter expression examples: "*" → no filter, pure vector search (same as vector_search_hash) "@category:{news}" → tag filter "@year:[2020 2024]" → numeric range "@lang:{en} @year:[2022 +inf]" → combined tag + range "@title:redis" → full-text match on a text field

Full filter syntax: https://redis.io/docs/latest/develop/interact/search-and-query/query/

Args: query_vector: List of floats to use as the query vector. filter_expression: Redis filter expression to restrict candidates before KNN ranking. Defaults to '*' (no filter). index_name: Name of the Redis index (default: 'vector_index'). vector_field: Name of the indexed vector field (default: 'vector'). k: Number of nearest neighbors to return. return_fields: Additional fields to include in results (optional).

Returns: A list of matched documents with their similarity score, or an error message.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
query_vectorYes
filter_expressionNo*
index_nameNovector_index
vector_fieldNovector
kNo
return_fieldsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description details the hybrid search process (pre-filter then rank) and expected output (list with similarity score or error), but does not explicitly state that it is a read-only operation, though implied. No annotations are present to contradict.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is concise and well-structured: an introductory sentence, explanation, examples, syntax link, and an Args list. Every part adds value.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity, zero schema coverage, and presence of an output schema, the description covers usage, parameters, and return format adequately for an agent to select and invoke the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, but the description includes an Args section that explains each parameter, provides defaults, and gives filter expression examples, adding significant meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool performs a hybrid search combining Redis filter expression with KNN vector similarity, and distinguishes from pure vector search by noting that using '*' as filter equals vector_search_hash.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains when to use the tool (for pre-filtering before vector search in production RAG) and provides filter expression examples, but does not explicitly state when to use alternatives like vector_search_hash.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/redis/mcp-redis'

If you have feedback or need assistance with the MCP directory API, please join our Discord server