Expand description
A Redis-backed HistoryProvider: conversation history stored in a
Redis LIST.
Mirrors the Python agent_framework_redis.RedisChatMessageStore: each
session owns one Redis list at key {key_prefix}:{session_id}, messages
are appended with RPUSH (chronological order, oldest first), read back
with LRANGE, and — when max_messages is configured — trimmed to the
most recent N entries with LTRIM after every write. Each list element
is one message, JSON-serialized with serde_json (equivalent to the
Python store’s Message.to_json() / Message.from_json() round trip).
Upstream folded the standalone ChatMessageStore abstraction into
HistoryProvider — a
ContextProvider that prepends its stored messages ahead of a run
(before_run) and records the run’s request + response messages after a
successful run (after_run). RedisChatMessageStore follows suit
directly (rather than wrapping an
InMemoryHistoryProvider)
so history actually persists to Redis, the same way
FileHistoryProvider
persists to disk.
Structs§
- Redis
Chat Message Store - Redis-backed
HistoryProvider: one RedisLISTper session, JSON-serialized messages, optional automatic trimming.
Constants§
- DEFAULT_
KEY_ PREFIX - Default Redis key prefix, matching the Python store’s default.