Skip to main content
The MemMachine Model Context Protocol (MCP) tools provide a dedicated, simplified interface for Large Language Models (LLMs) to interact with the memory system. These endpoints are designed to be concise and perform the core functions of memory management: adding new context and searching for existing context. These tools automatically write to both Episodic Memory (short-term conversation history) and Semantic Memory (long-term user profile and facts).

1. add_memory

Summary

Store important new information about the user or conversation into memory.

Description

Use this automatically whenever the user shares new facts, preferences, plans, emotions, or other details that could be useful for future context. Crucially, include the full conversation context in the content field — not just a snippet. This tool writes to both short-term (episodic) and long-term (profile) memory, so that future interactions can recall relevant background knowledge even across different sessions.

Parameters

NameTypeRequiredDescriptionDefault
contentstringYesThe complete context or summary to store in memory.
user_idstringNoThe unique identifier of the user whose memory is being updated. This ensures the new memory is stored under the correct profile.user-{mac_address}
proj_idstringNoProject ID. Defaults to mcp-{user_id} if user_id is provided.mcp-{user_id} or mcp-{mac_address}
org_idstringNoOrganization ID.mcp-universal

Responses

Status CodeDescription
200Success
422Invalid or unprocessable content (e.g., failed to embed).
500MemMachine is not initialized or internal error.

2. search_memory

Summary

Retrieve relevant context, memories, or profile information for a user.

Description

Use this whenever context is missing or unclear, or when you need to recall what has been previously discussed, even if it was from an earlier conversation or session. This searches both Profile Memory (long-term user traits and facts) and Episodic Memory (past conversations and experiences) for the most relevant results.

Parameters

NameTypeRequiredDescriptionDefault
querystringYesThe current user message or topic of discussion to search against.
top_kintegerNoThe maximum number of memory entries to retrieve.20
user_idstringNoThe unique identifier of the user whose memory is being searched.user-{mac_address}
proj_idstringNoProject ID. Defaults to mcp-{user_id} if user_id is provided.mcp-{user_id} or mcp-{mac_address}
org_idstringNoOrganization ID.mcp-universal

Responses

TypeDescription
SearchResultReturns the relevant context, memories, or profile data on success.
McpResponseReturns an error status/message on failure (e.g., MemMachine not initialized).
422Invalid or unprocessable content.
500MemMachine is not initialized or internal error.