Skip to main content
Glama

memory_hybrid_search

Combine keyword and semantic search to find relevant memories using reciprocal rank fusion. Filter results by metadata, date, tags, and adjust semantic weight for balanced results.

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?

With no annotations, the description provides significant behavioral context: it details the RRF algorithm, default preview mode, content_mode options, lineage follow modes, and suggests using memory_get for full content. However, it does not explicitly state that the tool is read-only or non-destructive, which is a minor gap.

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 a clear summary, then explains algorithm, then provides an Args section. The Args section is verbose but necessary given 0% schema coverage. Overall well-structured, though slightly long.

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 14 parameters, no schema descriptions, and presence of output schema, the description covers all parameters, algorithm, return format, and hints for full content retrieval. It is remarkably complete for a complex tool.

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 coverage is 0%, so the description carries full burden. It explains all 14 parameters with defaults, effects, and relationships (e.g., semantic_weight vs keyword weight, content_mode effects). This adds substantial meaning beyond the schema's names and types.

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 keyword (FTS) and semantic (vector) search using RRF. This distinguishes it from siblings like memory_semantic_search (pure semantic) and memory_list (simple list). The verb 'Perform' and resource 'hybrid search' are specific.

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

Usage Guidelines3/5

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

The description implies use when wanting better results than keyword or semantic alone, but does not explicitly contrast with alternatives like memory_semantic_search or memory_list. No 'when not to use' or explicit exclusions are provided, leaving usage guidance implicit.

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