Install
openclaw skills install @thcjp/redis-storeUse Redis effectively for caching, queues, and data structures with proper expiration and persist... 核心能力: - 智能代理领域的专业化AI辅助工具 - 基于高人气开源Skill深度优化升级 - 移除风险代码,增强安全性和稳定性 适用场景: - AI代理增强、记忆管理、自主决策 - 独立开发者与一人公司效率提升 - 自动化工作流与智能决策辅助 差异化:经过深度优化,去除原始风险代码,清理外部依赖引用,增强元数据和触发关键词,完全适配SkillHub平台规范。 触发关键词: redis, caching, queues, data, store, effectively
openclaw skills install @thcjp/redis-storeSET key value EX 3600SETEX or SET ... EXEXPIRE resets on key update by default—SET removes TTL; use SET ... KEEPTTL (Redis 6+)SCAN with large database: expired keys still show until cleanup cycle runsZADD limits:{user} {now} {request_id} + ZREMRANGEBYSCORE for sliding windowPFADD visitors {ip} uses 12KB for billions of uniquesXADD, XREAD, XACK—better than LIST for reliable queuesHSET user:1 name "Alice" email "a@b.com"—more memory efficient than JSON stringGET then SET is not atomic—another client can modify between; use INCR, SETNX, or LuaSETNX for locks: SET lock:resource {token} NX EX 30—NX = only if not existsWATCH/MULTI/EXEC for optimistic locking—transaction aborts if watched key changedEVAL "script" keys argsXREAD BLOCK + XACK patternappendfsync everysec is good balanceBGSAVE for manual snapshot—doesn't block but forks process, needs memory headroommaxmemory must be set—without it, Redis uses all RAM, then swap = disasterallkeys-lru for cache, volatile-lru for mixed, noeviction for persistent dataINFO memory shows usage—monitor used_memory vs maxmemory{user:1}:profile and {user:1}:sessions go to same slot—use for related keysMGET/MSET—error unless all keys in same slotMOVED redirect: client must follow—use cluster-aware client libraryINCR requests:{ip}:{minute} with EXPIRE—simple fixed windowSET ... NX EX + unique token—verify token on releaseQUIT on shutdown—graceful disconnectKEYS * blocks everything; use SCANmaxmemory—production Redis without limit will crash host| 依赖项 | 类型 | 是否必需 | 获取方式 |
|---|---|---|---|
| LLM API | API | 必需 | 由Agent内置LLM提供 |