
Redis Vector Search
Configure Redis vector indexes and RedisVL hybrid search so solo builders can ship RAG retrieval without guessing HNSW vs FLAT tradeoffs.
Overview
Redis Vector Search is an agent skill most often used in Build (also Validate prototype, Operate iterate) that configures Redis HNSW or FLAT vector indexes and RedisVL hybrid retrieval for RAG workloads.
Install
npx skills add https://github.com/redis/agent-skills --skill redis-vector-searchWhat is this skill?
- HNSW vs FLAT decision table with speed, recall, and memory tradeoffs for production vs exact search
- IndexSchema examples for COSINE distance, FLOAT32 vectors, and tunable HNSW m and ef_construction
- Hybrid search and RAG retrieval patterns using RedisVL rather than hand-rolled Redis commands
- Guidance aimed at large datasets (>10k vectors) with HNSW vs small or accuracy-critical FLAT indexes
- Official Redis agent-skill package (MIT) aligned with redis.io and the redis/agent-skills repository
- HNSW guidance targets large datasets with >10k vectors and ~95%+ tunable recall
- Example schema uses 1536-dimensional FLOAT32 embeddings with COSINE distance
- Documented HNSW attrs include m: 16 and ef_construction: 200 as tuning starting points
Adoption & trust: 1 installs on skills.sh; 70 GitHub stars; trending (+100% hot-view momentum).
What problem does it solve?
You need semantic retrieval in production but do not know which Redis vector algorithm, schema fields, or RedisVL patterns match your dataset size and accuracy bar.
Who is it for?
Indie builders adding RAG or semantic search to an app that already uses or plans to use Redis, with datasets from thousands to large-scale production vectors.
Skip if: Teams with no Redis in stack who want a managed-only vector SaaS with zero ops, or builders who only need keyword SQL full-text search with no embeddings.
When should I use this skill?
You are implementing Redis-backed embeddings, choosing HNSW vs FLAT, or building RAG retrieval with RedisVL.
What do I get? / Deliverables
You leave with index configuration and retrieval patterns you can paste into your app so agents implement consistent, tunable vector search instead of one-off FT.SEARCH experiments.
- IndexSchema configuration for HNSW or FLAT vector fields
- Hybrid search / RAG retrieval code patterns using RedisVL
- Documented tradeoff notes for accuracy, memory, and query speed
Recommended Skills
Journey fit
Spans multiple journey phases - primary shelf plus alternate fits below.
Vector index setup and RedisVL wiring are core product-integration work once you are building an AI feature, not early idea research. The skill centers on connecting embeddings storage, index schemas, and retrieval APIs—classic integrations shelf work in Build.
Where it fits
Spike a small FLAT index on sample docs to prove RAG quality before committing to HNSW memory costs.
Define IndexSchema with COSINE FLOAT32 vectors and hook RedisVL hybrid queries into your API route.
Tune m and ef_construction against latency budgets before launch traffic.
Revisit algorithm choice when document count crosses the >10k vector threshold noted in the skill guidance.
How it compares
Skill package for Redis-native vector + hybrid patterns—not a hosted vector DB console or a generic embedding generator by itself.
Common Questions / FAQ
Who is redis-vector-search for?
Solo and indie developers building AI features who want Redis as the vector store and need agent-guided HNSW/FLAT and RedisVL setup.
When should I use redis-vector-search?
During Validate when you prototype RAG retrieval, in Build when you wire embeddings and indexes into your API, and in Operate when you tune recall or migrate index settings after traffic grows.
Is redis-vector-search safe to install?
Review the Security Audits panel on this Prism page and treat Redis credentials, network exposure, and data in indexes as production secrets before pointing agents at real clusters.
SKILL.md
READMESKILL.md - Redis Vector Search
{ "name": "redis-vector-search", "version": "1.0.0", "description": "Redis vector search — HNSW vs FLAT, vector index configuration, hybrid search, the RAG retrieval pattern with RedisVL.", "author": { "name": "Redis", "email": "support@redis.com" }, "homepage": "https://redis.io", "repository": "https://github.com/redis/agent-skills", "license": "MIT", "keywords": ["redis", "vector-search", "embeddings", "rag", "redisvl", "hnsw", "ai"] } # Choose HNSW vs FLAT Based on Requirements Select the right algorithm based on your accuracy requirements and dataset size. | Algorithm | Speed | Accuracy | Memory | Best For | |-----------|-------|----------|--------|----------| | HNSW | Fast (approximate) | ~95%+ recall tunable | Higher | Large datasets (>10k vectors) | | FLAT | Slower (exact) | 100% (exact) | Lower | Small datasets, accuracy-critical | **Correct:** Use HNSW for large-scale production workloads. ```python from redisvl.schema import IndexSchema # HNSW - fast approximate search, tunable accuracy schema = IndexSchema.from_dict({ "index": {"name": "idx:docs", "prefix": "doc:"}, "fields": [ {"name": "embedding", "type": "vector", "attrs": { "dims": 1536, "algorithm": "HNSW", "distance_metric": "COSINE", "datatype": "FLOAT32", "m": 16, # Higher = more accurate, more memory "ef_construction": 200 # Higher = better index quality, slower build }} ] }) ``` **Correct:** Use FLAT when exact results are required. ```python # FLAT - exact brute-force search, guaranteed accuracy schema = IndexSchema.from_dict({ "index": {"name": "idx:small", "prefix": "small:"}, "fields": [ {"name": "embedding", "type": "vector", "attrs": { "dims": 1536, "algorithm": "FLAT", "distance_metric": "COSINE" }} ] }) ``` **Tuning HNSW accuracy vs speed:** - `M`: Connections per node (16-64). Higher = better recall, more memory - `EF_CONSTRUCTION`: Build-time parameter (100-500). Higher = better graph quality - `EF_RUNTIME`: Query-time parameter. Higher = better recall, slower queries Reference: [Redis Vector Search](https://redis.io/docs/latest/develop/ai/search-and-query/vectors/) # Use Hybrid Search for Better Results Combine vector similarity with attribute filtering for more relevant results. In this rule, "hybrid" means filtered vector search. Redis and RedisVL also use "hybrid search" for text + vector fusion via `FT.HYBRID` / `HybridQuery`. **Correct:** Apply filters to reduce search space. ```python from redisvl.query import VectorQuery from redisvl.query.filter import Num, Tag filters = (Tag("category") == "technology") & (Num("date") >= 2024) & (Num("date") <= 2025) query = VectorQuery( vector=query_embedding, vector_field_name="embedding", return_fields=["content", "category", "date"], num_results=10, filter_expression=filters ) results = index.query(query) ``` **Incorrect:** Searching entire vector space when filters apply. ```python # Bad: No filter - searches all vectors then filters client-side results = index.query(VectorQuery( vector=query_embedding, vector_field_name="embedding", num_results=1000 )) # Client-side filtering - wasteful filtered = [r for r in results if r["category"] == "technology"] ``` **Tips:** - Use TAG fields for category filters - Use NUMERIC fields for date/price ranges - Redis auto-selects the filtered vector execution strategy; tune `hybrid_policy` only when needed - For true text + vector fusion, use `HybridQuery` on Redis >= 8.4.0 with redis-py >= 7.1.0; use `AggregateHybridQuery` on earlier Redis versions Reference: [Redis Vector Search](https://redis.io/docs/latest/develop/ai/search-and-query/vectors/) # Configure Vector Indexes Properly Set the correct dimensions, algorithm, and distance metric for your embeddings. Vector indexes can be created