Used to check for browser translation.
用于检测浏览器翻译。
ブラウザの翻訳を検出する

fs-memory


Classes#

FSMemory#

A memory implementation that stores and retrieves memories using the file system. FSMemory provides persistent storage of agent memories as files in a specified directory.

Example#

Here is an example of how to use the FSMemory class:

const model = new OpenAIChatModel();

const engine = new AIGNE({ model });

const memory = new FSMemory({ rootDir: "/PATH/TO/MEMORY_FOLDER" });

const agent = AIAgent.from({
memory,
});

const result1 = await engine.invoke(agent, { message: "I like blue color" });

console.log(result1);
// Output: { message: 'Great! I will remember that you like blue color.' }

const result2 = await engine.invoke(agent, {
message: "What color do I like?",
});

console.log(result2);
// Output: { message: 'You like blue color.' }

Extends#

Indexable#

[key: symbol]: () => string | () => Promise<void>

Constructors#

Constructor#

new FSMemory(options): FSMemory

Creates a new FSMemory instance.

Parameters#

Parameter

Type

options

FSMemoryOptions

Returns#

FSMemory

Overrides#

`MemoryAgent`.`constructor`

Interfaces#

FSMemoryOptions#

Configuration options for the FSMemory class.

Extends#

Properties#

Property

Type

Description

rootDir

string

The root directory where memory files will be stored. Can be absolute or relative path. Relative paths are resolved from the current working directory. Home directory prefix (~) will be expanded appropriately.

retrieverOptions?

Partial<FSMemoryRetrieverOptions>

Optional configuration for the memory retriever agent. Controls how memories are retrieved from the file system.

recorderOptions?

Partial<FSMemoryRecorderOptions>

Optional configuration for the memory recorder agent. Controls how memories are recorded to the file system.

Variables#

MEMORY_FILE_NAME#

const MEMORY_FILE_NAME: "memory.yaml" = "memory.yaml"