Skip to main content

Class: BufferMemory

memory.BufferMemory

Hierarchy

Implements

  • BufferMemoryInput

Constructors

constructor

new BufferMemory(fields?)

Parameters

NameType
fields?Partial<BufferMemoryInput>

Overrides

BaseChatMemory.constructor

Defined in

langchain/src/memory/buffer_memory.ts:17

Properties

aiPrefix

aiPrefix: string = "AI"

Implementation of

BufferMemoryInput.aiPrefix

Defined in

langchain/src/memory/buffer_memory.ts:13


chatHistory

chatHistory: ChatMessageHistory

Implementation of

BufferMemoryInput.chatHistory

Inherited from

BaseChatMemory.chatHistory

Defined in

langchain/src/memory/chat_memory.ts:39


humanPrefix

humanPrefix: string = "Human"

Implementation of

BufferMemoryInput.humanPrefix

Defined in

langchain/src/memory/buffer_memory.ts:11


inputKey

Optional inputKey: string

Implementation of

BufferMemoryInput.inputKey

Inherited from

BaseChatMemory.inputKey

Defined in

langchain/src/memory/chat_memory.ts:43


memoryKey

memoryKey: string = "history"

Implementation of

BufferMemoryInput.memoryKey

Defined in

langchain/src/memory/buffer_memory.ts:15


outputKey

Optional outputKey: string

Implementation of

BufferMemoryInput.outputKey

Inherited from

BaseChatMemory.outputKey

Defined in

langchain/src/memory/chat_memory.ts:45


returnMessages

returnMessages: boolean = false

Implementation of

BufferMemoryInput.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_memory.ts:29


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