Skip to main content

assemble_context

Function assemble_context 

Source
pub fn assemble_context(
    candidates: &[MemoryEntry],
    budget: &ContextBudget,
) -> ContextWindow
Expand description

Assemble a context window from candidate entries, respecting the token budget.

Candidates are sorted by relevance (descending), then greedily packed until the budget is exhausted. Entries that don’t fit are dropped.