Skip to main content
Glama
arunkumars-mf

mem0-agent-memory

search_memories

Retrieve relevant memories by natural language query to recall user preferences, project context, or past interactions, with optional filters for user, agent, or session.

Instructions

Search memories with semantic similarity and relevance filtering.

REQUIRED: 'query' - what to search for (natural language) OPTIONAL: 'user_id' OR 'agent_id' (if neither provided, auto-detects current user) OPTIONAL: 'run_id' - filter by session/run identifier OPTIONAL: 'limit' - max results to return (default: 10, also sets page_size if not specified) OPTIONAL: 'page' - page number for pagination (default: 1) OPTIONAL: 'page_size' - results per page (default: uses limit value)

Returns: Relevant memories filtered by maximum score threshold (configurable via MEM0_MAX_RELEVANCE_SCORE, default: 1000)

Score interpretation (FAISS uses L2 distance - lower is more similar):

  • 0-100: Very high similarity (near-exact matches)

  • 100-400: High similarity (closely related)

  • 400-600: Moderate similarity (somewhat related)

  • 600-1000: Low similarity (loosely related)

  • 1000+: Very low similarity (likely unrelated)

Note: Default threshold of 1000 keeps reasonably similar results. Lower to 400-600 for stricter filtering.

Examples:

  • Search user memories: {"query": "React patterns", "user_id": "john"}

  • Auto-detect user: {"query": "my project status"}

  • Limit results: {"query": "API endpoints", "limit": 3}

  • Session-scoped: {"query": "current task", "run_id": "session_123"}

  • Pagination: {"query": "all tasks", "page": 2, "page_size": 5}

Use for: Finding relevant code, recalling user preferences, retrieving project context.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNo
limitNo
queryYes
run_idNo
user_idNo
verboseNo
agent_idNo
page_sizeNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv1.3.2

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full behavioral burden and does so excellently. It explains FAISS L2 distance scoring, the relevance threshold default of 1000, the MEM0_MAX_RELEVANCE_SCORE configuration, auto-detection of the current user when neither user_id nor agent_id is supplied, and the limit/page_size interaction.

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 long but well-structured, front-loading required and optional parameters before adding examples and score interpretation. Every section serves a purpose: parameter semantics, score guidance, and usage context. The formatting with bold labels makes it easy for an agent to parse.

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 tool's complexity, eight parameters, and existing output schema, the description is thorough. It covers filtering behavior, pagination, user scoping, examples, threshold configuration, and practical use cases. The only minor omission, 'verbose', does not prevent correct invocation since it is an optional boolean with a schema default.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must add meaning to the raw parameter schema. It does this well for query, user_id, agent_id, run_id, limit, page, and page_size, including defaults and behavior. However, the 'verbose' parameter is not explained at all, leaving one parameter without semantic context.

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 memories with semantic similarity and relevance filtering." This clearly distinguishes it from sibling tools like list_memories and search_by_metadata by specifying the semantic similarity mechanism.

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 gives explicit parameter expectations (REQUIRED vs OPTIONAL), tangible examples, and a 'Use for' section naming concrete scenarios like finding code, recalling preferences, and retrieving project context. It does not explicitly compare against sibling alternatives such as search_by_metadata, so it falls just short of a 5.

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

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/arunkumars-mf/mem0-agent-memory'

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