Skip to main content

Crate synaptic_redis

Crate synaptic_redis 

Source
Expand description

Redis integration for the Synaptic framework.

This crate provides two Redis-backed implementations:

  • RedisStore — implements the Store trait for persistent key-value storage with namespace support.
  • RedisCache — implements the LlmCache trait for caching LLM responses with optional TTL expiration.

§Quick start

use synaptic_redis::{RedisStore, RedisStoreConfig, RedisCache, RedisCacheConfig};

// Store
let store = RedisStore::from_url("redis://127.0.0.1/")?;

// Cache with 1-hour TTL
let config = RedisCacheConfig { ttl: Some(3600), ..Default::default() };
let cache = RedisCache::from_url_with_config("redis://127.0.0.1/", config)?;

Structs§

ChatResponse
A response from a chat model containing the AI message and optional token usage statistics.
Item
A stored item in the key-value store.
RedisCache
Redis-backed implementation of the LlmCache trait.
RedisCacheConfig
Configuration for RedisCache.
RedisStore
Redis-backed implementation of the Store trait.
RedisStoreConfig
Configuration for RedisStore.

Traits§

LlmCache
Trait for caching LLM responses.
Store
Persistent key-value store trait for cross-invocation state.