Valkey Agentic Memory
This guide covers deploying Valkey as the agentic memory backend for the Semantic Router. Valkey provides a lightweight, Redis-compatible alternative to Milvus for vector similarity storage using the built-in Search module.
Valkey is optional. The default memory backend is Milvus. Use Valkey when you want a single-binary deployment without external dependencies like etcd or MinIO, or when you already run Valkey for caching.
When to Use Valkey vs Milvus
| Concern | Valkey | Milvus |
|---|---|---|
| Deployment complexity | Single binary with Search module | Requires etcd, MinIO/S3, optional Pulsar |
| Horizontal scaling | Cluster mode (manual sharding) | Native distributed architecture |
| Memory model | In-memory with optional persistence | Disk-based with memory-mapped indexes |
| Best for | Small-to-medium workloads, dev/test, existing Redis/Valkey infra | Larger or distributed vector workloads |
| Vector index | HNSW via FT.CREATE | HNSW, IVF_FLAT, IVF_SQ8, and more |
Prerequisites
- A Valkey release with the Search module enabled. The
valkey/valkey-bundleimage includes the module. - A Valkey and Search-module version pair supported by the release you deploy.
Pin that release in production rather than following
latestor an RC tag. - If your Valkey distribution does not bundle Search, follow the upstream Valkey Search quick start and review its release notes before loading the module.
- For Kubernetes: Helm 3.x and
kubectlconfigured
If you run into issues loading or using the Search module, please open an issue so we can help.
Deploy with Docker
Quick Start
docker network inspect vllm-sr-network >/dev/null 2>&1 || \
docker network create vllm-sr-network
docker run -d --name valkey-memory \
--network vllm-sr-network \
valkey/valkey-bundle:latest
Verify the Search module is loaded:
docker exec valkey-memory valkey-cli MODULE LIST | grep search
With Persistence
docker run -d --name valkey-memory \
--network vllm-sr-network \
-v valkey-data:/data \
valkey/valkey-bundle:latest \
valkey-server --appendonly yes
The hostname valkey-memory in the configuration below is Docker DNS on
vllm-sr-network. If you start the Router with a custom stack name, for example
VLLM_SR_STACK_NAME=team-a vllm-sr serve, attach Valkey to
team-a-vllm-sr-network and use the matching reachable hostname.