curl --request POST \
--url https://api.memmachine.ai/v2/memories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>",
"episode_type": "message",
"metadata": {},
"produced_for": "",
"producer": "user",
"role": "",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"project_id": "",
"types": [
"episodic",
"semantic"
]
}
'{
"results": [
{
"uid": "<string>"
}
]
}Add memory messages to a project.
The types field in the request specifies which memory types to add to:
types is empty or not provided, memories are added to all types (episodic and semantic)types only contains "episodic", memories are added only to Episodic memorytypes only contains "semantic", memories are added only to Semantic memorytypes contains both, memories are added to both typesEach memory message represents a discrete piece of information to be stored in the project’s memory system. Messages can include content, metadata, timestamps, and other contextual details.
The producer field indicates who created the message, while the produced_for field specifies the intended recipient. These fields help provide context for the memory and if provided should be user-friendly names.
The endpoint accepts a batch of messages to be added in a single request.
curl --request POST \
--url https://api.memmachine.ai/v2/memories \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"messages": [
{
"content": "<string>",
"episode_type": "message",
"metadata": {},
"produced_for": "",
"producer": "user",
"role": "",
"timestamp": "2023-11-07T05:31:56Z"
}
],
"project_id": "",
"types": [
"episodic",
"semantic"
]
}
'{
"results": [
{
"uid": "<string>"
}
]
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Specification model for adding memories.
A list of messages to be added (batch input). Must contain at least one message.
1Show child attributes
The identifier of the project. If empty, the user's default project is used.
^[\p{L}\p{N}_:-]*$A list of memory types to add (e.g., episodic, semantic). If empty, all available types are added.
Memory type.
semantic, episodic ["episodic", "semantic"]Successful Response
Response model for adding memories.
The list of results for each added memory message.
Show child attributes