public-redis-expert-baselisted
Install: claude install-skill seed-forge/harness-ai-kit
# Redis Knowledge Base
Foundational guidance for modeling data in Redis and connecting to it efficiently.
> **Source**: Adapted from [redis/agent-skills](https://github.com/redis/agent-skills) (redis-core + redis-connections + redis-clustering). Official Redis team content.
## Workflow
1. Identify the access pattern (read/write mix, data shape, latency target).
2. Choose the matching data structure (Section 1).
3. Design key names following conventions (Section 2).
4. Configure connection pool and timeouts (Section 3).
5. Batch work with pipelining (Section 4).
6. Plan for cluster mode if scaling (Section 5).
## Data Structure Selection
Pick the type that matches the *access pattern*, not just the shape of the data.
| Use case | Recommended type | Why |
|---|---|---|
| Simple values, counters | String | Atomic `INCR`/`DECR`, `SET`/`GET` |
| Object with independently updated fields | Hash | Per-field reads/writes, no whole-object rewrite |
| Queue, recent-N items | List | O(1) push/pop at ends |
| Unique items, membership checks | Set | O(1) `SADD`/`SISMEMBER`/`SCARD` |
| Rankings, score-based ranges | Sorted Set | Score-ordered; `ZADD`/`ZRANGE`/`ZRANK` |
| Nested / hierarchical data | JSON | Path-level updates, nested arrays, RQE indexing |
| Event log, fan-out messaging | Stream | Persistent, consumer groups |
| Vector similarity | Vector Set | Native vector storage with HNSW |
**Common anti-pattern:** stuffing a flat object into a serialized string. Use a Hash instead