v1

Search Memories

The memories closest in meaning to query, best first.

score is the cosine similarity of the vectors and snippet the first 280 characters of the memory. Narrow it with user_id, agent_id, run_id and the metadata stored at write time; min_score leaves out the weak matches. A forgotten memory is never returned.

503 search_unavailable when the query could not be embedded: that is not an empty result, retry.

post/v1/memories/search

Request

  • Base URL: https://api.korely.ai
  • URL: https://api.korely.ai/v1/memories/search
  • Auth: HTTP bearer

Request body

querystring required
user_idstring nullable
agent_idstring nullable
run_idstring nullable

Scope to one run/session.

metadataobject nullable

Filter on the metadata you stored at write time, e.g. {"tier": "pro"}. Keys are ANDed. A value matches the stored value compared as text (true, false and numbers as JSON writes them, so "5" matches 5), a number also matches an equal number (5 and 5.0), and null matches a stored null. Strings, numbers, booleans and null only: an object or an array is a 422. At most 32 keys and 8,192 bytes, what stored metadata may hold: past either it is a 422.

limitinteger
exclude_sessionsboolean

Leave out the work sessions (memories written with kind: session, what a coding assistant's hooks save), for a read that wants what was said and decided. Default false: everything.

min_scorenumber nullable

Leave out the memories whose score is below this, 0 to 1 (a cosine similarity, compared as the response shows it). Absent: no floor, every nearest memory comes back. Fewer than limit results can come back. 0.20 is the value measured on LongMemEval with the local EmbeddingGemma: no best evidence lost, and more than half of the searches with no answer in the store come back empty; the right value depends on your texts.

Response

Successful Response

Changes

No recorded changes to this operation across all 1 revision of this API.