session
Manage session lifecycle: start, end, check active, view history, clean stale sessions. Capture session summaries as atomic memories and get boot-time digests.
Instructions
Session lifecycle — start, end, history, active check, stale cleanup, and the v0.9.0 boot-time digest.
ACTIONS:
"start": Begin a new session. Returns session_id.
"end": End a TRACKED session (needs session_id). Returns stats. This closes session bookkeeping — it does NOT capture memories.
"capture": Segment a free-text session summary into atomic candidate memories (needs summary; NO session_id — it operates on the text, not on tracked-session state). Returns drafted rids. Use at end of substantial work so the session leaves a trace.
"history": View past sessions.
"active": Check if there's a running session.
"abandon_stale": Clean up orphaned sessions older than abandon_stale_hours.
"digest": One-call boot-time briefing (v0.9.0) — narrative chain head, open decisions/conflicts/triggers, top stale memories. Call this at conversation start instead of N separate recalls. Set include_gaps=True to fold known-unknowns (frequently-asked, poorly-answered queries) into the briefing — the active-learning loop. Set scope to filter content aggregates to one namespace for a per-tenant digest.
Args: action: "start", "end", "capture", "history", "active", "abandon_stale", "digest". session_id: For end. namespace: Memory namespace. client_id: Client identifier. metadata: For start — optional dict. summary: For end — optional closing note. For capture — REQUIRED, the session summary to segment into memories. domain: For capture — domain stamped on drafted memories. limit: For history. abandon_stale_hours: For abandon_stale — max age in hours. narrative_namespace: For digest — namespace for the narrative chain. scope: For digest — filter content aggregates to one namespace (per-tenant isolation); omit for a whole-DB digest. include_gaps: For digest — fold top knowledge gaps into the briefing. max_gaps: For digest — cap on gaps surfaced when include_gaps=True. max_decisions / max_conflicts / max_triggers: For digest — surface caps. snippet_chars: For digest — text-snippet length per item.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | ||
| scope | No | ||
| action | Yes | ||
| domain | No | general | |
| summary | No | ||
| max_gaps | No | ||
| metadata | No | ||
| client_id | No | default | |
| namespace | No | default | |
| session_id | No | ||
| include_gaps | No | ||
| max_triggers | No | ||
| max_conflicts | No | ||
| max_decisions | No | ||
| snippet_chars | No | ||
| abandon_stale_hours | No | ||
| narrative_namespace | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |