EpisodicMemory class, which acts as the primary
orchestrator for an individual memory session. It integrates short-term
(session) and long-term (declarative) memory stores to provide a unified
interface for adding and retrieving conversational data.
Key responsibilities include:
- Managing the lifecycle of the memory instance through reference counting.
- Adding new conversational
Episodeobjects to both session and declarative memory. - Retrieving relevant context for a query by searching both memory types.
- Interacting with a language model for memory-related tasks.
- Each instance is managed by the
EpisodicMemoryManager.
Class EpisodicFilter
Callable protocol representing an episode filter predicate.
Class EpisodicMemoryParams
Parameters for configuring the EpisodicMemory.
Attributes:
session_key (str): The unique identifier for the session.
metrics_factory (MetricsFactory): The metrics factory.
long_term_memory (LongTermMemory): The long-term memory.
short_term_memory (ShortTermMemory): The short-term memory.
enabled (bool): Whether the episodic memory is enabled.
validate_memory_params
| Name | Type | Description |
|---|
Class EpisodicMemory
Represents a single, isolated memory instance for a specific session.
This class orchestrates the interaction between short-term (session)
memory and long-term (declarative) memory. It manages the lifecycle of
the memory, handles adding new information (episodes), and provides
methods to retrieve contextual information for queries.
Each instance is tied to a unique session key
| Name | Type | Description |
|---|---|---|
params | EpisodicMemoryParams | - |
short_term_memory
Get the short-term memory of the episodic memory instance.
| Name | Type | Description |
|---|
short_term_memory
Set the short-term memory of the episodic memory instance.
This makes the short term memory can be injected.
| Name | Type | Description | |
|---|---|---|---|
value | `ShortTermMemory | None` | The new short-term memory of the episodic memory instance. |
long_term_memory
Get the long-term memory of the episodic memory instance.
| Name | Type | Description |
|---|
long_term_memory
Set the long-term memory of the episodic memory instance.
This makes the long term memory can be injected.
| Name | Type | Description | |
|---|---|---|---|
value | `LongTermMemory | None` | The new long-term memory of the episodic memory instance. |
session_key
Get the session key of the episodic memory instance.
| Name | Type | Description |
|---|

