Skip to main content
Glama

Mem0 Cloud

Store memories from a conversation, like mem0's add

add_memory

Store memories from a conversation, like mem0's add: an AI model extracts durable facts about the user from the messages (or, with infer=false, stores each message as is), embeds them and saves them privately under your memory_key (a secret string you generate; required). Identical facts are stored once. Needs at least one of user_id, agent_id, app_id, run_id. Memories are kept for 365 days. Returns {event_id, status, results:[{id, memory, event: ADD|NONE}]}. Price: $0.008 a call (3 free calls a day without an API key).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
inferNoDefault true: extract facts with the model. false: store each message verbatim (up to 10 messages of 300 characters)
app_idNoEntity: the app (1-128 characters)
run_idNoEntity: the session or run (1-128 characters)
user_idNoEntity: the user the memories are about (1-128 characters)
agent_idNoEntity: the agent the memories belong to (1-128 characters)
excludesNoOptional: what not to extract
includesNoOptional: what to focus on when extracting
messagesYesConversation turns, each {role: user|assistant|system, content: string}; up to 6000 bytes as JSON. A plain string is also accepted (one user message).
metadataNoCustom key/value metadata stored with every memory (up to 2000 bytes as JSON)
memory_keyYesYour secret: a random string of 16-256 characters that you generate once and keep (also accepted as the X-Memory-Key header). Memories are stored and searched only under its hash, so nobody who lacks it can read them, whatever user_id they send. Lose it and the memories are unreachable.
expiration_dateNoOptional YYYY-MM-DD: the memory is hidden from search and listing after that day (unless show_expired is true)
custom_instructionsNoOptional extra extraction instructions (with includes and excludes, up to 800 bytes together)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: dedup ('Identical facts are stored once'), 365-day retention, security model (stored under the hash of memory_key, unrecoverable if lost), billing ($0.008/call, 3 free/day), and the return shape. These are exactly the behavioral traits an agent cannot infer from the schema.

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?

One dense paragraph, front-loaded with the core store-and-extract behavior before secondary facts (retention, price, return shape). Nearly every clause earns its place, though the parentheticals about pricing and key secrecy make it read as a wall of text rather than cleanly chunked guidance.

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?

For a 12-parameter, nested-object tool with no output schema, the description supplies the missing return shape, the entity-identity requirement, retention and cost, and the security contract. An agent has everything needed to call it correctly without opening anything else.

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 coverage is 100%, so baseline is 3, but the description adds real meaning beyond the schema: the cross-parameter constraint 'needs at least one of user_id, agent_id, app_id, run_id' is not expressible in the required list, and it explains memory_key's secret/hashing semantics and the infer flag's effect. Minor loss only because excludes/includes/custom_instructions interplay is not elaborated.

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?

States a precise verb+resource ('Store memories from a conversation') and immediately names the model-based extraction behavior plus the mem0 analog. It is clearly separable from siblings delete_memories, get_memories and search_memories, which are the retrieval/deletion counterparts of this write path.

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?

Gives concrete usage conditions: at least one of user_id/agent_id/app_id/run_id is needed, memory_key is required, and infer=false switches to verbatim storage. It does not explicitly say when to reach for this tool over search_memories or how to follow up after storing, so it stops short of full when/when-not guidance.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources