Skip to main content

Module session_memory

Module session_memory 

Source
Expand description

Session memory extraction: extract key facts from conversations.

After enough conversation activity (≥20 messages, ≥3 tool calls since last extraction), the extractor calls the LLM to identify reusable facts and persists them to the memory directory.

Structs§

ExtractedMemory
A single extracted memory fact.
SessionMemoryState
Tracks extraction progress to avoid re-extracting.

Enums§

MemoryCategory
Categories of extracted memories.

Functions§

count_tool_calls_since
Count tool calls in messages since a given index.
extraction_prompt
Build the extraction system prompt.
parse_extraction_output
Parse extraction output into structured memories.
persist_memories
Persist extracted memories to a file under ## Auto-extracted memories.
should_extract
Check if enough conversation has happened to warrant extraction.