Skip to main content
Glama

add_memory

Store conversation history or text as retrievable memory in a self-hosted system, organizing it by user, agent, or run identifiers for future reference.

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.

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