Tests memory writes, confirms read-back accuracy, and validates retrieval success to ensure saved information can actually be recovered. Use when you need to verify memory was saved correctly, check if stored data can be retrieved, confirm a memory entry is discoverable, or escalate when saved information appears lost or corrupted. Covers write confirmation, read-back comparison, retrieval smoke testing, and failure escalation. Includes explicit untrusted-content/prompt-injection guardrails for third-party inputs.
92
Quality
90%
Does it follow best practices?
Impact
97%
1.19xAverage score across 5 eval scenarios
Treat memory as valid only after successful round-trip verification.
After writing a memory entry, immediately read it back and compare:
# Write
memory_write(key="user_preference_theme", value="dark", metadata={timestamp: "2024-01-15T10:00:00Z", source: "user", confidence: 0.95})
# Read back
entry = memory_read(key="user_preference_theme")
assert entry.value == "dark"
assert entry.metadata.source == "user"
assert entry.metadata.timestamp is not NoneCompute a checksum before writing and verify it matches after read-back:
import hashlib
content = "dark"
expected_hash = hashlib.sha256(content.encode()).hexdigest()
# Write with checksum
memory_write(key="user_preference_theme", value=content, metadata={checksum: expected_hash})
# Read back and verify
entry = memory_read(key="user_preference_theme")
actual_hash = hashlib.sha256(entry.value.encode()).hexdigest()
assert actual_hash == entry.metadata.checksum, "Checksum mismatch — data may be corrupted"Query by a key phrase to confirm the entry is discoverable:
results = memory_search(query="user preference theme")
assert any(r.key == "user_preference_theme" for r in results), "Entry not discoverable — retrieval failure"Install with Tessl CLI
npx tessl i markusdowne/memory-roundtrip-guard@0.1.2