🎁 Get the FREE AI Skills Starter Guide β€” Subscribe β†’
BytesAgainBytesAgain
πŸ¦€ ClawHub

Memoria

by @nieto42

The most advanced memory system for AI agents. 24 cognitive layers, knowledge graph, procedural learning, dialectic queries, AI self-observation, auto skill...

Versionv3.34.0
Downloads1,364
Stars⭐ 2
TERMINAL
clawhub install openclaw-memoria

πŸ“– About This Skill


name: Memoria for OpenClaw version: 3.34.0 description: "The most advanced memory system for AI agents. 24 cognitive layers, knowledge graph, procedural learning, dialectic queries, AI self-observation, auto skill creation, crash-safe WAL, async prefetch. Works with Claude, Cursor, Copilot, ChatGPT & any OpenClaw agent. 100% local-first (SQLite + Ollama), zero cloud cost, zero API keys required." author: Primo Studio (@Nieto42) license: Apache-2.0 homepage: https://github.com/Primo-Studio/openclaw-memoria repository: https://github.com/Primo-Studio/openclaw-memoria feedback: https://x.com/Nitix_ keywords: - memory - ai-agent - persistent-memory - long-term-memory - knowledge-graph - procedural-learning - vector-search - sqlite - ollama - lm-studio - local-first - cognitive - context - claude - cursor - copilot - chatgpt - openclaw - wal - vibe-coding - developer-tools - devtools - typescript - llm - automation - brain-inspired - multi-layer - fact-extraction - self-improving tags: - memory - ai-agent - persistent-memory - long-term-memory - knowledge-graph - procedural-learning - vector-search - sqlite - ollama - lm-studio - local-first - cognitive - context - claude - cursor - copilot - chatgpt - openclaw - wal - vibe-coding - developer-tools - devtools - typescript - llm - automation - brain-inspired - multi-layer - fact-extraction - self-improving - self-observation - dialectic - auto-skill - prefetch - crash-recovery - async env: - name: OPENAI_API_KEY required: false description: Optional β€” used as fallback for LLM extraction and embeddings when local models are unavailable. Never required for default operation. - name: OPENROUTER_API_KEY required: false description: Optional β€” used as fallback for remote LLM provider. Never required for default operation. - name: OPENCLAW_WORKSPACE required: false description: Auto-set by OpenClaw runtime β€” workspace path for memory files. Do not set manually. security: | ## Data & Privacy - Memoria runs 100% locally by default. No data leaves your machine unless you explicitly configure a remote LLM. - All memory is stored in a local SQLite database in your OpenClaw workspace. - API keys (OPENAI_API_KEY, OPENROUTER_API_KEY) are optional fallbacks β€” never required.

## What Memoria reads - Workspace files: USER.md, COMPANY.md, projects/* β€” used for identity-aware relevance scoring. These files may contain personal or business information. Review them before enabling Memoria. - Conversation content: assistant messages and tool call results, to extract durable facts. - No files outside the OpenClaw workspace are read.

## What Memoria writes - A single SQLite database (memoria.db) in your workspace/memory/ folder. - Optional markdown summaries in workspace/memory/ folder. - No network requests unless a remote LLM fallback is configured.

## Hooks used - before_prompt_build: injects recalled facts into context - after_tool_call: captures procedural knowledge (how-to steps) - agent_end: extracts facts from completed conversations - after_compaction: extracts facts from compacted summaries These are standard OpenClaw plugin hooks. They run locally within the plugin process. entrypoint: index.ts


🧠 Memoria β€” Multi-Layer Persistent Memory for OpenClaw

The most complete memory system for OpenClaw. 20 layers of memory that work together, powered by YOUR choice of LLM.

Why Memoria?

πŸ—οΈ 20 Memory Layers (not just a fact store)

1. Facts β€” Durable knowledge extracted from every conversation 2. Procedures β€” HOW to do things, improves with repetition, learns from failures 3. Knowledge Graph β€” Entities + relations connecting your facts 4. Topics & Expertise β€” Tracks what you talk about most, specializes over time 5. Observations β€” Short-term working memory for active context 6. Error Detection πŸ”₯ β€” Touch fire once, remember forever. Dangers captured on first occurrence 7. Lifecycle β€” Fresh β†’ Settled β†’ Dormant. Nothing deleted, priority shifts naturally

