Skip to main content
Use this endpoint to retrieve memories that are relevant to a specific query during an active conversation. You do not need to match exact words — Remem understands meaning, so asking “where does this user live?” will surface “User is based in Lagos, Nigeria” even without overlapping terms. Results are ranked by a hybrid score: 70% semantic relevance + 20% recency + 10% importance, and every result includes a score_detail breakdown so you can see exactly how each memory ranked.
Endpoint: GET https://api.remem.online/memories/search

Request Headers

Query Parameters

string
required
Natural language search query. Remem uses semantic similarity, so plain conversational phrasing works well.
string
required
Search within memories belonging to this user.
string
required
Search within memories belonging to this agent.
integer
default:"5"
Number of results to return. Minimum 1, maximum 20.
float
default:"0.70"
Minimum hybrid score threshold. Only memories scoring at or above this value are returned. Set to 0.0 to return all memories regardless of relevance.
string
Filter results to a single memory category: episodic, semantic, or summary. Omit this parameter to search across all types.

Code Examples

Response

200 — Success

Memory Object Fields

Error Responses

Notes

Use score_detail to debug why a memory ranked where it did:
If the wrong memory ranks first, check which signal is pulling it up. High recency but low cosine means the memory is recent but not semantically relevant to your query. High cosine but low recency means the memory is relevant but has not been accessed in a while.
The default threshold of 0.70 works well for most production use cases. Adjust it based on how strict you need results to be:
  • 0.85+ — strict; only highly relevant memories surface
  • 0.70 — balanced default
  • 0.50 — loose; returns anything remotely related
  • 0.0 — no filtering; useful during debugging
Start at 0.0 when diagnosing issues. If you see results at that threshold but not at your production threshold, the memories exist and you simply need to lower min_score.
If the endpoint returns zero memories, check in this order:
  1. Set min_score=0.0 — if results appear, your threshold is too high
  2. Confirm user_id and agent_id match exactly what you used during storage (they are case-sensitive)
  3. Call GET /memories to list all stored memories and confirm they were saved
  4. Check expires_at — memories past their expiry date are excluded from results