REMEMBER and RECALL commands provide session-scoped key-value memory built directly into the store. Because it’s backed by Cache-Pot’s native hash type, you get persistence across restarts, optional TTL-based expiry, and direct hash access — all without any extra infrastructure.
How agent memory works
1
Store a fact
Call
REMEMBER with a session identifier, a field name, and the value. Cache-Pot writes the field into a hash at the key mem:<session>.2
Retrieve a specific field
Call
RECALL with the session and field name to get a single value.3
Retrieve the whole session
Omit the field argument to get all stored fields and values for the session.
REMEMBER session field value is equivalent to HSET mem:session field value, and RECALL session is equivalent to HGETALL mem:session. You can use hash commands directly on mem:<session> if you need finer control.Basic example
Setting TTL on agent memory
Sessions are persistent by default. UseEXPIRE on the underlying mem:<session> key to make a session expire automatically:
Multi-agent example
The snippet below shows an agent storing context during one turn and reading it back on a subsequent turn, using the standardredis-py client.
Using via MCP
Agent memory is also accessible from Cache-Pot’s built-in MCP server. AI frameworks that support the Model Context Protocol can call theremember and recall tools directly — no Redis client required.
See the MCP integration guide for setup instructions and a full list of available tools.