Skip to main content
Glama

add_memory

Store a new memory in the mem0 self-hosted system. Provide text or conversation messages, scoped by user, agent, or run IDs. Optionally include metadata, control LLM inference, and enable graph relations.

Instructions

Store a new memory. Requires at least one of user_id, agent_id, or run_id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
textYesText to store as a memory. Converted to messages format internally.
messagesNoStructured conversation history (role/content dicts). When provided, takes precedence over text.
user_idNoUser scope identifier. Defaults to MEM0_USER_ID.
agent_idNoAgent scope identifier.
run_idNoRun scope identifier.
metadataNoArbitrary metadata JSON to store alongside the memory.
inferNoIf true (default), LLM extracts key facts. If false, stores raw text.
enable_graphNoOverride default graph toggle for this call.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

With no annotations, the description carries full burden but only states 'Store a new memory.' It omits behavioral traits such as whether this is a write operation, side effects, or authorization needs. The constraint on scope IDs is noted but insufficient for full transparency.

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 two sentences, front-loaded with the core purpose. Every word adds value, and there is no unnecessary repetition.

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

Completeness3/5

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

Given the tool's complexity (8 parameters, output schema exists), the description is adequate but incomplete. It does not clarify behavior for parameters like 'infer' or 'enable_graph,' though these are documented in the schema. Output schema mitigates need for return value explanation, but the description could provide more behavioral context.

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. The description adds value by stating that at least one of user_id, agent_id, or run_id is required—a cross-parameter constraint not explicit in the schema alone. This justifies a score above baseline.

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 clearly states 'Store a new memory,' which is a specific verb+resource. It distinguishes this from sibling tools like delete_memory or get_memories, which have different purposes.

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 includes a requirement ('at least one of user_id, agent_id, or run_id'), which provides context for valid invocations. However, it does not offer guidance on when to use this tool versus alternatives like search_memories or update_memory.

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

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