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
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | Text to store as a memory. Converted to messages format internally. | |
| messages | No | Structured conversation history (role/content dicts). When provided, takes precedence over text. | |
| user_id | No | User scope identifier. Defaults to MEM0_USER_ID. | |
| agent_id | No | Agent scope identifier. | |
| run_id | No | Run scope identifier. | |
| metadata | No | Arbitrary metadata JSON to store alongside the memory. | |
| infer | No | If true (default), LLM extracts key facts. If false, stores raw text. | |
| enable_graph | No | Override default graph toggle for this call. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |