Description
Implement a Redis-backed MemoryStore that persists agent memory across restarts and enables distributed agent deployments.
Motivation
The current InMemoryStore is great for development and testing, but production deployments need persistent storage. Redis is the most common choice for fast key-value storage in production AI systems.
Proposed Implementation
Create src/agent_memory_guard/storage/redis_store.py with:
RedisMemoryStore implementing the MemoryStore protocol
- Support for Redis connection pools and Sentinel
- Key namespacing for multi-tenant deployments
- TTL support for automatic memory expiration
- Atomic operations for concurrent agent access
Example API
from agent_memory_guard import MemoryGuard, Policy
from agent_memory_guard.storage.redis_store import RedisMemoryStore
store = RedisMemoryStore(url="redis://localhost:6379", namespace="agent-1")
guard = MemoryGuard(store=store, policy=Policy.strict())
Acceptance Criteria
Description
Implement a Redis-backed
MemoryStorethat persists agent memory across restarts and enables distributed agent deployments.Motivation
The current
InMemoryStoreis great for development and testing, but production deployments need persistent storage. Redis is the most common choice for fast key-value storage in production AI systems.Proposed Implementation
Create
src/agent_memory_guard/storage/redis_store.pywith:RedisMemoryStoreimplementing theMemoryStoreprotocolExample API
Acceptance Criteria
MemoryStoreprotocolfakeredisfor CI)redisoptional dependency group topyproject.toml