Skip to main content

Request

POST https://api.spectralmemory.com/flush
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Body

FieldTypeRequiredDescription
user_idstringYour user identifier
session_idstringOptional session identifier

Example

{
  "user_id": "alice"
}

Response

{
  "status": "ok",
  "channel_count": 3,
  "lossless": true
}
FieldDescription
status"ok" if facts exist, "empty" if no facts encoded
channel_countNumber of facts re-encoded
losslessAlways true — flush reads from the source .mem file

When to call

Call /flush before any operation that truncates the agent’s context window — typically before your agent’s /compress or equivalent endpoint. See Flush before compress for integration patterns.

Notes

  • Does not count against your monthly encode limit.
  • Re-encodes from the server-side .mem file, not from the current prompt. Safe to call even if the [MEM] block has been partially corrupted or dropped.