Skip to main content
Call this endpoint whenever your agent learns something worth remembering about a user. Remem embeds the text, checks for near-identical existing memories, and persists the result. If a duplicate is detected the store is skipped automatically, so you never accumulate repeated facts about the same user.
Endpoint: POST https://api.remem.online/memories

Request Headers

Request Body Parameters

string
required
The memory text to embed and store. Minimum 1 character, maximum 10,000 characters.
string
required
Identifier for the end user this memory belongs to. Use the same value consistently across requests.
string
required
Identifier for the agent storing the memory. Memories are scoped to a user_id + agent_id pair.
string
default:"episodic"
The category of memory. One of episodic (events and interactions), semantic (stable facts and preferences), or summary (compressed overviews).
float
default:"0.5"
A priority score between 0.0 (low) and 1.0 (high). Higher importance memories surface more readily during retrieval ranking.
object
default:"{}"
Arbitrary key-value data stored alongside the memory. Use this to attach application-specific context such as session IDs or source labels.
integer
default:"null"
Number of days until the memory auto-expires. Set to null (default) for a permanent memory. Expired memories are excluded from search results and deleted by a background job.

Code Examples

Response

200 — Memory Stored

string
UUID of the stored memory. Save this if you need to update or delete it later.
string
The memory text as stored.
string
The user identifier this memory is scoped to.
string
The agent identifier this memory is scoped to.
string
The memory category: episodic, semantic, or summary.
float
The importance score as stored, between 0.0 and 1.0.
object
The metadata object stored alongside the memory.
string
ISO 8601 timestamp of when the memory was created.
string | null
ISO 8601 expiry timestamp, or null if the memory is permanent.
boolean
true if this call was skipped because a near-identical memory already exists. false when the memory was newly stored.

Error Responses

Duplicate Detection

Remem automatically detects near-duplicate memories before storing. When you call this endpoint, the new content is embedded and compared against all existing memories for the same user_id + agent_id pair. If any existing memory has a cosine similarity above 0.95, the store is skipped and duplicate: true is returned in the response body. This prevents the same fact from accumulating across repeated sessions without any action needed on your side.