Skip to main content
Glama

memory_hybrid_search

Combine keyword and semantic search with reciprocal rank fusion to find relevant memories using a single query, with optional date, tag, and metadata filters.

Instructions

Perform a hybrid search combining keyword (FTS) and semantic (vector) search.

Uses Reciprocal Rank Fusion (RRF) to merge results from both search methods, providing better results than either method alone.

Returns compact previews by default. Use content_mode="full" for complete content. Use memory_get to fetch full content for specific IDs.

Args: query: Search query text semantic_weight: Weight for semantic results (0-1). Higher values favor semantic similarity. Keyword weight = 1 - semantic_weight. Default: 0.6 (60% semantic, 40% keyword) top_k: Maximum number of results to return (default: 10) min_score: Minimum combined score threshold (default: 0.0) metadata_filters: Optional metadata filters date_from: Optional date filter (ISO format or relative like "7d", "1m", "1y") date_to: Optional date filter (ISO format or relative) tags_any: Match memories with ANY of these tags (OR logic) tags_all: Match memories with ALL of these tags (AND logic) tags_none: Exclude memories with ANY of these tags (NOT logic) content_mode: "preview" (default) returns truncated content_preview; "full" returns complete content preview_chars: Max chars for preview (default: 300, ignored when content_mode="full") fields: Optional list of fields to return. Include "score" to keep {memory, score} envelope; omit "score" for flat list of memory dicts. follow: Lineage mode — "latest" resolves each result to its current version, "active" excludes superseded memories, "full_history" expands supersession chains.

Returns: Dictionary with count and list of results, each containing score and memory

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
semantic_weightNo
top_kNo
min_scoreNo
metadata_filtersNo
date_fromNo
date_toNo
tags_anyNo
tags_allNo
tags_noneNo
content_modeNopreview
preview_charsNo
fieldsNo
followNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

No annotations exist, so the description carries full burden. It details the hybrid approach, RRF fusion, default preview mode, and the follow parameter for lineage modes, covering key behavioral traits without contradictions.

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

Conciseness4/5

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

The description is front-loaded with purpose and method, followed by a structured parameter list. While thorough, it could be slightly more concise given the length, but the detail is justified by the tool's complexity.

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?

Despite 14 parameters and an output schema, the description covers all inputs, explains the output format (dictionary with count and results), and references related tools (memory_get), providing complete contextual information.

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 provides detailed explanations for all 14 parameters, including defaults, ranges (e.g., semantic_weight 0-1), and the meaning of each field, adding significant value 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 'Perform a hybrid search combining keyword (FTS) and semantic (vector) search' using RRF, distinguishing it from pure semantic search (sibling memory_semantic_search) and listing tools.

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?

It explains that RRF provides 'better results than either method alone,' implying use when both keyword and semantic relevance matter. It also references memory_get for full content retrieval, but doesn't explicitly state when not to use this tool.

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/agentic-box/memora'

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