{"id":67,"library":"redisvl","title":"Redis Vector / RedisVL","description":"The official AI-native Python client for vector search on Redis. Wraps redis-py with a high-level interface for defining vector schemas, building HNSW/FLAT indexes, running hybrid search, semantic routing, LLM caching, and session memory. Requires Redis 7.2+ with Search & Query module, or Redis Stack (self-hosted), or Redis Cloud. The underlying redis-py client is a separate package ('redis') — redisvl depends on it. Import root is 'redisvl'. Maintained by Redis Inc.","status":"active","version":"0.14.1","language":"python","source_language":"en","source_url":"https://github.com/redis/redis-vl-python","tags":["redis","redisvl","vector-search","embeddings","hnsw","rag","hybrid-search","llm-cache","semantic-router"],"install":[{"cmd":"pip install redisvl","lang":"bash","label":"Core install (no vectorizer deps)"},{"cmd":"pip install redisvl[openai]","lang":"bash","label":"With OpenAI vectorizer"},{"cmd":"pip install redisvl[all]","lang":"bash","label":"All vectorizer dependencies"},{"cmd":"pip install redisvl[hiredis]","lang":"bash","label":"With hiredis (high-performance parser)"},{"cmd":"docker run -d --name redis -p 6379:6379 -p 8001:8001 redis/redis-stack:latest","lang":"bash","label":"Local Redis Stack (required for vector search)"}],"dependencies":[{"reason":"Required. The underlying redis-py client. redisvl requires redis>=7.x (redis-py package). redis-py 7.x dropped Python 3.9 support — requires Python 3.10+.","package":"redis","optional":false},{"reason":"Required. Vectors are passed as numpy float32 arrays internally.","package":"numpy","optional":false},{"reason":"Required. Schema definitions use Pydantic models.","package":"pydantic","optional":false}],"imports":[{"note":"redisvl does not have a useful top-level import. All classes are in submodules.","wrong":"import redisvl","symbol":"SearchIndex","correct":"from redisvl.index import SearchIndex"},{"note":"Also HybridQuery (Redis 8.4.0+ only), RangeQuery, FilterQuery.","symbol":"VectorQuery","correct":"from redisvl.query import VectorQuery"},{"note":"Schema can be loaded from a dict or YAML file.","symbol":"IndexSchema","correct":"from redisvl.schema import IndexSchema"}],"quickstart":{"code":"import numpy as np\nfrom redis import Redis\nfrom redisvl.index import SearchIndex\nfrom redisvl.schema import IndexSchema\nfrom redisvl.query import VectorQuery\n\n# Define schema\nschema = IndexSchema.from_dict({\n    \"index\": {\"name\": \"docs\", \"prefix\": \"doc\", \"storage_type\": \"hash\"},\n    \"fields\": [\n        {\"name\": \"text\", \"type\": \"text\"},\n        {\n            \"name\": \"embedding\",\n            \"type\": \"vector\",\n            \"attrs\": {\n                \"algorithm\": \"hnsw\",\n                \"datatype\": \"float32\",\n                \"dims\": 4,\n                \"distance_metric\": \"cosine\"\n            }\n        }\n    ]\n})\n\n# Connect and create index\nindex = SearchIndex(schema, redis_url=\"redis://localhost:6379\")\nindex.create(overwrite=True)\n\n# Load data\nindex.load([\n    {\"id\": \"1\", \"text\": \"hello world\", \"embedding\": np.array([0.1, 0.2, 0.3, 0.4], dtype='float32').tobytes()},\n])\n\n# Search\nquery = VectorQuery(\n    vector=[0.1, 0.2, 0.3, 0.4],\n    vector_field_name=\"embedding\",\n    num_results=5\n)\nresults = index.query(query)\nprint(results)","lang":"python","description":"Requires Redis Stack or Redis Cloud running locally. Vectors stored as bytes (float32.tobytes()) in HASH storage. HNSW index supports incremental inserts. Use AsyncSearchIndex for async workflows."},"warnings":[{"fix":"Use: docker run -d redis/redis-stack:latest for local dev, or Redis Cloud free tier. Cannot use standard redis:latest Docker image.","message":"Plain redis (Redis OSS) does not support vector search. You must use Redis Stack, Redis Cloud, or Redis Enterprise — all of which include the Search & Query module. pip install redisvl succeeds but all index operations fail against plain Redis.","severity":"breaking","affected_versions":"all"},{"fix":"Check Redis version before using HybridQuery. Use AggregateHybridQuery for Redis < 8.4.0.","message":"HybridQuery (native hybrid text+vector search) requires Redis 8.4.0+. Using it against Redis 7.x or 8.x < 8.4.0 raises a command error. AggregateHybridQuery is the backward-compatible alternative.","severity":"breaking","affected_versions":"all"},{"fix":"Pin dialect explicitly in queries if you need dialect 1 behavior, or audit query results after upgrading redis-py to 6.x.","message":"redis-py 6.0.0 introduced a client-side default dialect override (DIALECT 2) for FT.SEARCH and FT.AGGREGATE. This can change query results compared to older versions. Affects raw redis-py users who rely on default dialect behavior.","severity":"breaking","affected_versions":"redis>=6.0.0"},{"fix":"Use thresholds in [0, 2] range for cosine distance in Redis. A threshold of 0.2 in pinecone/other libraries is ~0.2 here too but verify against your data.","message":"COSINE distance in Redis uses the range [0, 2], not [0, 1]. 0 = identical, 2 = opposite. Documentation has historically stated [0, 1] in some places — this was incorrect. Fixed in redisvl release notes.","severity":"gotcha","affected_versions":"all"},{"fix":"Always call .astype('float32').tobytes() when using HASH storage. JSON storage type handles serialization differently — check redisvl docs for your storage_type.","message":"Vectors must be stored as bytes (np.array(..., dtype='float32').tobytes()) for HASH storage type. Passing a Python list or numpy array directly to index.load() silently stores wrong data.","severity":"gotcha","affected_versions":"all (HASH storage)"},{"fix":"Keep redisvl up to date. If hitting ImportError on botocore, upgrade redisvl.","message":"redisvl previously had an unintentional dependency on botocore (AWS SDK). Any environment without boto would get an ImportError on redisvl.utils.vectorize. Fixed in a patch release.","severity":"gotcha","affected_versions":"specific older patch versions"},{"fix":"Install C++ build essentials before installing redisvl. For Alpine, use `apk add build-base python3-dev`.","message":"Building 'ml-dtypes' (a dependency of redisvl) on Alpine or other minimal environments fails due to missing C++ build tools (g++). This prevents redisvl from being installed.","severity":"breaking","affected_versions":"all (on Alpine/minimal environments)"}],"env_vars":null,"search_vec":"'7.2':45 'ai':7 'ai-nat':6 'build':30 'cach':39,95 'client':10,64 'cloud':58 'defin':27 'depend':71 'embed':87 'high':23 'high-level':22 'hnsw':88 'hnsw/flat':31 'host':55 'hybrid':34,91 'hybrid-search':90 'import':74 'inc':81 'index':32 'interfac':25 'level':24 'llm':38,94 'llm-cach':93 'maintain':78 'memori':42 'modul':49 'nativ':8 'offici':5 'packag':68 'py':19,63 'python':9 'queri':48 'rag':89 'redi':1,15,18,44,51,57,62,69,80,82 'redis-pi':17,61 'redisvl':3,70,77,83 'requir':43 'root':75 'rout':37 'router':98 'run':33 'schema':29 'search':13,35,47,86,92 'self':54 'self-host':53 'semant':36,97 'semantic-rout':96 'separ':67 'session':41 'stack':52 'under':60 'vector':2,12,28,85 'vector-search':84 'wrap':16","created_at":"2026-03-16T04:39:09.011572+00:00","updated_at":"2026-04-16T20:50:41.851985+00:00","problems":[{"fix":"Ensure your Redis server is Redis Stack (which includes Redis Search) or Redis 7.2+ with the Search module explicitly loaded. For Docker, use `redis/redis-stack-server`.","cause":"The connected Redis server does not have the Redis Search & Query module loaded or its version is older than 7.2, which is required by redisvl.","error":"redis.exceptions.ResponseError: unknown command 'FT.CREATE'"},{"fix":"If you intend to use `redisvl` as a standalone client, import `RedisVL`: `from redisvl.redisvl import RedisVL`. If you need the Langchain integration, use `from langchain_community.vectorstores import RedisVectorStore` (after `pip install langchain-community`).","cause":"The `RedisVectorStore` class is part of the `langchain-community` library's Redis integration, not the core `redisvl` client library. The main client for `redisvl` is the `RedisVL` class.","error":"ImportError: cannot import name 'RedisVectorStore' from 'redisvl'"},{"fix":"Provide the `dims` argument when creating `VectorField`, e.g., `VectorField(name='vector', dims=1536)`.","cause":"When defining a `VectorField` in the `redisvl` schema, the `dims` parameter, which specifies the length of the embedding vectors, is a mandatory argument and has not been provided.","error":"TypeError: __init__ missing 1 required positional argument: 'dims'"}],"ecosystem":"pypi","meta_description":null,"install_score":0,"quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"0.26.0","cli_name":"redisvl","cli_version":"sh: 1: redisvl: not found","type":"library","homepage":"https://redis.com/redis-vector-library","github":"https://github.com/redis/redis-vl-python","docs":"https://docs.redisvl.com","changelog":null,"pypi":"https://pypi.org/project/redisvl/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["vector-search","database","ai-ml","llm-agents"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-27","last_verified":"2026-08-26","next_check":"2026-07-27","install_tag":"stale"}}