Memories
Memory
Bases: BaseModel
, ABC
Base class for memories.
Source code in adala/memories/base.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
clear()
abstractmethod
Base method for clearing memory.
Source code in adala/memories/base.py
46 47 48 49 50 |
|
remember(observation, data)
abstractmethod
Base method for remembering experiences in long term memory.
Source code in adala/memories/base.py
13 14 15 16 17 |
|
remember_many(observations, data)
Base method for remembering experiences in long term memory.
Source code in adala/memories/base.py
19 20 21 22 23 24 |
|
retrieve(observation, num_results=1)
abstractmethod
Base method for retrieving past experiences from long term memory, based on current observations
Parameters:
Name | Type | Description | Default |
---|---|---|---|
observation |
str
|
the current observation |
required |
num_results |
int
|
the number of results to return |
1
|
Source code in adala/memories/base.py
26 27 28 29 30 31 32 33 34 |
|
retrieve_many(observations, num_results=1)
Base method for retrieving past experiences from long term memory, based on current observations
Parameters:
Name | Type | Description | Default |
---|---|---|---|
observation |
the current observation |
required | |
num_results |
int
|
the number of results to return |
1
|
Source code in adala/memories/base.py
36 37 38 39 40 41 42 43 44 |
|
FileMemory
Bases: Memory
Source code in adala/memories/file_memory.py
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
|
remember(observation, experience)
Serialize experience in JSON and append to file
Source code in adala/memories/file_memory.py
9 10 11 12 13 14 15 16 17 |
|
retrieve(observation)
Retrieve experience from file
Source code in adala/memories/file_memory.py
19 20 21 22 23 24 25 |
|