Request
Body
| Field | Type | Required | Description |
|---|---|---|---|
user_id | string | ✅ | Your user identifier |
session_id | string | — | Optional session identifier |
Example
Response
| Field | Description |
|---|---|
status | "ok" if facts exist, "empty" if no facts encoded |
channel_count | Number of facts re-encoded |
lossless | Always 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
.memfile, not from the current prompt. Safe to call even if the[MEM]block has been partially corrupted or dropped.