This guide covers implementing a BaseAdapter for each compliance tier.
Choose Your Tier
| Tier | Methods | Scope |
|---|---|---|
Bronze |
9 |
Lifecycle (3) + short-term memory (6) |
Silver |
23 |
Bronze + long-term memory (7) + reasoning memory (7) |
Gold |
26 |
Silver + cross-memory operations (3) |
Bronze Tier: Short-Term Memory
Bronze requires 9 methods — the lifecycle methods plus short-term memory operations.
Lifecycle Methods
async def setup(self) -> None:
"""Connect to your backend, create schema if needed."""
async def teardown(self) -> None:
"""Close connections, release resources."""
async def clear_all_data(self) -> None:
"""Delete ALL data. Called before each test for isolation."""
|
Important
|
clear_all_data must be thorough. Any leftover data from a previous test will cause failures.
|
Short-Term Memory Methods
| Method | Contract |
|---|---|
|
Store a message. Create the conversation if the session is new. Return a |
|
Return all messages for the session in insertion order. Empty sessions return |
|
Semantic search across messages. Filter by |
|
Return all sessions with accurate |
|
Delete the message and repair the chain. Return |
|
Remove all messages for the session. Must be idempotent (safe to call on empty/nonexistent sessions). |
Critical Bronze Requirements
-
Messages must maintain insertion order (verified with up to 100 messages)
-
Message timestamps must be monotonically non-decreasing
-
Content fidelity: unicode, emoji, 10K+ character strings, and nested metadata must round-trip exactly
-
Each
add_messagecall must return a unique UUID -
Deleting a middle message must preserve order of remaining messages
-
Duplicate content must be stored as separate messages (not deduplicated)
Silver Tier: Long-Term + Reasoning Memory
Silver adds 14 methods across two memory types.
Long-Term Memory Methods
| Method | Contract |
|---|---|
|
Create an entity. Must accept types: PERSON, ORGANIZATION, LOCATION, EVENT, OBJECT. |
|
Store a user preference with optional context. |
|
Store a subject-predicate-object triple. |
|
Semantic entity search. Empty database must return |
|
Semantic preference search with optional category filter. |
|
Exact name lookup. Return |
|
Traverse relationships from an entity. Isolated entities return |
Reasoning Memory Methods
| Method | Contract |
|---|---|
|
Start a trace. |
|
Add a step with monotonically increasing |
|
Record a tool invocation. Must support all 6 statuses: pending, success, failure, error, timeout, cancelled. |
|
Set |
|
Return the full trace with all steps and tool calls. Return |
|
List traces, optionally filtered by session. |
|
Return aggregated statistics with accurate |
Gold Tier: Cross-Memory Operations
Gold adds 3 optional methods with default NotImplementedError implementations:
async def add_relationship(self, source_id, target_id, relationship_type, *, properties=None) -> TCKRelationship:
"""Create a typed relationship between entities."""
async def merge_duplicate_entities(self, source_id, target_id, *, canonical_name=None) -> TCKEntity:
"""Merge two entities, preserving all relationships."""
async def get_similar_traces(self, task, *, limit=5, success_only=True) -> list[TCKReasoningTrace]:
"""Find traces with similar tasks via semantic search."""
Gold tests also verify multi-agent sharing semantics: entities are shared across sessions while conversations and traces are session-isolated.
Running Tests Against Your Adapter
# Bronze only
uv run pytest -m bronze -v
# Silver (includes Bronze prerequisites)
uv run pytest -m silver -v
# All tiers
uv run pytest -v
# Generate compliance report
uv run pytest --json-report --json-report-file=results.json
uv run tck results.json --name "My Impl" --version "1.0" -o report.json --html report.html
See Also
-
BaseAdapter Interface Reference — complete method signatures
-
Compliance Tier Definitions — pass rate requirements
-
Obtaining TCK Certification — submitting your results