← Back to Skills Marketplace
Memory Optimization
by
richardiitse
· GitHub ↗
· v1.0.4
· MIT-0
333
Downloads
0
Stars
1
Active Installs
5
Versions
Install in OpenClaw
/install memory-optimization
Description
Comprehensive memory management optimization for AI agents. Use when: (1) Agent experiences context compression amnesia, (2) Need to rebuild context quickly...
Usage Guidance
This package implements a full memory/knowledge-graph toolset (many Python scripts and shell scripts) but the registry metadata understates its runtime needs. Before installing or running it: 1) Inspect scripts/utils/llm_client.py and any code that performs network I/O to identify which environment variables or API keys are actually required (do not supply real credentials until you review). 2) Search the repo for hard-coded keys, endpoints, or upload/exfil endpoints. The CHANGELOG explicitly mentions a prior security audit with HIGH severity findings (API key exposure, prompt injection) — treat that as a warning and ask the author for remediation or a clean release. 3) Run the code in a sandboxed environment (isolated VM or container) without sensitive files mounted; do not point it at ~/.openclaw, agents/, or other directories with secrets until you are confident. 4) If you plan to use embedding/LLM features, create a limited-scope API key (minimal privileges, cost limits) and rotate it after testing. 5) If you need this functionality but cannot audit the code yourself, prefer an alternative with clearer metadata and declared env requirements or request the maintainer to: declare required env vars, document network endpoints, remove hard-coded secrets, and provide a security-fix release.
Capability Analysis
Type: OpenClaw Skill
Name: memory-optimization
Version: 1.0.4
The memory-optimization skill is a comprehensive and well-engineered memory management system for AI agents, implementing a three-layer architecture (Working, Episodic, and Semantic memory) using a Knowledge Graph. The bundle includes sophisticated scripts for entity deduplication, semantic consolidation, and time-based memory decay. Security analysis reveals proactive safety measures, such as path traversal validation for the knowledge graph directory in `scripts/memory_ontology/config.py` and the use of file locking to ensure data integrity in `scripts/memory_ontology/storage.py`. All code logic and AI agent instructions in `SKILL.md` are strictly aligned with the stated purpose of improving context recovery and long-term information retention without any signs of malicious intent or data exfiltration.
Capability Assessment
Purpose & Capability
The name/description (memory optimization, KG, TL;DRs, daily cleanup) align with the included scripts and docs (memory_ontology.py, kg_extractor.py, consolidation/decay engines). However the registry metadata claimed 'instruction-only / no required env vars', but the repo contains a full CLI toolset that clearly expects environment configuration (model / API endpoints, KG_DIR, etc.). That mismatch is unexpected and should be justified by the maintainer.
Instruction Scope
SKILL.md explicitly instructs agents to read local files at session start (SOUL.md, USER.md, memory/YYYY-MM-DD.md, MEMORY.md) and to run scripts that process agent session logs (kg_extractor.py --agents-dir agents/). Reading these files is plausible for a memory system, but they can contain sensitive identity/user preferences or other agents' data. The instructions also reference using LLM embedding/model settings (OPENAI_MODEL / OPENAI_BASE_URL) and running scripts that can batch-process directories — broad file access and batch processing of agents/ is within scope for a KG tool but increases risk if run without inspection.
Install Mechanism
There is no external install step (no network download spec). The repository includes many code files (scripts/*.py, shell scripts, tests) bundled with the skill. That means code will be present and executable in the user's workspace when installed — review the code before executing. No direct remote install was specified (good), but included scripts may themselves call external network APIs at runtime.
Credentials
Registry metadata lists no required environment variables, but multiple docs and scripts refer to environment configuration (OPENAI_MODEL, OPENAI_BASE_URL, KG_DIR, and options to pass api-key). The code includes an LLM client and embedding usage (entity deduplication, preference engine). Declaration mismatch (no required env vars) is problematic: the skill likely needs API keys and endpoints to function and may attempt network calls using those values. The CHANGELOG explicitly notes a prior 'CSO Audit' with '1 HIGH API key exposure' and '1 HIGH prompt injection risk', which suggests past or present sensitive handling of credentials/prompts.
Persistence & Privilege
The skill is not marked always:true and does not request special platform privileges in metadata. It does suggest creating/using shared KG files in ~/.openclaw/shared-kg and linking graph.jsonl, which means it expects persistent storage access in the user's home directory — reasonable for a memory/graph tool but be aware of the persistent file paths referenced.
How to Use
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install memory-optimization - After installation, invoke the skill by name or use
/memory-optimization - Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.4
Version 1.0.4: .gitignore update, docs/ removed from git history, security audit (CSO), version bump to 1.0.4
v1.0.3
- Updated documentation in SKILL.md to use more general English terminology for section headings, code examples, and usage instructions.
- Replaced localized terms (such as TL;DR 摘要 and related headings) with English equivalents (e.g., TL;DR Summary, Core Achievements).
- Enhanced clarity and consistency in Quick Start, Usage Examples, Environment Variables, and configuration instructions.
- No code or logic changes; documentation only.
v1.0.2
- Major update: Expanded functionality with new scripts, agent examples, documentation, and usage tracking.
- Added comprehensive code for memory engines, entity management, knowledge graph extraction, consolidation, decay, and dashboard features.
- Introduced a Skill Usage Tracker for analyzing and recording skill usage patterns.
- Multi-agent sample configs and session files provided for easy integration.
- Enhanced documentation, quick references, and multilingual support (including README_CN.md).
- Obsolete or reorganized files removed to streamline structure and focus on new capabilities.
v1.0.1
- Added comprehensive ontology documentation and configuration files under the `ontology/` directory, including implementation summary, integration guide, quick reference, entity templates, memory and network schemas, and subagent configurations.
- Expanded support for structured and knowledge graph-based memory management with detailed schema and reference files.
- Improved modularity and maintainability by separating ontology and integration resources.
- No changes to existing feature descriptions or usage instructions; skill functionality and purpose remain the same.
v1.0.0
Initial release: Complete memory management system with TL;DR summaries, three-file pattern, knowledge graph integration, and automated daily cleanup. Achieves 98% faster context recovery and 99% file size reduction. Includes 8 subsystems: TL;DR Summary, Three-File Pattern, Fixed Tags, Daily Cleanup Script, HEARTBEAT Integration, Rolling Summary Template, Testing Framework (6/6 tests), and Knowledge Graph (18 entities, 15 relations).
Metadata
Frequently Asked Questions
What is Memory Optimization?
Comprehensive memory management optimization for AI agents. Use when: (1) Agent experiences context compression amnesia, (2) Need to rebuild context quickly... It is an AI Agent Skill for Claude Code / OpenClaw, with 333 downloads so far.
How do I install Memory Optimization?
Run "/install memory-optimization" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Memory Optimization free?
Yes, Memory Optimization is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Memory Optimization support?
Memory Optimization is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Memory Optimization?
It is built and maintained by richardiitse (@richardiitse); the current version is v1.0.4.
More Skills