Lily Memory for Openclaw

A zero-dependency persistent memory plugin for OpenClaw agents that combines keyword and semantic search for long-term context retention.

ksemaj
v1.0.0
Feb 17, 2026
0
0
0

Install & Download

1. ClawHub CLI

The fastest way to install a skill directly from the registry.

npx clawhub@latest install lily-memory-5-0-0

2. Manual Installation

Copy the skill folder to one of these locations

Global
~/.openclaw/skills/
Workspace
<project>/skills/

Priority: Workspace > Local > Bundled

3. Prompt Installation

Copy this prompt to OpenClaw to install it automatically.

Help me install lily-memory-5-0-0 using Clawhub. If Clawhub is not installed, install it first (npm i -g clawhub).

Prefer to download?

Get the raw skill files in a ZIP archive.

What is Lily Memory?

Lily Memory is a sophisticated persistent memory plugin designed to empower Openclaw Skills with the ability to retain and recall information across sessions, resets, and restarts. By bridging the gap between short-term context windows and long-term knowledge, it allows agents to maintain a consistent state and remember user preferences, project decisions, and historical facts. This tool is essential for developers building complex autonomous agents that require a reliable way to store and retrieve data without manual intervention.

The plugin utilizes a hybrid search architecture, combining the speed of SQLite FTS5 keyword indexing with the deep understanding of Ollama-powered vector semantic search. This ensures that whether an agent needs a specific keyword or a conceptually related piece of information, Lily Memory can provide the most relevant context. It operates with zero npm dependencies, relying on native system tools to maintain a lightweight and high-performance footprint within the Openclaw Skills ecosystem.

Lily Memory Use Cases

  • Persistent storage of user configurations and architectural decisions across multiple agent restarts.
  • Building autonomous researchers that can recall previously discovered facts from past sessions.
  • Preventing agent loops and repetitive behavior through integrated stuck detection and reflexion nudges.
  • Categorizing and retrieving entity-specific data like system logs, config files, or user profiles automatically.

How Lily Memory Works

  1. Recall Phase: Upon receiving a message, the skill extracts relevant keywords and generates vector embeddings to query the persistent database.
  2. Hybrid Search: It executes a parallel search using SQLite FTS5 for exact matches and Ollama cosine similarity for semantic matches.
  3. Context Injection: The most relevant memories are merged, deduplicated, and injected into the LLM context window before the turn begins.
  4. Capture Phase: The plugin monitors agent responses for predefined entity patterns to automatically extract and store new facts.
  5. Maintenance: On startup, the system performs memory consolidation to deduplicate entries and optimize the search index.

Lily Memory Setup

To integrate Lily Memory into your Openclaw Skills environment, ensure you have Node.js 18+ and SQLite 3.33+ installed. Follow these steps:

  1. Install the plugin into your extensions directory.
  2. Configure your openclaw.json to enable the plugin and define the database path:
{
  "plugins": {
    "slots": { "memory": "lily-memory" },
    "entries": {
      "lily-memory": {
        "enabled": true,
        "config": {
          "dbPath": "~/.openclaw/memory/decisions.db",
          "entities": ["config", "system"]
        }
      }
    }
  }
}
  1. Apply the changes by restarting your gateway:
openclaw gateway restart

Lily Memory Data Schema & Taxonomy

Lily Memory organizes data within a localized SQLite database, managing both keyword indices and vector embeddings. The schema focuses on the following primary components:

Component Description
Facts Table Stores the raw text, entity association, and timestamp of captured information.
FTS5 Index A virtual table enabling high-speed full-text search across all stored facts.
Vector Store Optional storage for embeddings generated via Ollama for semantic similarity lookup.
Entity Allowlist A configuration-driven list of valid categories (e.g., config, user, system) used for data validation.

Lily Memory Advanced Features

  • Stuck Detection: Uses Jaccard similarity to track word repetition and trigger a reflexion nudge if the agent becomes repetitive.
  • Graceful Degradation: Automatically switches to keyword-only mode if the Ollama service is unavailable, ensuring the skill remains functional.
  • Dynamic Entity Management: Provides tools to register and track new data entities at runtime without manual configuration updates.
  • Zero-Dependency Architecture: Built using native fetch and the sqlite3 CLI to avoid the bloat and security risks of external npm packages.

SKILL.md


Loading

Related Openclaw Skills

METADATA

Github Stars: 0
forks: 0

Featured*