Open Agent Loops
API Reference

InMemoryScratchpad

@open-agent-loops/core


Defined in: tools/builtin/scratchpad.ts:54

In-memory Scratchpad — the shipped default.

Remarks

One string, replaced on each write and trimmed of surrounding whitespace. An empty pad reads as "(empty)" so the model gets a clear signal rather than a blank line.

Implements

Constructors

Constructor

new InMemoryScratchpad(): InMemoryScratchpad;

Returns

InMemoryScratchpad

Methods

read()

read(): string;

Defined in: tools/builtin/scratchpad.ts:58

Returns

string

The stored text, or "(empty)" when nothing has been written.

Implementation of

Scratchpad.read


write()

write(content): string;

Defined in: tools/builtin/scratchpad.ts:66

Parameters

ParameterTypeDescription
contentstringThe new text; trimmed and stored, replacing what was there.

Returns

string

The trimmed text now stored.

Implementation of

Scratchpad.write

On this page