agently-session-memo
Agently Session Memo
This skill covers Agently session-backed conversation state. It focuses on session activation, session isolation by id, session-backed chat_history, automatic request/reply recording, full_context, context_window, memo, resize strategies, and session serialization. It does not cover low-level prompt composition in general, provider setup, structured output control, or TriggerFlow runtime-data memo.
Prerequisite: Agently >= 4.0.8.5.
Scope
Use this skill for:
activate_session()anddeactivate_session()- understanding how session-backed
chat_historydiffers from manualset_chat_history(...)andadd_chat_history(...) - session isolation by
session_id - automatic request-prefix injection from
context_window - automatic finally-stage recording of user and assistant turns
session.input_keysandsession.reply_keysfull_context,context_window, andmemosession.max_length, default auto-resize, and custom analysis / resize handlersclean_context_window()- exporting and restoring session state through JSON or YAML
- restoring conversation continuity into a fresh agent after service restart
- combining session restore with TriggerFlow execution restore when conversation memory and workflow state are separate
Do not use this skill for:
- general prompt-slot composition outside the session boundary
- model setup, auth, proxy, or network client configuration
.output(...),ensure_keys, response streaming, or response reuse patterns- TriggerFlow runtime-data memo or workflow-state design
- full RAG or knowledge-base orchestration
Core Boundary
Agently has two conversation-history layers:
- low-level prompt-side
chat_history - session-backed memory through
SessionExtension
Without an activated session, set_chat_history(...), add_chat_history(...), and reset_chat_history() are low-level prompt-state helpers.
With an activated session, those same helpers become session-backed operations. They update Session state first and then mirror the current context_window back into prompt chat_history.
Workflow
- If the task is about turning session on or off, picking
session_id, or switching between sessions, read references/session-lifecycle.md. - If the task is about
chat_history, automatic recording, request-prefix injection, orsession.input_keys/session.reply_keys, read references/recording-and-overrides.md. - If the task is about trimming history,
session.max_length, custom resize handlers, or memo updates, read references/resize-and-memo.md. - If the task is about exporting, loading, or restoring session state, read references/serialization-and-restore.md.
- If the task is about recovering a real conversation after restart, reconnect, or long suspension, read references/business-restore-recipes.md.
- If the behavior still looks wrong, use references/troubleshooting.md.
Core Mental Model
Agently session memory has three state buckets:
full_contextfor the full recorded historycontext_windowfor the history that will actually be injected into the next requestmemofor durable summarized facts, preferences, or constraints
SessionExtension attaches that state to the agent lifecycle:
- request prefix -> inject
context_windowandmemo - finally hook -> record the current user and assistant turn back into the session
Session serialization restores session state, not the whole application runtime. Agent setup, model settings, tools, and TriggerFlow execution state still have to be rebuilt or restored separately.
Selection Rules
- manual prompt-side multi-turn setup only ->
set_chat_history(...)/add_chat_history(...)in input composition - persistent conversation continuity across turns -> activate a session
- per-user or per-thread history isolation -> stable
session_id - only keep selected fields from input or reply ->
session.input_keys/session.reply_keys - shrinking history under a limit ->
session.max_lengthor custom resize handlers - storing long-lived compressed facts ->
memo - saving and restoring a session -> JSON / YAML serialization
- restarting a chat service and continuing the same conversation -> restore the session into a fresh agent
- restoring both workflow progress and chat continuity -> combine this skill with
agently-triggerflow-configandagently-triggerflow-execution-state - TriggerFlow execution-scoped memo -> not this skill
References
references/source-map.mdreferences/session-lifecycle.mdreferences/recording-and-overrides.mdreferences/resize-and-memo.mdreferences/serialization-and-restore.mdreferences/business-restore-recipes.mdreferences/troubleshooting.md