Optionalconfig: GenerativeAgentMemoryConfigOptionalreflectionMethod that adds a memory to the agent's memory.
The content of the memory to add.
Optionalnow: DateThe current date.
Optionalmetadata: Record<string, unknown>The metadata for the memory.
Optionalcallbacks: anyThe Callbacks to use for adding the memory.
The result of the memory addition.
Class that manages the memory of a generative agent in LangChain. It extends the
BaseMemoryclass and has methods for adding a memory, formatting memories, getting memories until a token limit is reached, loading memory variables, saving the context of a model run to memory, and clearing memory contents.Example