add_memory
Store and associate text-based memories in the mem0 Memory System by providing content, user ID, and optional metadata, agent ID, or session ID for enhanced organization and retrieval.
Instructions
Stores a piece of text as a memory in Mem0.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
agentId | No | Optional agent ID to associate with the memory (for cloud API). | |
content | Yes | The text content to store as memory. | |
metadata | No | Optional key-value metadata. | |
sessionId | No | Optional session ID to associate with the memory. | |
userId | Yes | User ID to associate with the memory. |
Input Schema (JSON Schema)
{
"properties": {
"agentId": {
"description": "Optional agent ID to associate with the memory (for cloud API).",
"type": "string"
},
"content": {
"description": "The text content to store as memory.",
"type": "string"
},
"metadata": {
"description": "Optional key-value metadata.",
"type": "object"
},
"sessionId": {
"description": "Optional session ID to associate with the memory.",
"type": "string"
},
"userId": {
"description": "User ID to associate with the memory.",
"type": "string"
}
},
"required": [
"content",
"userId"
],
"type": "object"
}