← 返回
数据分析 中文

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...
为 OpenClaw 代理提供的持久记忆插件,结合 SQLite FTS5 关键字搜索和 Ollama 向量语义搜索,具备自动捕获、自动回忆、卡顿检测等功能。
kevinodell
数据分析 clawhub v5.2.3 1 版本 99909.4 Key: 无需
★ 2
Stars
📥 2,165
下载
💾 47
安装
1
版本
#embeddings#latest#memory#sqlite#vectors

概述

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-sqlite3 npm package (installed via npm install)
  • Optional: Ollama with nomic-embed-text model for semantic search

Quick Start

  1. Install the plugin to your extensions directory
  2. Add to your openclaw.json:
{
  "plugins": {
    "slots": { "memory": "lily-memory" },
    "entries": {
      "lily-memory": {
        "enabled": true,
        "config": {
          "dbPath": "~/.openclaw/memory/decisions.db",
          "entities": ["config", "system"]
        }
      }
    }
  }
}
  1. Restart the gateway: openclaw gateway restart

Tools

ToolDescription
-------------------
memory_searchFTS5 keyword search across all facts
memory_entityLook up all facts for a specific entity
memory_storeSave a fact to persistent memory
memory_semantic_searchVector similarity search via Ollama
memory_add_entityRegister a new entity at runtime

Configuration

OptionTypeDefaultDescription
------------------------------------
dbPathstring~/.openclaw/memory/decisions.dbSQLite database path
autoRecallbooleantrueInject memories before each turn
autoCapturebooleantrueExtract facts from responses
maxRecallResultsnumber10Max memories per turn
maxCapturePerTurnnumber5Max facts per response
stuckDetectionbooleantrueTopic repetition detection
vectorSearchbooleantrueOllama semantic search
ollamaUrlstringhttp://localhost:11434Ollama endpoint
embeddingModelstringnomic-embed-textEmbedding model
consolidationbooleantrueDedup on startup
vectorSimilarityThresholdnumber0.5Min cosine similarity
entitiesarray[]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

版本历史

共 1 个版本

  • v5.2.3 当前
    2026-03-28 23:09 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

Data Analysis

ivangdavila
{"answer":"数据分析与可视化。查询数据库、生成报告、自动化电子表格,将原始数据转化为清晰可行的见解。适用于:(1) 您……"}
★ 199 📥 65,285
data-analysis

Stock Analysis

udiedrichsen
{"answer":"基于雅虎财经数据,分析股票与加密货币。支持投资组合管理、自选股预警、股息分析、8维评分、热门趋势扫描及传闻/早期信号探测。适用于股票分析、持仓追踪、财报异动、加密监控、热门股追踪或提前发掘非主流传闻。"}
★ 270 📥 57,039
data-analysis

Excel / XLSX

ivangdavila
创建、检查和编辑 Microsoft Excel 工作簿及 XLSX 文件,支持可靠的公式、日期、类型、格式、重算及模板保留功能。
★ 368 📥 140,925