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
Behavior4/5

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

With no annotations provided, the description carries the full burden. It discloses key behavioral traits: it's a search operation (implies read-only), automatically injects 'user_id' into filters if not provided, and includes examples of filter logic. However, it doesn't cover aspects like rate limits, authentication needs, or error handling.

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 well-structured and front-loaded with the core purpose, followed by practical examples and an important note. Every sentence earns its place by providing actionable guidance without redundancy, making it efficient for an AI agent to parse.

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 moderate complexity (4 parameters, semantic search functionality) and no annotations, the description does a good job covering usage and filter logic. With an output schema present, it doesn't need to explain return values. However, it could benefit from more explicit guidance on when to use this tool versus siblings.

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 100%, so the baseline is 3. The description adds value by explaining filter usage with concrete examples and noting that 'user_id is automatically added to filters if not provided,' which clarifies parameter behavior beyond the schema's generic descriptions. It doesn't detail '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.' It specifies the verb ('search') and resource ('memories'), but doesn't explicitly differentiate from sibling tools like 'get_memories' or 'get_memory' which might retrieve memories without semantic search.

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 usage through examples of filter patterns, suggesting when to use this tool (for filtered semantic searches). However, it doesn't explicitly state when to choose this over alternatives like 'get_memories' or 'list_entities', nor does it mention prerequisites or exclusions.

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/mem0ai/mem0-mcp'

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