skills/redis-query-engine/SKILL.md
Redis Query Engine (RQE) guidance covering FT.CREATE schema design, field type selection (TEXT, TAG, NUMERIC, GEO, GEOSHAPE, VECTOR), DIALECT 2 query syntax, efficient FT.SEARCH and FT.AGGREGATE queries, zero-downtime index updates via aliases, and the SKIPINITIALSCAN option. Use when defining a search index on Hash or JSON documents, picking between TEXT and TAG for filtering, writing FT.SEARCH queries with filters and SORTBY, managing or swapping indexes in production, or troubleshooting slow searches with FT.PROFILE.
npx skillsauth add redis/agent-skills redis-query-engineInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Guidance for using the Redis Query Engine (RQE) to index and search Hash or JSON documents. Covers schema design with FT.CREATE, field-type choices, query syntax, index lifecycle management, and the most common performance pitfalls.
FT.CREATE, FT.ALTER).FT.SEARCH / FT.AGGREGATE queries.TEXT, TAG, NUMERIC, GEO, GEOSHAPE, or VECTOR for a field.DIALECT 2 is the baseline. Other dialects (1, 3, 4) are deprecated as of Redis 8. Most modern client libraries already default to it — but specify it explicitly in raw commands for portability.
FT.SEARCH idx:products "@name:laptop" DIALECT 2
DIALECT 2 is required for vector search queries. It also handles special characters and NULLs predictably.
See references/dialect.md.
The field type decides both what you can query and how fast that query is. Use the narrowest type that supports your access pattern.
| Field type | Use when | Notes |
|---|---|---|
| TEXT | Full-text search needed | Tokenized + stemmed; not for exact match |
| TAG | Exact match / filtering | Add SORTABLE UNF for fastest tag queries |
| NUMERIC | Range queries, sorting | Prices, counts, timestamps |
| GEO | Lat/long point queries | Single points (stores, users) |
| GEOSHAPE | Polygon / area queries | Delivery zones, regions |
| VECTOR | Similarity search | HNSW or FLAT; see redis-vector-search |
The classic mistake is using TEXT for a category or status field because "it's a string." TAG is 10× faster for those.
See references/field-types.md.
FT.CREATE without a PREFIX indexes every matching key in the database; with a wide schema it can blow up index size and write latency.
FT.CREATE idx:products ON HASH PREFIX 1 product:
SCHEMA
name TEXT WEIGHT 2.0
category TAG SORTABLE
price NUMERIC SORTABLE
location GEO
Rules of thumb:
PREFIX (or filter via FILTER expression).FT.INFO idx:<name> to monitor index size after adding fields.SORTABLE only on fields you actually sort by; it has a memory cost.See references/index-creation.md.
For schema changes in production, keep application queries pointed at an alias and swap the underlying index.
FT.CREATE idx:products_v2 ON HASH PREFIX 1 product: SCHEMA ...
FT.ALIASUPDATE products idx:products_v2
# App queries are stable:
FT.SEARCH products "@category:{electronics}"
Useful management commands: FT.INFO, FT.DROPINDEX, FT._LIST, FT.ALIASADD/UPDATE/DEL.
See references/index-management.md.
By default FT.CREATE walks all existing keys that match the prefix and indexes them. Use SKIPINITIALSCAN only when:
For most schema migrations, the default (scan everything) is what you want.
See references/skip-initial-scan.md.
*Narrow the result set with filters before paging or aggregating.
# Good — specific filter, limited fields returned
FT.SEARCH idx:products "@category:{electronics} @price:[100 500]"
LIMIT 0 20
RETURN 3 name price category
# Bad — full scan plus unbounded LIMIT
FT.SEARCH idx:products "*" LIMIT 0 10000
Other levers:
SORTBY requires SORTABLE on the sort field. Without it, sort is slow.LIMIT early; the engine still processes everything above the limit if you don't.RETURN specific fields — don't fetch the whole document if you only need a few.FT.PROFILE idx:<name> SEARCH QUERY "<query>" when a query is slow.See references/query-optimization.md.
development
Redis vector search guidance covering HNSW vs FLAT algorithm choice, vector index configuration (dims, distance metric, datatype), filtered hybrid search combining vector similarity with TAG or NUMERIC filters, and the RAG retrieval pattern with RedisVL. Use when defining a VECTOR field in FT.CREATE, integrating embeddings (OpenAI, Cohere, sentence-transformers), tuning HNSW parameters (M, EF_CONSTRUCTION, EF_RUNTIME), building a retrieval-augmented generation pipeline, or filtering vector results by attribute.
development
Redis LangCache guidance for semantic caching of LLM responses on Redis Cloud — calling search/set via the SDK or REST API, tuning the similarity threshold, separating caches per task type, and filtering with custom attributes. Use when caching LLM completions or RAG answers to cut API cost and latency, building a cache-aside layer in front of OpenAI / Anthropic / etc., tuning hit rate vs precision, or splitting one app's LLM workloads into multiple LangCache caches.
testing
Redis security guidance covering authentication (requirepass and ACL users), TLS, ACL-based least-privilege access control, restricting network exposure via bind and protected-mode, firewall rules, and disabling dangerous commands. Use when deploying Redis to production, defining ACL users for an application, configuring TLS connections, locking down a Redis instance behind a firewall, or auditing a Redis deployment for security hardening.
tools
Redis observability guidance — which metrics to monitor (memory, connections, hit ratio, ops/sec, rejected connections), which built-in commands to reach for during incident triage (SLOWLOG, INFO, MEMORY DOCTOR, CLIENT LIST, FT.PROFILE), and when to use the Redis Insight GUI. Use when setting up monitoring or alerts for a Redis instance, diagnosing a performance regression, profiling a slow FT.SEARCH query, or wiring Redis metrics into Prometheus, Datadog, or similar.