Optional
inputOptional
outputMethod that loads the chat messages from the memory and returns them as a string or as a list of messages, depending on the returnMessages property.
Optional
_: InputValuesInputValues object, not used in this method.
Promise that resolves with MemoryVariables object containing the loaded chat messages.
Predicts a new summary for the conversation given the existing messages and summary.
Existing messages in the conversation.
Current summary of the conversation.
A promise that resolves to a new summary string.
Method that saves the context of the conversation, including the input and output values, and prunes the memory if it exceeds the maximum token limit.
InputValues object containing the input values of the conversation.
OutputValues object containing the output values of the conversation.
Promise that resolves when the context is saved and the memory is pruned.
Generated using TypeDoc
Class that extends BaseConversationSummaryMemory and implements ConversationSummaryBufferMemoryInput. It manages the conversation history in a LangChain application by maintaining a buffer of chat messages and providing methods to load, save, prune, and clear the memory.
Example