episode_write
Append a session journal to record transient iteration takeaways and run state that durable memory rejects. Episodes provide time-limited storage for cross-session context and handoff.
Instructions
Append a journal-shaped entry for the current session — for run-state, iteration takeaways, 'what we tried'. Episodes are NOT durable facts; the durability gate that rejects transient memory_write content (TRANSIENT_PHRASE_MARKERS) does not apply here. Stored at /episodes//.md with a default 30-day TTL.
Use this for content memory_write would reject as transient:
'iteration N tried X, fell over at step 3'
'currently blocked on Y; next step is Z'
'this branch's release plan' (state that changes weekly)
Episodes are invisible to memory_search / memory_health / memory_list — they are a sibling tier, not a memory category. Surface them via episode_handoff at iteration entry or episode_search for cross-session lookup. Promote a takeaway to durable memory via episode_promote (routes through memory_write, durability gate fires as normal).
Returns {status: 'committed', id, session_id, created, scopes, takeaway, swarm_id, pruned_sessions}. pruned_sessions lists any prior session directories that hit the 30-day TTL on this write (typically []).
Parameters:
body: free-form markdown. Required, non-empty. Capped bymax_content_bytes(default 1 MB).swarm_id(optional): cohort id for multi-agent swarm fan-in. When a coordinator fans out parallel sub-agents, each sub-agent passes the coordinator's session id here so the coordinator can later gather every sub-agent's takeaways viaepisode_search(swarm_id=…). The episode still lives under this writer's own session; swarm_id is a cross-cutting label. Distinct fromepisode_handoff's single-chain predecessor link.takeaway(optional): one-sentence summary. Surfaced preferentially at episode_handoff; when None, handoff falls back to the first line of body. Capped bymax_takeaway_bytes(default 4 KB) — the takeaway lives in YAML frontmatter (64 KB ceiling), so an over-cap takeaway would corrupt the file and the episode would vanish from every read surface despite returningcommitted.scopes(optional): list of scope tags. Empty list is valid (handoff keys on session_id, not scope). Capped bymax_scopes_per_write(default 64) — scopes serialise into the YAML frontmatter (64 KB ceiling), so a runaway scope list would corrupt the file and the episode would vanish from every read surface despite returningcommitted.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | Yes | ||
| scopes | No | ||
| swarm_id | No | ||
| takeaway | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||