Setup
For connecting to a remote Redis instance, pass your Redis connection string to theredis_url parameter and the index name to the index_name parameter of the RedisDB constructor.
For a local docker setup, you can use the following command:
Example
agent_with_knowledge.py
Redis Params
| Parameter | Type | Default | Description |
|---|---|---|---|
index_name | str | Required | Name of the Redis index to store vector data |
redis_url | Optional[str] | None | Redis connection URL |
redis_client | Optional[Redis] | None | Redis client instance |
embedder | Optional[Embedder] | OpenAIEmbedder() | Embedder instance to generate embeddings |
search_type | SearchType | SearchType.vector | Type of search to perform (vector, keyword, hybrid) |
distance | Distance | Distance.cosine | Distance metric for vector comparisons |
vector_score_weight | float | 0.7 | Weight for vector similarity in hybrid search |
**redis_kwargs | Any | - | Additional Redis connection parameters |
Developer Resources
- View Cookbook