Skip to content

Manage memories

This guide shows how to forget a memory and how to tell Alvia which memories are useful. Both operations need the memory’s ID, which you get from recall, search or list.

For endpoint schemas and status codes, use the API reference.

DELETE /v1/memories/{memory_id}
curl -X DELETE \
https://api.alvia.ai/v1/memories/mem_01K6Z1M4TB7D9E2F5G8H3J6K0P \
-H "Authorization: Bearer $ALVIA_API_KEY"

The response is 202 with an empty body. Forgetting the same memory again also returns 202.

Forgetting is permanent. A forgotten memory leaves every read:

  • Get, list and context drop it at once, in context both as a match and as a related or contradicting memory
  • Search and recall drop it as well
  • The memory stops counting against the stored-memory limit

When a fact changes, send the new fact: Alvia records it as the memory’s next version, so the memory stays. Forget a memory when a user asks your application to forget something, or when a fact was stored by mistake.

PUT /v1/memories/{memory_id}/feedback
curl -X PUT \
https://api.alvia.ai/v1/memories/mem_01K6Y3V9QF2W8H4N7C5X0RZB1D/feedback \
-H "Authorization: Bearer $ALVIA_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "is_favorited": true, "sentiment": "positive" }'
Field Required Description
is_favorited Yes true raises the memory’s rank in future reads. false removes that boost.
sentiment Yes positive: useful. negative: wrong, outdated or irrelevant. neutral: mixed or informational.

Forget takes no request body.

Feedback returns 204 with no body. Each call replaces the memory’s earlier feedback, and ranking updates within moments.

Feedback changes ranking and leaves the memory’s text as it is. negative sentiment lowers a memory’s rank; to remove a memory from reads, forget it.

Forget and feedback count as writes for Rate limits, but they never use your monthly write allowance.

  • Forget is safe to repeat. Forgetting a memory that is already forgotten returns 202 again.
  • Feedback is safe to repeat. Each call replaces the earlier feedback, so a repeat changes nothing.
  • Retry only calls that failed: network errors, 5xx responses and 429 responses, after the wait in Retry-After. See Production checklist.
Error Cause
400 validation_error Feedback: a field is missing or has a value the API does not accept.
401 unauthorized The API key is missing or not valid.
404 not_found The memory does not exist or belongs to another project. Feedback: also a forgotten memory.
429 rate_limit_exceeded Too many requests per second.

See Errors for every code.