πŸ”Œ Bring Your Own LLM

Configure each layer independently. Mix and match:
  • Ollama β€” Run gemma3, qwen3.5, llama, or any model locally (recommended)
  • LM Studio β€” Use any GGUF model from your local server
  • Remote APIs β€” OpenAI, Anthropic, OpenRouter as primary or fallback
  • Fallback chains β€” Ollama β†’ LM Studio β†’ API. If one fails, the next takes over automatically
  • 🏠 100% Local-First

  • SQLite + FTS5 β€” No external database needed
  • Local embeddings β€” nomic-embed-text via Ollama (zero API cost)
  • Zero cloud dependency β€” Works offline, your data stays on your machine
  • Fallback chain β€” Degrades gracefully if a provider goes down
  • 🧬 What Makes Memoria Different

    | Feature | Memoria | Basic memory plugins | |---------|---------|---------------------| | Memory layers | 20 specialized layers | Single fact store | | LLM choice | Any local or remote model | Usually hardcoded | | Per-layer LLM config | βœ… Different model per layer | ❌ | | Procedural learning | βœ… Learns HOW, not just WHAT | ❌ | | Error detection | βœ… Auto-captures dangers | ❌ | | Knowledge graph | βœ… Entities + relations | ❌ | | Lifecycle management | βœ… Smart aging, never forgets | ❌ or simple TTL | | Cost | $0 with local models | Varies |

    Installation

    As Plugin (recommended β€” one command)

    openclaw plugins install clawhub:memoria-plugin
    
    This installs Memoria from the ClawHub registry. No manual steps needed.

    From source (for contributors / advanced users)

    If you prefer to inspect the code first: 1. Browse the repository: github.com/Primo-Studio/openclaw-memoria 2. Review the source code, especially index.ts (main entrypoint) and openclaw.plugin.json (config schema) 3. Clone and install:
    cd ~/.openclaw/extensions
    git clone https://github.com/Primo-Studio/openclaw-memoria.git memoria
    cd memoria && npm install
    

    Then add to your openclaw.json under plugins.entries:

    {
      "memoria": { "enabled": true },
      "memory-convex": { "enabled": false }
    }
    

    Configuration

    Minimal (works out of the box with Ollama)

    Just install and restart. Defaults: Ollama + gemma3:4b for extraction, nomic for embeddings.

    Custom LLM per layer

    "memoria": {
      "enabled": true,
      "config": {
        "llm": {
          "default": { "provider": "ollama", "model": "qwen3.5:4b" },
          "procedural": { "provider": "lmstudio", "model": "your-model" },
          "graph": { "provider": "openai", "model": "gpt-4o-mini" }
        }
      }
    }
    

    Source Code

    The full source is available on GitHub: Primo-Studio/openclaw-memoria

    Key files:

  • index.ts β€” Main plugin entrypoint (hooks, extraction, recall pipeline)
  • procedural.ts β€” Procedural memory (how-to learning)
  • lifecycle.ts β€” Lifecycle management (fresh/settled/dormant)
  • scoring.ts β€” Temporal scoring and relevance ranking
  • selective.ts β€” Dedup, contradiction detection, fact quality
  • openclaw.plugin.json β€” Configuration schema
  • Feedback & Community

    We'd love your feedback! Tell us how Memoria works for you:

  • 🐦 Tweet us @Nitix_ β€” share your setup, results, or ideas
  • ⭐ Star the repo: github.com/Primo-Studio/openclaw-memoria
  • πŸ› Issues: GitHub Issues
  • Built with ❀️ by Primo Studio πŸ‡¬πŸ‡« β€” AI tooling from French Guiana.

    βš™οΈ Configuration

    Minimal (works out of the box with Ollama)

    Just install and restart. Defaults: Ollama + gemma3:4b for extraction, nomic for embeddings.

    Custom LLM per layer

    "memoria": {
      "enabled": true,
      "config": {
        "llm": {
          "default": { "provider": "ollama", "model": "qwen3.5:4b" },
          "procedural": { "provider": "lmstudio", "model": "your-model" },
          "graph": { "provider": "openai", "model": "gpt-4o-mini" }
        }
      }
    }