Skip to main content

Context Types API Reference

ContextState

Runtime representation of conversation state.

CompileSource

Input boundary for compilation.

DataFromAgentConfig

Static configuration from the decorator.

DataFromSelfRef

Durable state from the SelfReference backend.

ContextMutation (Union)

AssistantMessageMutation

ToolResultMutation

MultimodalToolResultMutation

UserMessageMutation

ContextReplaceMutation

ContextSummaryMutation

ExperienceRememberMutation

ExperienceForgetMutation

AssistantTruncatedMutation

ToolCancelledMutation


Compiled Outputs

ReducedTurnContext

Output of Stage 1 (mutation application):

CompiledTurnContext

Output of the full pipeline (ready for LLM):

CompiledContext

Intermediate compiled state (before LLM rendering):

Pipeline Functions

compile_invocation_turn

Single entry point for the full compile pipeline.

reduce_turn_context

Stage 1 only: apply mutations, refresh selfref snapshot.

convert_to_llm_request

Stage 2: resolve system prompt, render final messages.