ClawKit Logo
ClawKitReliability Toolkit
Back to Registry
Official Verified

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.

skill-install — Terminal

Install via CLI (Recommended)

clawhub install openclaw/skills/skills/ksemaj/lily-memory-5-0-0
Or

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 sqlite3 on Linux)
  • 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

Metadata

Author@ksemaj
Stars1656
Views0
Updated2026-02-28
View Author Profile
AI Skill Finder

Not sure this is the right skill?

Describe what you want to build — we'll match you to the best skill from 16,000+ options.

Find the right skill
Add to Configuration

Paste this into your clawhub.json to enable this plugin.

{
  "plugins": {
    "official-ksemaj-lily-memory-5-0-0": {
      "enabled": true,
      "auto_update": true
    }
  }
}
Safety NoteClawKit audits metadata but not runtime behavior. Use with caution.