Skip to main content

Module context_builder

Module context_builder 

Source
Expand description

Pre-prompt memory context builder.

Assembles a ranked block of relevant memories to inject into the system prompt before each LLM call, constrained by the model’s token budget.

Structs§

ContextBuildResult
Result of a context build — includes the formatted prompt block and the raw memory hits that were included (for streaming to the client).
MemoryContextProvenance
No memory body, owner credential or storage endpoint belongs in this receipt.

Enums§

MemoryContextStatus
Host-observed selection status, independent of memory-tool recall.

Functions§

build_context
Assembles a formatted memory context block for injection into a system prompt.
build_context_with_hits
Assembles a formatted memory context block for injection into a system prompt, returning both the block and the raw memory hits.