← 返回 Skills 市场
blackchen12

enterprise-memory-skill

作者 blackchen12 · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ⚠ suspicious
103
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install enterprise-memory-skill
功能描述
Manages enterprise-level long-term memory by storing, retrieving, and filtering text data using vector similarity and confidence thresholds.
使用说明 (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)}

安全使用建议
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.
能力评估
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.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install enterprise-memory-skill
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /enterprise-memory-skill 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
**Enterprise Async Memory Engine** 是专为 OpenClaw 架构设计的 RAG (Retrieval-Augmented Generation) 增强插件。通过高性能异步向量检索技术,该引擎旨在突破大语言模型 (LLM) 上下文窗口的物理限制,赋予 Agent 具备**持久化**、**语义化**与**自我进化**能力的长期记忆中枢。
元数据
Slug enterprise-memory-skill
版本 1.0.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

enterprise-memory-skill 是什么?

Manages enterprise-level long-term memory by storing, retrieving, and filtering text data using vector similarity and confidence thresholds. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 103 次。

如何安装 enterprise-memory-skill?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install enterprise-memory-skill」即可一键安装,无需额外配置。

enterprise-memory-skill 是免费的吗?

是的,enterprise-memory-skill 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

enterprise-memory-skill 支持哪些平台?

enterprise-memory-skill 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 enterprise-memory-skill?

由 blackchen12(@blackchen12)开发并维护,当前版本 v1.0.0。

💬 留言讨论