Q Memory: Universal Memory Management System for Openclaw

A sophisticated memory management system for AI agents that integrates state awareness, loop protection, and hybrid semantic search to optimize token usage.

zhuangclaw
v1.8.5-no-crypto
Feb 16, 2026
0
0
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install q-memory

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install q-memory using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Q Memory: Universal Memory Management System?

Q Memory is a robust Universal Memory Management System engineered to provide Openclaw Skills with a persistent, intelligent context layer. It utilizes a 3-level hierarchical tree structure for precise data classification, ensuring that AI agents can retrieve relevant information with surgical accuracy. By implementing advanced search algorithms and state-driven behavior, it bridges the gap between simple data storage and active cognitive awareness for autonomous agents.

At its core, this skill addresses the challenges of token bloat and context loss in complex workflows. It empowers agents to maintain distinct states such as DOING or WAITING, allowing them to manage their own heartbeat checks and resource allocation. For developers building on the Openclaw Skills platform, Q Memory offers a standardized way to handle multi-agent coordination and long-term knowledge retention.

Q Memory: Universal Memory Management System Use Cases

  • Managing long-term project context and technical specifications across multiple specialized AI agents.
  • Preventing resource exhaustion and infinite loops in autonomous tasks using automated stagnation detection.
  • Securing sensitive API credentials and private user data with industrial-grade AES-128-CBC encryption.
  • Reducing operational costs by using hybrid search to filter only the most relevant context for LLM queries.
  • Implementing automated data lifecycle management through a weighted memory decay and cleanup system.

How Q Memory: Universal Memory Management System Works

  1. Data is ingested and classified into a three-level tree structure (e.g., Tech > Config > API) using AI-driven smart inference.
  2. The system assigns weights—Critical, Important, or Normal—to each memory entry to determine its priority and lifecycle.
  3. Agents update their internal state machine to adjust heartbeat frequency and notification strategies based on their current task.
  4. When a query is made, the hybrid search engine runs TF-IDF semantic analysis alongside geometric neighbor matching to return high-relevance results.
  5. The loop protection layer continuously monitors execution time and progress, automatically downgrading priorities or blocking tasks that exceed safety thresholds.
  6. A background decay process periodically archives or deletes old memories based on their assigned weight and age.

Q Memory: Universal Memory Management System Setup

To deploy Q Memory within your environment, follow these installation and integration steps:

# Install the skill via ClawHub
clawhub install q-memory

# Configure the heartbeat integration for agent state awareness
cp scripts/heartbeat_integration.py /home/node/.openclaw/workspace/heartbeat.py
chmod +x /home/node/.openclaw/workspace/heartbeat.py

# Schedule the heartbeat via crontab (e.g., every 20 minutes)
(crontab -l ; echo "*/20 * * * * python3 /home/node/.openclaw/workspace/heartbeat.py") | crontab -

# Initialize your first encrypted memory store
python qst_memory.py save "Initial setup" --category "Tech_Config_API"

Q Memory: Universal Memory Management System Data Schema & Taxonomy

The skill organizes information using a structured taxonomy and metadata-rich storage format.

Field Description Example
Hierarchy 3-level tree classification QST > Physics > FSCA
Weight Priority level for decay/search [C]ritical, [I]mportant, [N]ormal
State Current agent operational status IDLE, DOING, BLOCKED, COMPLETED
Metadata Timestamps and event history Created, Updated, Progress %

All sensitive data is handled through the MemoryCrypto module, which stores encrypted strings with an ENC:: prefix, while agent-specific states are maintained in individual JSON files to support multi-agent Openclaw Skills environments.

Q Memory: Universal Memory Management System Advanced Features

  • Multi-Agent State Tracking: Independent state machines for agents like qst, mengtian, and lisi to prevent context bleeding.
  • Anti-Loop Protection v1.8.2: Four layers of safety including heartbeat throttling, stagnation detection, and auto-recovery actions.
  • User Priority Window: A smart mechanism that pauses system heartbeats during active user interactions to ensure immediate responsiveness.
  • Hybrid Search Engine: Combines tree-based matching with enhanced TF-IDF semantic inference for 95% relevance accuracy.
  • Dynamic Decay Multipliers: Automatically calculates the age and relevance of data to prune non-essential logs while preserving critical project keys.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*