Methodology
Adapter Contractv1.0
Agent Memory Adapter Spec
Adapter contract for agent memory systems. These systems provide persistent memory for autonomous agents, supporting cross-session recall and multi-agent isolation.
Required methods
def setup(self) -> NoneInitialize the agent memory backend. May start services, connect to databases, etc.
def reset(self) -> NoneClear agent memory state. Must isolate between benchmark items.
def teardown(self) -> NoneShut down services and clean up.
def ingest(self, turns: List[Dict[str, Any]]) -> NoneStore agent interaction history. Turns represent agent actions and observations.
def recall(self, query: str) -> strRetrieve relevant agent memories for decision-making context.
Required capabilities
- -Agent interaction history storage
- -Cross-session memory persistence
- -Memory isolation between agents/tasks
- -Efficient recall under token constraints
Applicable benchmarks
| Benchmark | Alignment |
|---|---|
| Knowledge Retrieval | core |
| Truth Arbitration | core |
| Memory Poisoning | core |
| Budget Curves | core |
| Reliability | core |
| Knowledge Scale | adjacent |
| LongMemEval | adjacent |
Example implementation
python
"""Example agent memory adapter."""
from typing import Any, Dict, List, Optional
from benchd_harness.adapters.base import BaseAdapter
class MyAgentMemoryAdapter(BaseAdapter):
@property
def name(self) -> str:
return "my-agent-memory"
@property
def version(self) -> Optional[str]:
return "1.0.0"
def setup(self) -> None:
self._memory = AgentMemoryStore(agent_id="benchd-eval")
def reset(self) -> None:
self._memory.clear(agent_id="benchd-eval")
def teardown(self) -> None:
self._memory.shutdown()
def ingest(self, turns: List[Dict[str, Any]]) -> None:
for turn in turns:
self._memory.store(
agent_id="benchd-eval",
role=turn["role"],
content=turn["content"],
)
def recall(self, query: str) -> str:
results = self._memory.recall(
agent_id="benchd-eval",
query=query,
)
return "\n".join(results)Quick start
Install
bash
pip install benchd-harnessValidate & test
bash
benchd adapter validate my-agent-memory && benchd run -a my-agent-memory -b smoke-memory-v0Stable URL: benchd.ai/spec/adapter/agent-memory/v10
Version: 1.0 | This spec is referenced in adapter manifests and will not change within the same major version.