Note
Go to the end to download the full example code.
Memory¶
In AgentScope, the memory is used to store the context of the agent, and retrieve it when needed.
Specifically, AgentScope provides a memory base class MemoryBase
and an in-memory implementation InMemoryMemory
under agentscope.memory
that can be used directly.
Customize Memory¶
To customize your own memory, just inherit from MemoryBase
and implement the following methods:
Method |
Description |
---|---|
|
Add |
|
Delete items from the memory |
|
The size of the memory |
|
Clear the memory content |
|
Get the memory content as a list of |
|
Get the state dictionary of the memory |
|
Load the state dictionary of the memory |
Further Reading¶
Total running time of the script: (0 minutes 0.000 seconds)