Lily Memory Plugin
/install lily-memory
Lily Memory
Persistent memory plugin for OpenClaw agents. Gives your agent long-term memory that survives session resets, compaction, and restarts.
What It Does
- Auto-recall: Injects relevant memories as context before each LLM turn
- Auto-capture: Extracts facts from conversations and stores them automatically
- Hybrid search: SQLite FTS5 keyword search + Ollama vector cosine similarity
- Stuck detection: Detects topic repetition and nudges the agent to break loops
- Memory consolidation: Deduplicates entries on startup
- Dynamic entities: Config-driven allowlist + runtime tool to add entities
- Graceful degradation: Works without Ollama (keyword-only mode)
- Minimal dependencies: Uses better-sqlite3 for secure parameterized queries + native fetch
Requirements
- Node.js 18+ (for native
fetch) better-sqlite3npm package (installed vianpm install)- Optional: Ollama with
nomic-embed-textmodel for semantic search
Quick Start
- Install the plugin to your extensions directory
- Add to your
openclaw.json:
{
"plugins": {
"slots": { "memory": "lily-memory" },
"entries": {
"lily-memory": {
"enabled": true,
"config": {
"dbPath": "~/.openclaw/memory/decisions.db",
"entities": ["config", "system"]
}
}
}
}
}
- Restart the gateway:
openclaw gateway restart
Tools
| Tool | Description |
|---|---|
memory_search |
FTS5 keyword search across all facts |
memory_entity |
Look up all facts for a specific entity |
memory_store |
Save a fact to persistent memory |
memory_semantic_search |
Vector similarity search via Ollama |
memory_add_entity |
Register a new entity at runtime |
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 |
Extract facts from responses |
maxRecallResults |
number | 10 |
Max memories per turn |
maxCapturePerTurn |
number | 5 |
Max facts per response |
stuckDetection |
boolean | true |
Topic repetition detection |
vectorSearch |
boolean | true |
Ollama semantic search |
ollamaUrl |
string | http://localhost:11434 |
Ollama endpoint |
embeddingModel |
string | nomic-embed-text |
Embedding model |
consolidation |
boolean | true |
Dedup on startup |
vectorSimilarityThreshold |
number | 0.5 |
Min cosine similarity |
entities |
array | [] |
Additional entity names |
Architecture
Recall flow: Extract keywords from message -> FTS5 + vector search -> merge and deduplicate -> inject as context
Capture flow: Regex scan for entity: key = value patterns -> validate entity against allowlist -> store to SQLite -> async embed via Ollama
Stuck detection: Track top 5 content words per response -> Jaccard similarity -> if 3+ consecutive >60% overlap, inject Reflexion nudge
License
MIT
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install lily-memory - 安装完成后,直接呼叫该 Skill 的名称或使用
/lily-memory触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Lily Memory Plugin 是什么?
Persistent memory plugin for OpenClaw agents. Hybrid SQLite FTS5 keyword + Ollama vector semantic search with auto-capture, auto-recall, stuck-detection, and... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 1613 次。
如何安装 Lily Memory Plugin?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install lily-memory」即可一键安装,无需额外配置。
Lily Memory Plugin 是免费的吗?
是的,Lily Memory Plugin 完全免费(开源免费),可自由下载、安装和使用。
Lily Memory Plugin 支持哪些平台?
Lily Memory Plugin 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Lily Memory Plugin?
由 kevinodell(@kevinodell)开发并维护,当前版本 v5.2.3。