Skip to main content
Glama
mem0ai

Mem0 MCP Server

Official
by mem0ai

search_memories

Search stored memories using natural language queries and filters to find relevant information based on user, agent, or time criteria.

Instructions

Run a semantic search over existing memories.

    Use filters to narrow results. Common filter patterns:
    - Single user: {"AND": [{"user_id": "john"}]}
    - Agent memories: {"AND": [{"agent_id": "agent_name"}]}
    - Recent memories: {"AND": [{"user_id": "john"}, {"created_at": {"gte": "2024-01-01"}}]}
    - Multiple users: {"AND": [{"user_id": {"in": ["john", "jane"]}}]}
    - Cross-entity: {"OR": [{"user_id": "john"}, {"agent_id": "agent_name"}]}

    user_id is automatically added to filters if not provided.
    

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesNatural language description of what to find.
filtersNoAdditional filter clauses (user_id injected automatically).
limitNoMaximum number of results to return.
enable_graphNoSet true only when the user explicitly wants graph-derived memories.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations provided, the description carries full burden and adds valuable behavioral context. It discloses that 'user_id is automatically added to filters if not provided' - an important implementation detail not evident from the schema. It also provides practical filter patterns showing how the tool behaves with different query structures. However, it doesn't mention rate limits, authentication requirements, or pagination behavior.

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

Conciseness3/5

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

The description is appropriately front-loaded with the core purpose, but the extensive filter examples (5 patterns) make it somewhat lengthy. While the examples are helpful, they could potentially be streamlined. Every sentence earns its place by providing practical guidance, but the structure could be more concise.

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

Completeness4/5

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

Given the tool's complexity (semantic search with filtering), no annotations, but with complete schema coverage and an output schema, the description provides good contextual coverage. It explains the core search behavior, provides practical filter examples, and discloses the automatic user_id injection. The presence of an output schema means the description doesn't need to explain return values. However, for a search tool with no annotations, it could benefit from mentioning performance characteristics or result ordering.

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?

With 100% schema description coverage, the baseline is 3. The description adds meaningful value by explaining filter usage patterns with concrete examples, showing how the 'filters' parameter works in practice. It also clarifies the automatic user_id injection behavior, which enhances understanding beyond the schema's technical description. However, it doesn't provide similar context for 'enable_graph' or 'limit' parameters.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Run a semantic search over existing memories.' This specifies the verb ('search') and resource ('memories'), and the semantic aspect distinguishes it from simple filtering. However, it doesn't explicitly differentiate from sibling tools like 'get_memories' or 'list_entities'.

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 provides implied usage context through filter examples and the note about automatic user_id injection, suggesting this is for retrieving memories with semantic matching. However, it lacks explicit guidance on when to use this tool versus alternatives like 'get_memories' (which appears to be a simpler retrieval) or 'list_entities'.

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