Optional config: GenerativeAgentMemoryConfigOptional reflectionMethod that adds a memory to the agent's memory.
The content of the memory to add.
Optional now: DateThe current date.
Optional metadata: Record<string, unknown>The metadata for the memory.
Optional callbacks: anyThe Callbacks to use for adding the memory.
The result of the memory addition.
Generated using TypeDoc
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