Redis

Perform similarity searches with in-memory or persistent Redis storage

Uses Redis Stack via the redisvl library for vector similarity search.

Installation

pip install redisvl
uv add redisvl

Usage

from dapr_agents.storage.vectorstores import RedisVectorStore
from dapr_agents.document.embedder.openai import OpenAIEmbedder  # Replace with your embedding model

store = RedisVectorStore(
    url="redis://localhost:6379",
    index_name="my_agent",
    embedding_function=OpenAIEmbedder(),
    embedding_dimensions=1536,
    distance_metric="cosine",  # "cosine", "l2", or "ip"
    storage_type="hash",       # "hash" or "json"
)