Functions

slidingWindow

Function: slidingWindow()

slidingWindow(options): WindowStrategy

Defined in: src/core/agent/window/strategies/slidingWindow.ts:53

Keep the most recent keepRecentTurns turns in the live window and drop the older ones — except anything that refuses.

Parameters

options

SlidingWindowOptions

Returns

WindowStrategy

Example

import { Agent, slidingWindow } from 'agentfootprint';
import { ollama } from 'agentfootprint/providers';

// Works on a provider that reports no usage at all: the trigger is turns.
const agent = Agent.create({ provider: ollama('llama3.2'), model: 'llama3.2' })
  .window(slidingWindow({ keepRecentTurns: 12 }))
  .build();

On this page