Interface definition for StrawPot memory providers.
This package defines the MemoryProvider protocol and associated types that any memory backend must implement to integrate with the StrawPot agent orchestration system.
pip install strawpot-memoryImplement the MemoryProvider protocol to create a custom memory backend:
from strawpot_memory.memory_protocol import (
MemoryProvider,
GetResult,
DumpReceipt,
RememberResult,
RecallResult,
)
class MyMemoryProvider:
name = "my-provider"
def get(self, *, session_id, agent_id, role, behavior_ref, task,
budget=None, parent_agent_id=None, group_id=None) -> GetResult:
...
def dump(self, *, session_id, agent_id, role, behavior_ref, task, status, output,
tool_trace="", parent_agent_id=None, artifacts=None, group_id=None) -> DumpReceipt:
...
def remember(self, *, session_id, agent_id, role, content,
keywords=None, scope="project", group_id=None) -> RememberResult:
...
def recall(self, *, session_id, agent_id, role, query,
keywords=None, scope="", max_results=10, group_id=None) -> RecallResult:
...
assert isinstance(MyMemoryProvider(), MemoryProvider) # runtime check| Method | Purpose |
|---|---|
get |
Retrieve context cards and control signals before spawning an agent |
dump |
Record agent results after completion |
remember |
Persist knowledge during agent execution |
recall |
Query stored knowledge on-demand during agent execution |
MemoryKind— enum of memory types (PM,SM,STM,RM,EM)ContextCard— single unit of context returned bygetControlSignal— advisory signals (risk level, suggested next step, policy flags)GetResult— full output of agetcallDumpReceipt— receipt returned bydumpRememberResult— result returned byrememberRecallEntry— single entry returned byrecallRecallResult— result returned byrecall