Skip to main content

Class: BufferWindowMemory

memory.BufferWindowMemory

Hierarchy

Implements

  • BufferWindowMemoryInput

Constructors

constructor

new BufferWindowMemory(fields?)

Parameters

NameType
fields?Partial<BufferWindowMemoryInput>

Overrides

BaseChatMemory.constructor

Defined in

langchain/src/memory/buffer_window_memory.ts:24

Properties

aiPrefix

aiPrefix: string = "AI"

Implementation of

BufferWindowMemoryInput.aiPrefix

Defined in

langchain/src/memory/buffer_window_memory.ts:18


chatHistory

chatHistory: ChatMessageHistory

Implementation of

BufferWindowMemoryInput.chatHistory

Inherited from

BaseChatMemory.chatHistory

Defined in

langchain/src/memory/chat_memory.ts:39


humanPrefix

humanPrefix: string = "Human"

Implementation of

BufferWindowMemoryInput.humanPrefix

Defined in

langchain/src/memory/buffer_window_memory.ts:16


inputKey

Optional inputKey: string

Implementation of

BufferWindowMemoryInput.inputKey

Inherited from

BaseChatMemory.inputKey

Defined in

langchain/src/memory/chat_memory.ts:43


k

k: number = 5

Implementation of

BufferWindowMemoryInput.k

Defined in

langchain/src/memory/buffer_window_memory.ts:22


memoryKey

memoryKey: string = "history"

Implementation of

BufferWindowMemoryInput.memoryKey

Defined in

langchain/src/memory/buffer_window_memory.ts:20


outputKey

Optional outputKey: string

Implementation of

BufferWindowMemoryInput.outputKey

Inherited from

BaseChatMemory.outputKey

Defined in

langchain/src/memory/chat_memory.ts:45


returnMessages

returnMessages: boolean = false

Implementation of

BufferWindowMemoryInput.returnMessages

Inherited from

BaseChatMemory.returnMessages

Defined in

langchain/src/memory/chat_memory.ts:41

Methods

loadMemoryVariables

loadMemoryVariables(_values): Promise<MemoryVariables>

Parameters

NameType
_valuesInputValues

Returns

Promise<MemoryVariables>

Overrides

BaseChatMemory.loadMemoryVariables

Defined in

langchain/src/memory/buffer_window_memory.ts:35


saveContext

saveContext(inputValues, outputValues): Promise<void>

Parameters

NameType
inputValuesInputValues
outputValuesOutputValues

Returns

Promise<void>

Inherited from

BaseChatMemory.saveContext

Defined in

langchain/src/memory/chat_memory.ts:55