Context and Memory
Context builders
Section titled “Context builders”ContextBuilder controls how event history is transformed into model input.
Verified built-ins include:
ContextBuilders.Xml()ContextBuilders.Compact()ContextBuilders.JsonStructured()ContextBuilders.FromFunc(...)
Context window control
Section titled “Context window control”ContextWindowConfig contains compaction and pruning thresholds. On the agent itself:
AutoCompactionis enabled by default.GetContextStatsAsync()returns token and context stats.
Memory tool
Section titled “Memory tool”The memory system is file-backed and rooted under:
<workingDirectory>/memory/memoriesIt enforces virtual paths under /memories/... and is designed for cross-session knowledge capture rather than opaque vector-store behavior.
Multimodal input
Section titled “Multimodal input”Context can include non-text user input using:
Message.UserImage(...)Message.UserBlocks(...)
When persisted, non-text user input becomes UserContentEvent.