Agent Skills: Redis Modules Skill

Master Redis modules - RedisJSON, RediSearch, RedisTimeSeries, RedisBloom, and extending Redis functionality

redisredisjsonredisearchredistimeseriesredisbloom
databaseID: pluginagentmarketplace/custom-plugin-redis/redis-modules

Skill Files

Browse the full folder contents for redis-modules.

Download Skill

Loading file tree…

skills/redis-modules/SKILL.md

Skill Metadata

Name
redis-modules
Description
Master Redis modules - RedisJSON, RediSearch, RedisTimeSeries, RedisBloom, and extending Redis functionality

Redis Modules Skill

RedisJSON

JSON document storage and manipulation.

# Set document
JSON.SET user:1 $ '{"name":"John","age":30,"tags":["redis"]}'

# Get path
JSON.GET user:1 $.name              # "John"
JSON.GET user:1 $                   # Full document

# Modify
JSON.NUMINCRBY user:1 $.age 1       # Increment
JSON.ARRAPPEND user:1 $.tags '"new"' # Add to array
JSON.SET user:1 $.email '"john@example.com"'

RediSearch

Full-text search and secondary indexing.

# Create index
FT.CREATE idx:users ON JSON PREFIX 1 user:
  SCHEMA
    $.name AS name TEXT SORTABLE
    $.email AS email TAG
    $.age AS age NUMERIC SORTABLE

# Search
FT.SEARCH idx:users "@name:John"
FT.SEARCH idx:users "@age:[25 35]"
FT.SEARCH idx:users "@email:{john@example.com}"

# Aggregate
FT.AGGREGATE idx:users "*"
  GROUPBY 1 @age
  REDUCE COUNT 0 AS count

RedisTimeSeries

Time-series data with aggregations.

# Create series
TS.CREATE sensor:temp RETENTION 86400000 LABELS type temperature location office

# Add samples
TS.ADD sensor:temp * 23.5
TS.MADD sensor:temp * 23.5 sensor:humidity * 45

# Query
TS.RANGE sensor:temp - + AGGREGATION avg 3600000  # Hourly avg
TS.MRANGE - + FILTER location=office

RedisBloom

Probabilistic data structures.

# Bloom filter
BF.ADD filter:emails "user@example.com"
BF.EXISTS filter:emails "user@example.com"  # 1 (might exist)
BF.EXISTS filter:emails "other@example.com" # 0 (definitely not)

# Cuckoo filter (allows delete)
CF.ADD filter:users "user123"
CF.DEL filter:users "user123"

# Count-Min Sketch
CMS.INCRBY sketch item1 5 item2 3
CMS.QUERY sketch item1  # ~5

Loading Modules

# redis.conf
loadmodule /opt/redis-stack/lib/rejson.so
loadmodule /opt/redis-stack/lib/redisearch.so
loadmodule /opt/redis-stack/lib/redistimeseries.so
loadmodule /opt/redis-stack/lib/redisbloom.so

Docker (Redis Stack)

docker run -p 6379:6379 redis/redis-stack:latest

Assets

  • docker-compose-stack.yml - Redis Stack with modules

References

  • MODULES_GUIDE.md - Complete guide

Troubleshooting

Module Not Loaded

MODULE LIST  # Check loaded modules

Fix: Check loadmodule path

Index Not Found

FT._LIST  # List indexes

Fix: Create index first


Error Codes

| Code | Name | Recovery | |------|------|----------| | MOD001 | NOT_LOADED | Check loadmodule | | MOD002 | NO_INDEX | FT.CREATE index | | MOD003 | SCHEMA_ERR | Fix schema definition |