Setup
Valkey vector search requires the valkey-search module. Use thevalkey/valkey-bundle Docker image which includes it:
Example
agent_with_knowledge.py
Valkey Params
| Parameter | Type | Default | Description |
|---|---|---|---|
index_name | str | Required | Name of the Valkey search index to store vector data |
host | str | "localhost" | Valkey server host |
port | int | 6379 | Valkey server port |
username | Optional[str] | None | Username for authentication |
password | Optional[str] | None | Password for authentication |
use_tls | bool | False | Enable TLS encryption |
database_id | Optional[int] | None | Logical database index (e.g. 0-15) |
request_timeout | Optional[int] | None | Milliseconds to wait for a request to complete. If unset, the GLIDE client default (250 ms) applies |
client_name | str | "agno_vectordb_client" | Connection name, visible in CLIENT LIST |
glide_client | Optional[GlideClient] | None | Pre-configured Valkey GLIDE client instance |
embedder | Optional[Embedder] | None | Embedder instance to generate embeddings (defaults to OpenAIEmbedder() when unset) |
search_type | SearchType | SearchType.vector | Type of search to perform (vector, keyword) |
distance | Distance | Distance.cosine | Distance metric (cosine, l2, max_inner_product) |
vector_algorithm | str | "HNSW" | Vector index algorithm (HNSW or FLAT) |
reranker | Optional[Reranker] | None | Reranker for search results |
id | Optional[str] | None | Optional custom ID. If not provided, an ID will be generated |
name | Optional[str] | None | Optional name for the vector database |
description | Optional[str] | None | Optional description for the vector database |