Skip to main content

Module transcript

Module transcript 

Source
Expand description

Transcript store: *.jsonl append-only, tree structure.

Entry types: message, tool_call, tool_result, custom_message, custom, compaction, branch_summary.

Time-based segmentation (aligned with OpenClaw): files are named {session_key}-YYYY-MM-DD.jsonl so each day gets a new file. Legacy {session_key}.jsonl without date is still supported for backward compat.

Enums§

TranscriptEntry

Functions§

append_entry
Append an entry to transcript file. Creates file and parent dir if needed.
ensure_session_header
Ensure transcript has session header. Call once when creating new transcript.
list_transcript_files
List all transcript files for a session, sorted by date (legacy first, then YYYY-MM-DD).
read_entries
Read all entries from transcript (for context building). Returns entries in order.
read_entries_for_session
Read all entries from all transcript files for a session (merged in date order).
transcript_path_for_session
Path for session’s transcript file. With date segmentation: {session_key}-YYYY-MM-DD.jsonl.
transcript_path_today
Path for today’s transcript file (used for append).