← Back to Skills Marketplace
blackchen12

enterprise-memory-skill

by blackchen12 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
103
Downloads
0
Stars
0
Active Installs
1
Versions
Install in OpenClaw
/install enterprise-memory-skill
Description
Manages enterprise-level long-term memory by storing, retrieving, and filtering text data using vector similarity and confidence thresholds.
README (SKILL.md)

import os\r import logging\r from pathlib import Path\r from typing import Dict, Any, Optional\r \r from openclaw.core.skill import BaseSkill\r from .vectorstorage import VectorStorage\r \r logger = logging.getLogger(name)\r \r class EnterpriseMemorySkill(BaseSkill):\r """\r Enterprise Memory Skill - OpenClaw 企业级长期记忆插件 (v1.1.1)\r """\r \r def init(self):\r super().init()\r self.vector_storage: Optional[VectorStorage] = None\r self.plugin_dir = Path(file).parent.absolute()\r self.config = {}\r \r def load_config(self):\r yaml_path = self.plugin_dir / "memory_config.yaml"\r try:\r import yaml\r with open(yaml_path, 'r', encoding='utf-8') as f:\r self.config = yaml.safe_load(f) or {}\r logger.info(f"✅ Loaded memory config from {yaml_path}")\r except Exception as e:\r logger.warning(f"⚠️ Failed to load memory_config.yaml: {e}")\r self.config = {}\r \r def _init_storage(self):\r if not self.vector_storage:\r try:\r yaml_path = str(self.plugin_dir / "memory_config.yaml")\r self.vector_storage = VectorStorage(config_path=yaml_path)\r logger.info("✅ VectorStorage initialized successfully.")\r except Exception as e:\r logger.error(f"❌ VectorStorage init failed: {e}")\r self.vector_storage = None\r \r def on_startup(self):\r logger.info("🚀 Enterprise Memory Skill Starting...")\r self.load_config()\r self._init_storage()\r if self.vector_storage:\r self.vector_storage.initialize_model()\r \r def on_shutdown(self):\r logger.info("🛑 Enterprise Memory Skill Shutting down...")\r if self.vector_storage:\r self.vector_storage._save_db()\r del self.vector_storage\r \r def get_context(self, query: str, context_limit: int = 2000) -> str:\r if not self.vector_storage:\r return ""\r try:\r top_k = self.config.get('retrieval_top_k', 5)\r results = self.vector_storage.retrieve_similar(query, top_k=top_k)\r if not results:\r return ""\r \r chunks = []\r total = 0\r threshold = self.config.get('retrieval_threshold', 0.82)\r for uuid_str, text, score in results:\r if total >= context_limit:\r break\r if score \x3C threshold:\r continue\r chunk = f"[Memory {uuid_str[:8]} | Score: {score:.3f}] {text}"\r chunks.append(chunk)\r total += len(chunk)\r return "
".join(chunks)\r except Exception as e:\r logger.error(f"get_context error: {e}")\r return ""\r \r def execute_action(self, action: str, params: Dict[str, Any]) -> Dict[str, Any]:\r if not self.vector_storage:\r return {"status": "error", "message": "Vector storage not initialized"}\r \r try:\r if action in ("remember", "ADD_MEMORY"):\r text = params.get("content") or params.get("text", "")\r confidence = float(params.get("confidence", 0.7))\r metadata = params.get("metadata", {})\r \r if not text or confidence \x3C self.config.get("storage_confidence", 0.7):\r return {"status": "skipped", "reason": "low confidence"}\r \r uuid_obj = self.vector_storage.add_text(text, metadata=metadata, confidence=confidence)\r return {"status": "success", "message": "Memory stored", "id": uuid_obj}\r \r elif action == "recall":\r query = params.get("query", "")\r top_k = params.get("top_k", self.config.get("retrieval_top_k", 5))\r results = self.vector_storage.retrieve_similar(query, top_k=top_k)\r return {\r "status": "success",\r "results": [{"id": u, "text": t, "score": float(s)} for u, t, s in results],\r "count": len(results)\r }\r \r elif action == "REJECT_MEMORY":\r content = params.get("content", "")\r logger.info(f"Memory rejected: {content}")\r # TODO: 可扩展实现按内容或 metadata 删除\r return {"status": "success", "action": "rejected"}\r \r return {"status": "error", "message": f"Unknown action: {action}"}\r except Exception as e:\r logger.error(f"execute_action error: {e}")\r return {"status": "error", "message": str(e)}

Usage Guidance
Install only if you are comfortable with the agent maintaining persistent local memory. Before use, disable automatic hidden memory writes unless you explicitly want them, verify the dependency install command, and confirm that deletion/rejection actually removes stored memories.
Capability Assessment
Purpose & Capability
The code coherently implements local vector-based long-term memory, which matches the stated purpose, but it stores arbitrary text and metadata for later recall.
Instruction Scope
The supplied prompts instruct the agent to append hidden memory-management JSON to every reply, creating side effects during normal conversations.
Install Mechanism
There is no install spec, but the README documents manual unpinned pip installs; this is user-directed and purpose-aligned, though users should verify package names and sources.
Credentials
No credentials or exfiltration endpoints are shown; the main environmental impact is local disk persistence and embedding-model dependencies.
Persistence & Privilege
The skill persists memories to a local database and auto-loads as a plugin, while the REJECT_MEMORY action returns success without deleting stored content.
How to Use
  1. Make sure OpenClaw is installed (local or Docker)
  2. Run the install command in chat: /install enterprise-memory-skill
  3. After installation, invoke the skill by name or use /enterprise-memory-skill
  4. Provide required inputs per the skill's parameter spec and get structured output
Version History
v1.0.0
**Enterprise Async Memory Engine** 是专为 OpenClaw 架构设计的 RAG (Retrieval-Augmented Generation) 增强插件。通过高性能异步向量检索技术,该引擎旨在突破大语言模型 (LLM) 上下文窗口的物理限制,赋予 Agent 具备**持久化**、**语义化**与**自我进化**能力的长期记忆中枢。
Metadata
Slug enterprise-memory-skill
Version 1.0.0
License MIT-0
All-time Installs 0
Active Installs 0
Total Versions 1
Frequently Asked Questions

What is enterprise-memory-skill?

Manages enterprise-level long-term memory by storing, retrieving, and filtering text data using vector similarity and confidence thresholds. It is an AI Agent Skill for Claude Code / OpenClaw, with 103 downloads so far.

How do I install enterprise-memory-skill?

Run "/install enterprise-memory-skill" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.

Is enterprise-memory-skill free?

Yes, enterprise-memory-skill is completely free, licensed under MIT-0. You can download, install and use it at no cost.

Which platforms does enterprise-memory-skill support?

enterprise-memory-skill is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).

Who created enterprise-memory-skill?

It is built and maintained by blackchen12 (@blackchen12); the current version is v1.0.0.

💬 Comments