Expand description
§blazen-memory-valkey
A Valkey/Redis backend for [blazen-memory].
This crate provides ValkeyBackend, an implementation of
MemoryBackend that persists entries in
Valkey (or Redis-compatible) using the following key layout:
| Key pattern | Type | Contents |
|---|---|---|
{prefix}entry:{id} | STRING | JSON-serialized StoredEntry |
{prefix}bands:{band_value} | SET | Entry IDs sharing this LSH band |
{prefix}ids | SET | All entry IDs |
§Quick start
use blazen_memory_valkey::ValkeyBackend;
use blazen_memory::{Memory, MemoryStore, MemoryEntry};
let backend = ValkeyBackend::new("redis://localhost:6379")
.expect("failed to create Valkey client");
let memory = Memory::local(backend);
memory.add(vec![MemoryEntry::new("hello world")]).await?;§Features
redis-tcp(default): native TCPValkeyBackendusing therediscrate. Does not compile onwasm32-wasip1*targets.upstash: wasi-compatible [UpstashBackend] that talks to Upstash’s Redis REST API via [blazen_llm::http::HttpClient].
Structs§
- Valkey
Backend - A
MemoryBackendimplementation backed by Valkey (or any Redis-compatible server).