Skip to main content
The redis backend uses Redis as the vector store. Memory text is embedded by an embedding model, written to Redis with a per-user index (the actual index name is veadk-ltm/{index}/{user_id}), and retrieved by cosine similarity.

When to use

  • You already run Redis with the RediSearch module enabled;
  • You want Redis as a low-latency vector-search backend, with persistence and multi-instance sharing.

Dependencies

Redis must support RediSearch (vector search).

Usage

Before running, provide Redis with RediSearch, an account allowed to create and access indexes, and the Redis and embedding variables below. Durability depends on Redis RDB/AOF and backup settings; VeADK does not enable them
You can also pass connection config explicitly via backend_config:

Parameters

LongTermMemory parameters

Constructor parameters

backend_config supports the following settings:

Redis connection config

redis_config is a RedisConfig with env prefix DATABASE_REDIS_:

Embedding config

embedding_config is an EmbeddingModelConfig with env prefix MODEL_EMBEDDING_:

Environment variables

The vector dimension comes from the embedding config (MODEL_EMBEDDING_DIM). The index uses the flat algorithm with a cosine distance metric, and an index is created per user (veadk-ltm/{index}/{user_id}).

Verify writes and retrieval

After configuring the dependencies and credentials on this page, run this standalone example. It saves user text and searches for that user directly without calling a conversation model
Results should contain the saved language preference. Managed services may extract memories asynchronously, so a completed write does not guarantee immediate retrieval. An empty result can also indicate permission, network, or service failure; check error logs and service records. The save method does not return a success Boolean
Last modified on September 19, 2026