redis-development
Scannednpx machina-cli add skill redis/agent-skills/redis-development --openclawRedis Best Practices
Comprehensive performance optimization guide for Redis, including Redis Query Engine, vector search, and semantic caching. Contains 29 rules across 11 categories, prioritized by impact to guide automated optimization and code generation.
When to Apply
Reference these guidelines when:
- Designing Redis data models and key structures
- Implementing caching, sessions, or real-time features
- Using Redis Query Engine (FT.CREATE, FT.SEARCH, FT.AGGREGATE)
- Building vector search or RAG applications with RedisVL
- Implementing semantic caching with LangCache
- Optimizing Redis performance and memory usage
Rule Categories by Priority
| Priority | Category | Impact | Prefix |
|---|---|---|---|
| 1 | Data Structures & Keys | HIGH | data- |
| 2 | Memory & Expiration | HIGH | ram- |
| 3 | Connection & Performance | HIGH | conn- |
| 4 | JSON Documents | MEDIUM | json- |
| 5 | Redis Query Engine | HIGH | rqe- |
| 6 | Vector Search & RedisVL | HIGH | vector- |
| 7 | Semantic Caching | MEDIUM | semantic-cache- |
| 8 | Streams & Pub/Sub | MEDIUM | stream- |
| 9 | Clustering & Replication | MEDIUM | cluster- |
| 10 | Security | HIGH | security- |
| 11 | Observability | MEDIUM | observe- |
Quick Reference
1. Data Structures & Keys (HIGH)
data-choose-structure- Choose the Right Data Structuredata-key-naming- Use Consistent Key Naming Conventions
2. Memory & Expiration (HIGH)
ram-limits- Configure Memory Limits and Eviction Policiesram-ttl- Set TTL on Cache Keys
3. Connection & Performance (HIGH)
conn-blocking- Avoid Slow Commands in Productionconn-pipelining- Use Pipelining for Bulk Operationsconn-pooling- Use Connection Pooling or Multiplexingconn-timeouts- Configure Connection Timeouts
4. JSON Documents (MEDIUM)
json-partial-updates- Use JSON Paths for Partial Updatesjson-vs-hash- Choose JSON vs Hash Appropriately
5. Redis Query Engine (HIGH)
rqe-dialect- Use DIALECT 2 for Query Syntaxrqe-field-types- Choose the Correct Field Typerqe-index-creation- Index Only Fields You Queryrqe-index-management- Manage Indexes for Zero-Downtime Updatesrqe-query-optimization- Write Efficient Queries
6. Vector Search & RedisVL (HIGH)
vector-algorithm-choice- Choose HNSW vs FLAT Based on Requirementsvector-hybrid-search- Use Hybrid Search for Better Resultsvector-index-creation- Configure Vector Indexes Properlyvector-rag-pattern- Implement RAG Pattern Correctly
7. Semantic Caching (MEDIUM)
semantic-cache-best-practices- Configure Semantic Cache Properlysemantic-cache-langcache-usage- Use LangCache for LLM Response Caching
8. Streams & Pub/Sub (MEDIUM)
stream-choosing-pattern- Choose Streams vs Pub/Sub Appropriately
9. Clustering & Replication (MEDIUM)
cluster-hash-tags- Use Hash Tags for Multi-Key Operationscluster-read-replicas- Use Read Replicas for Read-Heavy Workloads
10. Security (HIGH)
security-acls- Use ACLs for Fine-Grained Access Controlsecurity-auth- Always Use Authentication in Productionsecurity-network- Secure Network Access
11. Observability (MEDIUM)
observe-commands- Use Observability Commands for Debuggingobserve-metrics- Monitor Key Redis Metrics
How to Use
Read individual rule files for detailed explanations and code examples:
rules/rqe-index-creation.md
rules/vector-rag-pattern.md
Each rule file contains:
- Brief explanation of why it matters
- Correct example(s) with explanation
- Either an "Incorrect" example (for anti-patterns that cause real harm) or "When to use / When NOT needed" guidance (for optional features)
- Additional context and references
Full Compiled Document
For the complete guide with all rules expanded: AGENTS.md
Source
git clone https://github.com/redis/agent-skills/blob/main/skills/redis-development/SKILL.mdView on GitHub Overview
A comprehensive guide to optimize Redis performance across data structures, queries, vectors, and caching. It covers 29 rules across 11 categories to guide design, caching, and tuning.
How This Skill Works
The guide organizes rules by priority and category, presenting explanations, examples, and implementation guidance in dedicated rule files. Practitioners apply these rules to data modeling, memory management, query optimization, and vector/search caching to achieve better performance and zero-downtime updates.
When to Use It
- When designing Redis data models and key structures to maximize performance and consistency
- When implementing caching, sessions, or real-time features that demand low latency
- When building and tuning Redis Query Engine (FT.CREATE, FT.SEARCH, FT.AGGREGATE) workloads
- When implementing vector search or RAG applications with RedisVL
- When enabling semantic caching with LangCache or optimizing overall Redis performance and memory usage
Quick Start
- Step 1: Review the 11 rule categories and identify applicable ones (data, ram, conn, rqe, vector, semantic-cache)
- Step 2: Open and read specific rule files like rules/rqe-index-creation.md and rules/vector-rag-pattern.md to understand explanations and examples
- Step 3: Implement the recommended changes in a staging environment, measure latency/memory impact, and iterate
Best Practices
- Choose the right data structures and maintain consistent key naming (data-choose-structure, data-key-naming)
- Configure memory limits and eviction policies, and set TTLs on cache keys (ram-limits, ram-ttl)
- Avoid slow commands in production; use pipelining and connection pooling (conn-blocking, conn-pipelining, conn-pooling)
- Use Redis Query Engine effectively: dialects, field types, and indexing (rqe-dialect, rqe-field-types, rqe-index-creation, rqe-index-management, rqe-query-optimization)
- Optimize vector search and semantic caching: algorithm choice, hybrid search, vector indexing, and LangCache usage (vector-algorithm-choice, vector-hybrid-search, vector-index-creation, vector-rag-pattern, semantic-cache-langcache-usage)
Example Use Cases
- A high-traffic session store using TTLs and consistent key naming to ensure fast eviction and retrieval
- A fast full-text search implementation with FT.CREATE/FT.SEARCH using proper index fields
- A vector search/RAG app leveraging RedisVL with appropriate index type and hybrid search for improved results
- Semantic caching of LLM responses with LangCache to reduce latency and API costs
- Zero-downtime index updates and smooth migrations using RQE index management