Skip to main content

Module auto_context

Module auto_context 

Source
Expand description

Auto-Context — assemble a compact, always-fresh session snapshot.

Built once at session start (or any time the agent asks “what’s my current state?”). Combines:

  • timeline[last_session] — top-N chronological stores
  • open_loops — top-N unresolved tasks
  • emotional_field — current mood centroid + energy
  • system_state — block count + depth distribution

The output is plain text formatted for direct inclusion in an LLM prompt. Every MCP client gets the same format because the assembly happens server-side.

Structs§

AutoContext
Assembled auto-context, ready to format for an LLM prompt.
CoreMemory
A core memory entry with full text content.

Constants§

AUTO_CONTEXT_HEADER
Short header label used to embed auto-context into other tool outputs.
CORE_MEMORIES_MIN_IMP
Importance threshold for core memories (0-10).
CORE_MEMORIES_TOP_N
Max core memories to embed (full text, not just metadata).
CORE_MEMORY_MAX_CHARS
Max chars per core memory.
LOOPS_TOP_N
TIMELINE_TOP_N
How many items to include in the auto-context snapshot.

Functions§

build
Build the auto-context from disk + in-memory state.
render
Render the auto-context as a compact text block (good for LLM prompts).
render_compact
Compact version of the auto-context (for embedding in recall output).