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.

3,891 stars
Complexity: medium

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

$curl -o ~/.claude/skills/memory-cache/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/1999azzar/memory-cache/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/memory-cache/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How memory-cache Compares

Feature / Agentmemory-cacheStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexitymediumN/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

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

3891
from openclaw/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.

General Utilities

filesystem

3891
from openclaw/skills

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.

General Utilities

Budget & Expense Tracker — AI Agent Financial Command Center

3891
from openclaw/skills

Track every dollar, enforce budgets, spot spending patterns, and build wealth — all through natural conversation with your AI agent.

General Utilities

yt-dlp

3891
from openclaw/skills

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.

General Utilities

time-checker

3891
from openclaw/skills

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.

General Utilities

pihole-ctl

3891
from openclaw/skills

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".

General Utilities

mermaid-architect

3891
from openclaw/skills

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".

General Utilities

mema

3891
from openclaw/skills

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.

General Utilities

file-organizer-skill

3891
from openclaw/skills

Organize files in directories by grouping them into folders based on their extensions or date. Includes Dry-Run, Recursive, and Undo capabilities.

General Utilities

media-compress

3891
from openclaw/skills

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".

General Utilities

edge-tts

3891
from openclaw/skills

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.

General Utilities

ocr-local

3891
from openclaw/skills

Extract text from images using Tesseract.js OCR (100% local, no API key required). Supports Chinese (simplified/traditional) and English.

General Utilities