运行时依赖
安装命令
点击复制技能文档
Lily Memory
Persistent memory 插件 for OpenClaw 代理s. Gives your 代理 long-term memory that survives 会话 re设置s, compaction, and re启动s.
What It Does Auto-recall: Injects relevant memories as 上下文 before each LLM turn Auto-capture: 提取s facts from conversations and stores them automatically Hybrid 搜索: SQLite FTS5 keyword 搜索 + Ollama vector cosine similarity Stuck 检测ion: 检测s topic repetition and nudges the 代理 to break loops Memory consolidation: Deduplicates entries on 启动up Dynamic entities: Config-driven allow列出 + 运行time 工具 to 添加 entities Graceful degradation: Works without Ollama (keyword-only mode) Zero npm dependencies: Uses sqlite3 命令行工具 + native fetch Requirements Node.js 18+ (for native fetch) SQLite 3.33+ with FTS5 (ships with macOS; apt 安装 sqlite3 on Linux) Optional: Ollama with nomic-embed-text 模型 for semantic 搜索 Quick 启动 安装 the 插件 to your 扩展s directory 添加 to your OpenClaw.json: { "插件s": { "slots": { "memory": "lily-memory" }, "entries": { "lily-memory": { "enabled": true, "config": { "dbPath": "~/.OpenClaw/memory/decisions.db", "entities": ["config", "系统"] } } } } }
Re启动 the gateway: OpenClaw gateway re启动 工具s 工具 Description memory_搜索 FTS5 keyword 搜索 across all facts memory_entity Look up all facts for a specific entity memory_store Save a fact to persistent memory memory_semantic_搜索 Vector similarity 搜索 via Ollama memory_添加_entity Register a new entity at 运行time Configuration Option Type Default Description dbPath string ~/.OpenClaw/memory/decisions.db SQLite database path autoRecall boolean true Inject memories before each turn autoCapture boolean true 提取 facts from 响应s maxRecall结果s number 10 Max memories per turn maxCapturePerTurn number 5 Max facts per 响应 stuck检测ion boolean true Topic repetition 检测ion vector搜索 boolean true Ollama semantic 搜索 ollamaUrl string http://localhost:11434 Ollama 端点 embedding模型 string nomic-embed-text Embedding 模型 consolidation boolean true Dedup on 启动up vectorSimilarityThreshold number 0.5 Min cosine similarity entities array [] 添加itional entity names Architecture
Recall flow: 提取 keywords from message -> FTS5 + vector 搜索 -> merge and deduplicate -> inject as 上下文
Capture flow: Regex 扫描 for entity: key = value patterns -> 验证 entity agAInst allow列出 -> store to SQLite -> a同步 embed via Ollama
Stuck 检测ion: 追踪 top 5 content words per 响应 -> Jaccard similarity -> if 3+ consecutive >60% overlap, inject Reflexion nudge
License
MIT