Skip to main content
Glama

search_memory

Search memories by query, tags, or date range, with semantic search and pagination. Review-due items blend into results to naturally reinforce long-term retention.

Instructions

Search for memories with optional filters and scoring.

This tool implements natural spaced repetition by blending memories due for review into results when they're relevant. This creates the "Maslow effect" - natural reinforcement through conversation.

Pagination: Results are paginated to help you find specific memories across large result sets. Use page and page_size to navigate through results. If a search term isn't found on the first page, increment page to see more results.

Args: query: Text query to search for (max 50,000 chars). tags: Filter by tags (max 50 tags). top_k: Maximum number of results before pagination (1-100). window_days: Only search memories from last N days (1-3650). min_score: Minimum decay score threshold (0.0-1.0). use_embeddings: Use semantic search with embeddings. include_review_candidates: Blend in memories due for review (default True). page: Page number to retrieve (1-indexed, default: 1). page_size: Number of memories per page (default: 10, max: 100).

Returns: Dictionary with paginated results including: - results: List of matching memories with scores for current page - pagination: Metadata (page, page_size, total_count, total_pages, has_more)

Some results may be review candidates that benefit from reinforcement.

Examples: # Get first page (10 results) search_memory(query="authentication", page=1, page_size=10)

# Get next page
search_memory(query="authentication", page=2, page_size=10)

# Larger page size
search_memory(query="authentication", page=1, page_size=25)

Raises: ValueError: If any input fails validation.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
tagsNo
queryNo
top_kNo
min_scoreNo
page_sizeNo
window_daysNo
use_embeddingsNo
include_review_candidatesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

With no annotations provided, the description fully carries the burden of behavioral disclosure. It explains the spaced-repetition blending ('Maslow effect'), pagination behavior, default values, return structure, and that ValueError is raised on invalid input. This goes far beyond what the schema or annotations provide.

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 well-structured with clear sections (Args, Returns, Examples, Raises) and each sentence adds useful context. It is somewhat verbose, especially the multiple pagination examples, but the length is justified by the complexity of the tool.

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?

The description is complete: it covers all 9 parameters, return data structure, pagination behavior, exceptions, defaults, and usage examples. The presence of an output schema does not need to be repeated, and the description adds everything needed for correct invocation.

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?

Although the schema has no per-parameter descriptions, the tool description explicitly explains every parameter's purpose, constraints, and defaults (e.g., 'query: Text query to search for (max 50,000 chars)', 'page_size: Number of memories per page (default: 10, max: 100)'). This adds substantial meaning beyond the bare schema definitions.

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 opens with a specific verb and resource: 'Search for memories with optional filters and scoring.' It clearly differentiates from sibling tools like search_unified by describing the unique 'Maslow effect' spaced-repetition blending behavior, making the tool's purpose immediately identifiable.

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 clearly explains when to use the tool — when searching memories with pagination and review blending. It provides detailed pagination instructions ('If a search term isn't found on the first page, increment page') and examples. However, it does not explicitly mention when not to use it or contrast with sibling tools like search_unified.

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/fastmcp-me/cortexgraph'

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