memory-cache
High-performance temporary storage system using Redis. Supports namespaced keys (mema:*), TTL management, and session context caching. Use for: (1) Saving agent state, (2) Caching API results, (3) Sharing data between sub-agents.
About this skill
This skill provides AI agents with a robust and high-performance temporary storage system built on Redis. It enables agents to efficiently manage various types of data, including their operational state (`mema:state:*`), volatile cache data (`mema:cache:*`), and session context (`mema:context:*`) through a standardized naming convention. The system supports Time-To-Live (TTL) management, ensuring data expiration and preventing stale entries. Designed to enhance agent capabilities, this memory cache is crucial for scenarios requiring data persistence across turns or sub-tasks without resorting to full database solutions. It allows agents to offload intermediate results, track progress, and communicate seamlessly. By leveraging Redis, the skill offers rapid data access and manipulation, which is vital for maintaining responsive and efficient AI workflows. Users would deploy this skill to stabilize complex agent behaviors, improve performance by avoiding repetitive computations or API calls, and facilitate advanced multi-agent architectures where shared context is key. It acts as a reliable, fast-access scratchpad for dynamic AI operations.
Best use case
The primary use case for this skill is to provide AI agents with a rapid and reliable mechanism for storing and retrieving temporary data, internal state, and shared context. This benefits AI agents engaged in multi-step workflows, long-running tasks, or those operating within an ecosystem of sub-agents that need to exchange information efficiently. It minimizes redundant processing and ensures state continuity, making agents more robust and capable.
High-performance temporary storage system using Redis. Supports namespaced keys (mema:*), TTL management, and session context caching. Use for: (1) Saving agent state, (2) Caching API results, (3) Sharing data between sub-agents.
Users can expect efficient and standardized storage, retrieval, and management of temporary data, agent state, and shared context via Redis, significantly improving agent performance and reliability.
Practical example
Example input
As an AI agent, I need to store the current processing step for a user request. Use the `memory-cache` skill to set `mema:state:user_request_123_step` to 'processing_data' with a TTL of 1 hour, then retrieve it immediately to confirm.
Example output
Key `mema:state:user_request_123_step` set to 'processing_data' with TTL 3600. Retrieved value for `mema:state:user_request_123_step`: 'processing_data'.
When to use this skill
- When an AI agent needs to save its current operational state or progress for later retrieval.
- To cache results from API calls or intensive computations to avoid re-execution and improve response times.
- For sharing specific data points or contextual information between different sub-agents or modular components.
- When a fast, temporary key-value store is required for agent-specific data management.
When not to use this skill
- For permanent, long-term archival storage that requires a robust database with complex querying.
- If the required data is extremely sensitive and demands advanced, built-in encryption features at rest.
- When Redis infrastructure is not available or the overhead of managing it is disproportionate to the small data volume.
- For very simple, ephemeral data that can be managed entirely within the agent's immediate memory.
Installation
Claude Code / Cursor / Codex
Manual Installation
- Download SKILL.md from GitHub
- Place it in
.claude/skills/memory-cache/SKILL.mdinside your project - Restart your AI agent — it will auto-discover the skill
How memory-cache Compares
| Feature / Agent | memory-cache | Standard Approach |
|---|---|---|
| Platform Support | Not specified | Limited / Varies |
| Context Awareness | High | Baseline |
| Installation Complexity | medium | N/A |
Frequently Asked Questions
What does this skill do?
High-performance temporary storage system using Redis. Supports namespaced keys (mema:*), TTL management, and session context caching. Use for: (1) Saving agent state, (2) Caching API results, (3) Sharing data between sub-agents.
How difficult is it to install?
The installation complexity is rated as medium. You can find the installation instructions above.
Where can I find the source code?
You can find the source code on GitHub using the link provided at the top of the page.
Related Guides
Top AI Agents for Productivity
See the top AI agent skills for productivity, workflow automation, operational systems, documentation, and everyday task execution.
Best AI Skills for ChatGPT
Find the best AI skills to adapt into ChatGPT workflows for research, writing, summarization, planning, and repeatable assistant tasks.
AI Agents for Freelancers
Browse AI agent skills for freelancers handling client research, proposals, outreach, delivery systems, documentation, and repeatable admin work.
SKILL.md Source
# Memory Cache Standardized Redis-backed caching system for OpenClaw agents. ## Prerequisites - **Binary**: `python3` must be available on the host. - **Credentials**: `REDIS_URL` environment variable (e.g., `redis://localhost:6379/0`). ## Setup 1. Copy `env.example.txt` to `.env`. 2. Configure your connection in `.env`. 3. Dependencies are listed in `requirements.txt`. ## Core Workflows ### 1. Store and Retrieve - **Store**: `python3 $WORKSPACE/skills/memory-cache/scripts/cache_manager.py set mema:cache:<name> <value> [--ttl 3600]` - **Fetch**: `python3 $WORKSPACE/skills/memory-cache/scripts/cache_manager.py get mema:cache:<name>` ### 2. Search & Maintenance - **Scan**: `python3 $WORKSPACE/skills/memory-cache/scripts/cache_manager.py scan [pattern]` - **Ping**: `python3 $WORKSPACE/skills/memory-cache/scripts/cache_manager.py ping` ## Key Naming Convention Strictly enforce the `mema:` prefix: - `mema:context:*` – Session state. - `mema:cache:*` – Volatile data. - `mema:state:*` – Persistent state.
Related Skills
find-skills
Helps users discover and install agent skills when they ask questions like "how do I do X", "find a skill for X", "is there a skill that can...", or express interest in extending capabilities. This skill should be used when the user is looking for functionality that might exist as an installable skill.
filesystem
Advanced filesystem operations for listing files, searching content, batch processing, and directory analysis. Supports recursive search, file type filtering, size analysis, and batch operations like copy/move/delete. Use when you need to: list directory contents, search for files by name or content, analyze directory structures, perform batch file operations, or analyze file sizes and distribution.
Budget & Expense Tracker — AI Agent Financial Command Center
Track every dollar, enforce budgets, spot spending patterns, and build wealth — all through natural conversation with your AI agent.
yt-dlp
A robust CLI wrapper for yt-dlp to download videos, playlists, and audio from YouTube and thousands of other sites. Supports format selection, quality control, metadata embedding, and cookie authentication.
time-checker
Check accurate current time, date, and timezone information for any location worldwide using time.is. Use when the user asks "what time is it in X", "current time in Y", or needs to verify timezone offsets.
pihole-ctl
Manage and monitor local Pi-hole instance. Query FTL database for statistics (blocked ads, top clients) and control service via CLI. Use when user asks "how many ads blocked", "pihole status", or "update gravity".
mermaid-architect
Generate beautiful, hand-drawn Mermaid diagrams with robust syntax (quoted labels, ELK layout). Use this skill when the user asks for "diagram", "flowchart", "sequence diagram", or "visualize this process".
mema
Mema's personal brain - SQLite metadata index for documents and Redis short-term context buffer. Use for organizing workspace knowledge paths and managing ephemeral session state.
file-organizer-skill
Organize files in directories by grouping them into folders based on their extensions or date. Includes Dry-Run, Recursive, and Undo capabilities.
media-compress
Compress and convert images and videos using ffmpeg. Use when the user wants to reduce file size, change format, resize, or optimize media files. Handles common formats like JPG, PNG, WebP, MP4, MOV, WebM. Triggers on phrases like "compress image", "compress video", "reduce file size", "convert to webp/mp4", "resize image", "make image smaller", "batch compress", "optimize media".
edge-tts
Text-to-speech conversion using node-edge-tts npm package for generating audio from text. Supports multiple voices, languages, speed adjustment, pitch control, and subtitle generation. Use when: (1) User requests audio/voice output with the "tts" trigger or keyword. (2) Content needs to be spoken rather than read (multitasking, accessibility, driving, cooking). (3) User wants a specific voice, speed, pitch, or format for TTS output.
ocr-local
Extract text from images using Tesseract.js OCR (100% local, no API key required). Supports Chinese (simplified/traditional) and English.