current_message, the retrieval switches to semantic mode and returns memories most relevant to what the user just said, rather than a general importance-and-recency sort.
Endpoint:
GET https://api.remem.online/memories/contextRequest Headers
Query Parameters
string
required
Load memories belonging to this user.
string
required
Load memories belonging to this agent.
integer
default:"10"
Maximum number of memories to return. Minimum
1, maximum 50.string
The first message sent by the user in this session. When provided, Remem uses semantic retrieval to return memories most relevant to this message. When omitted, memories are sorted by importance and recency.
Code Examples
Response
200 — Success
Error Responses
Notes
context() vs recall() — when to use each
context() vs recall() — when to use each
Use
context() at session start, before you have a specific query. It surfaces the memories that are most important and recent for this user overall, giving your agent a baseline understanding before the conversation begins.Use recall() (the Search Memories endpoint) during a session, when the user says something specific and you want memories relevant to that particular message.You can combine both: call context() once at the start to pre-populate your system prompt, then call recall() on each user turn to retrieve memories relevant to what they just said.New users — handling empty memory lists
New users — handling empty memory lists
If the user has no stored memories yet, A
context() returns an empty memories array. Make sure your agent handles this gracefully rather than treating it as an error:total of 0 in the response is the reliable signal that no memories exist yet for this user + agent pair.