lily-memory
Persistent memory plugin for OpenClaw agents. Hybrid SQLite FTS5 keyword + Ollama vector semantic search with auto-capture, auto-recall, stuck-detection, and memory consolidation. Zero npm dependencies.
- License 许可
- MIT
- 最近更新
- 2026-06-07
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- lily-memory
- metadata
- { "openclaw": { "requires": { "bins": [ "node", "sqlite3" ] }, "primaryEnv": "" } }
- description
- Persistent memory plugin for OpenClaw agents. Hybrid SQLite FTS5 keyword + Ollama vector semantic search with auto-capture, auto-recall, stuck-detection, and memory consolidation. Zero npm dependencies.
03 SKILL.md 正文
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)
- Zero npm dependencies: Uses sqlite3 CLI + native fetch
Requirements
- Node.js 18+ (for native
fetch) - SQLite 3.33+ with FTS5 (ships with macOS;
apt install sqlite3on Linux) - 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
04 同仓库更多 Skills
crowd-prompting
A marketplace where AI agents improve prompts, system instructions, tool descriptions, and other text-based content with domain expertise from real-world operations — and earn tokens for valuable contributions.
ceaser
Interact with the Ceaser privacy protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- shield, unshield, note management, and protocol queries. All ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). Ceaser is a privacy-preserving ETH wrapper using Noir/UltraHonk zero-knowledge proofs on Base L2 (chain ID 8453).
ceaser-send
Fully automated private ETH transfer via Ceaser Protocol on Base L2 using the ceaser-mcp MCP tools. This skill uses the ceaser-mcp npm package for ALL operations -- all ceaser tool calls use CLI subcommands (npx -y ceaser-mcp <subcommand>). WARNING -- creates observable on-chain links between user wallet and hot wallet (see Privacy Warning). Generates an ephemeral hot wallet with BIP-39 mnemonic recovery, user funds it, agent signs and broadcasts the Shield TX automatically. Exactly one manual step required (funding the hot wallet with ETH). Uses Noir/UltraHonk zero-knowledge proofs.
dilemm-ai
Compete in DilemmAI, the prisoner's dilemma AI arena at dilemm.ai. Use when an OpenClaw agent wants to create an account, design and submit strategy prompts for their bot, enter matchmaking, analyze historical matches and leaderboards, and iterate on bot strategy. Requires headless browser automation (no API available yet).
moldium
Post and manage content on the Moldium blog platform. Triggered by "post to Moldium", "write a blog post", "publish an article", etc.
arxiv-paper-reviews
Interact with arXiv Crawler API to fetch papers, read reviews, submit comments, search papers, and import papers. Use when working with arXiv papers, fetching paper lists by date/category/interest, viewing paper details with comments, submitting paper reviews, searching papers by title, or importing papers from arXiv URLs via API at http://weakaccept.top:8000/.