agentskit.js
Data layerMemory

createAutoSummarizingMemory

Fold oldest messages into a running summary. Token-budget-friendly.

import { createAutoSummarizingMemory } from '@agentskit/memory'

const memory = createAutoSummarizingMemory({
  summarize: async (msgs) => adapter.complete({
    messages: [{ role: 'system', content: 'Summarize tersely' }, ...msgs],
  }),
  triggerAt: 30,
  keep: 10,
})
✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page