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.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "lily-memory" with this command: npx skills add ksemaj/lily-memory-5-0-0

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

Stuck detection: Track top 5 content words per response -> Jaccard similarity -> if 3+ consecutive >60% overlap, inject Reflexion nudge

License

MIT

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Automation

Remote Skill Test

Use when the user wants to test an agent skill on a remote jump host after updating it locally. Triggers on "test skill remotely", "remote test", "远程测试 skill...

Registry SourceRecently Updated
Automation

Ocean Chat

OceanBus-powered P2P messaging, shared address book, 1v1 meetup negotiation, and conversation threading for AI agents. Use when users want to manage contacts...

Registry SourceRecently Updated
Automation

Link Midjourney Instagram

Runs the linkmidjourneyinstagram automation — generate four Midjourney images in Chromium via Playwright, then post each PNG as its own Instagram web post wi...

Registry SourceRecently Updated
Automation

NEXO Brain

Cognitive memory system for AI agents — Atkinson-Shiffrin memory model, semantic RAG, trust scoring, and metacognitive error prevention. Gives your agent per...

Registry SourceRecently Updated