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: CallbacksThe Callbacks to use for adding the memory.
The result of the memory addition.
Method that formats the given relevant memories in detail.
The relevant memories to format.
The formatted memories as a string.
Method that formats the given relevant memories in a simple manner.
The relevant memories to format.
The formatted memories as a string.
Method that loads memory variables based on the given inputs.
The inputs to use for loading memory variables.
An object containing the loaded memory variables.
Method that saves the context of a model run to memory.
The inputs of the model run.
The outputs of the model run.
Nothing.
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