Optional
ageOptional
memoryAdds a memory to the agent's long-term memory.
The content of the memory to add.
Optional
now: DateOptional current date.
Optional
metadata: Record<string, unknown>Optional metadata for the memory.
Optional
callbacks: anyOptional Callbacks instance.
The result of adding the memory to the agent's long-term memory.
Optional
config: any[]Use .batch() instead. Will be removed in 0.2.0.
This feature is deprecated and will be removed in the future.
It is not recommended for use.
Call the chain on all inputs in the list
Optional
config: anyOptional
tags: string[]Use .invoke() instead. Will be removed in 0.2.0.
Run the core logic of this chain and add to output if desired.
Wraps _call and handles memory.
Computes the agent's summary by summarizing the agent's core characteristics given the agent's relevant memories.
Optional
runManager: anyOptional CallbackManagerForChainRun instance.
The computed summary as a string.
Generates a dialogue response to the given observation.
The observation to generate a dialogue response for.
Optional
now: DateOptional current date.
A boolean indicating whether to continue the dialogue and the output string.
Generates a reaction to the given observation.
The observation to generate a reaction for.
Optional
now: DateOptional current date.
A boolean indicating whether to continue the dialogue and the output string.
Extracts the action of the given entity from the given observation.
The observation to extract the action from.
The name of the entity to extract the action for.
Optional
runManager: anyOptional CallbackManagerForChainRun instance.
The extracted action as a string.
Extracts the observed entity from the given observation.
The observation to extract the entity from.
Optional
runManager: anyOptional CallbackManagerForChainRun instance.
The extracted entity as a string.
Returns a full header of the agent's status, summary, and current time.
Optional configuration object with current date and a boolean to force refresh.
Optional
forceOptional
now?: DateThe full header as a string.
Gets the agent's summary, which includes the agent's name, age, traits, and a summary of the agent's core characteristics. The summary is updated periodically through probing the agent's memories.
Optional
config: { Optional configuration object with current date and a boolean to force refresh.
Optional
forceOptional
now?: DateOptional
runManager: anyOptional CallbackManagerForChainRun instance.
The agent's summary as a string.
Invoke the chain with the provided input and returns the output.
Input values for the chain run.
Optional
config: anyOptional configuration for the Runnable.
Promise that resolves with the output of the chain run.
Return a json-like object representing this chain.
Summarizes memories that are most relevant to an observation.
The observation to summarize related memories for.
Optional
runManager: anyOptional CallbackManagerForChainRun instance.
The summarized memories as a string.
Static
deserializeLoad a chain from a json-like object describing it.
Generated using TypeDoc
Implementation of a generative agent that can learn and form new memories over time. It extends the BaseChain class, which is a generic sequence of calls to components, including other chains.
Example