Skip to content

formatMemoryWithBudget

function formatMemoryWithBudget(
memory,
maxTokens,
allowlist?): string;

Budget-aware working memory formatter. Iterates entries in insertion order, dropping entries that exceed the budget. Entries are atomic — they are either fully included or fully dropped.

Parameter Type

memory

Record<string, unknown>

maxTokens

number

allowlist?

string[]

string