Memory Module¶
pipelines.pipelines.agents.memory.conversation_memory ¶
ConversationMemory ¶
A memory class that stores conversation history.
Source code in pipelines/pipelines/agents/memory/conversation_memory.py
__init__ ¶
Initialize ConversationMemory with input and output keys.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_key |
str
|
The key to use for storing user input. |
'input'
|
output_key |
str
|
The key to use for storing model output. |
'output'
|
Source code in pipelines/pipelines/agents/memory/conversation_memory.py
clear ¶
load ¶
Load conversation history as a formatted string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
keys |
Optional[List[str]]
|
Optional list of keys (ignored in this implementation). |
None
|
kwargs |
Optional keyword arguments - window_size: integer specifying the number of most recent conversation snippets to load. |
{}
|
Returns:
| Type | Description |
|---|---|
str
|
A formatted string containing the conversation history. |
Source code in pipelines/pipelines/agents/memory/conversation_memory.py
save ¶
Save a conversation snippet to memory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data |
Dict[str, Any]
|
A dictionary containing the conversation snippet to save. |
required |
Source code in pipelines/pipelines/agents/memory/conversation_memory.py
pipelines.pipelines.agents.memory.no_memory ¶
NoMemory ¶
A memory class that doesn't store any data.
Source code in pipelines/pipelines/agents/memory/no_memory.py
clear ¶
load ¶
Load an empty dictionary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
keys |
Optional[List[str]]
|
Optional list of keys (ignored in this implementation). |
None
|
Returns:
| Type | Description |
|---|---|
str
|
An empty str. |
save ¶
Save method that does nothing.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data |
Dict[str, Any]
|
A dictionary containing the data to save (ignored in this implementation). |
required |