Jido. Memory. Store. Redis
(Jido Memory v1.0.0)
View Source
Redis-backed memory store.
This adapter persists canonical Jido.Memory.Record structs in Redis without
introducing a hard Redis client dependency into jido_memory.
Callers provide a :command_fn option, typically a thin wrapper around a
client such as Redix:
fn args -> Redix.command(:memory_redis, args) endOptions
:command_fn(required) -fn([term()]) -> {:ok, term()} | {:error, term()}:prefix(optional, default"jido:memory") - key namespace prefix:ttl(optional) - Redis key TTL in milliseconds for stored record values
Key Layout
{prefix}:record:{namespace}:{id} -> serialized `Record`
{prefix}:meta:{namespace}:{id} -> serialized index metadata
{prefix}:z:ns:{namespace}:time -> ZSET of ids by observed_at
{prefix}:z:ns:{namespace}:class:{class} -> ZSET of ids by observed_at
{prefix}:s:ns:{namespace}:tag:{tag} -> SET of ids
{prefix}:z:expires -> ZSET of namespace/id pairs by cleanup timeThe metadata key is intentionally left without a Redis TTL so expired record keys can still be deindexed when they are observed later by reads or pruning.