Skip to content

Latest commit

 

History

4 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

openclaw-mymemory

Built by Meshari Almejlad.

A long-term memory plugin for OpenClaw that gives your AI agent persistent memory across sessions — with auto-recall before every reply and auto-capture after every reply. Works 100% locally with no cloud dependency and no native build requirements.

Every conversation turn:

  before_prompt_build hook
  │
  └── Searches active container
      └── Injects top-K relevant memories as prependSystemContext

  [Agent replies]

  llm_output hook
  └── Extracts durable facts via LLM (or keyword heuristics)
      └── Appends to the active container's JSONL file

Features

Feature Description
Auto-Recall Queries memory and injects relevant facts before every reply
Auto-Capture Extracts and stores durable facts after every reply
100% Local Works out of the box with zero external dependencies
Container Routing Separate memories into work, personal, or custom containers
Lexical Search Built-in bag-of-words similarity — no embeddings API needed
Embeddings (Optional) Plug in any OpenAI-compatible API for semantic search
LLM Extraction Uses api.runtime.llm.complete to extract facts
Heuristic Fallback Captures explicit cues ("remember that...") if LLM is unavailable
Manual Tools memory_remember, memory_recall, memory_forget, memory_list_containers
MIT Licensed Fully open source

Installation

openclaw plugins install /path/to/openclaw-mymemory
openclaw plugins enable mymemory
openclaw gateway restart

See USAGE.md for how to use the plugin day-to-day.

Or during local development:

// openclaw.json
{
  plugins: {
    load: { paths: ["~/plugins/openclaw-mymemory"] },
    entries: {
      mymemory: {
        enabled: true,
        config: {
          defaultContainer: "personal",
          containerRouting: {
            "agent:sales-bot": "work",
            "channel:C0123WORKSLACK": "work",
          },
          autoRecall: { enabled: true, topK: 6 },
          autoCapture: { enabled: true, useLLMExtraction: true },
          embeddings: { provider: "none" }, // or "openai-compatible"
        },
      },
    },
  },
}

Comparison

Feature Supermemory / Mem0 openclaw-mymemory
Auto-Recall ✅ (cloud) ✅ (local)
Auto-Capture ✅ (cloud) ✅ (local)
Custom Containers
Zero external deps
Works offline
No API key needed
Open source
Lexical search (free)
Semantic search (optional) ✅ (OpenAI-compatible)

Current Limitations

  • Search quality without embeddings: Uses bag-of-words lexical similarity, not true semantic vector search. Enable embeddings.provider: "openai-compatible" if you need higher accuracy.
  • Hook field names: before_prompt_build and llm_output field names (e.g. payload.prompt, payload.output) are based on OpenClaw hook documentation. Run openclaw plugins inspect mymemory --runtime --json and check logs to verify correct names on your setup; adjust index.js if needed.
  • No periodic dreaming: Unlike OpenClaw's built-in memory-core, this plugin does not merge or deduplicate old memories automatically. A future cron job could add this.

Project Structure

openclaw-mymemory/
├── package.json
├── openclaw.plugin.json
├── index.js              # Plugin entry — registers hooks + tools
├── lib/
│   ├── store.js         # JSONL storage + lexical search engine
│   ├── embed.js         # Optional OpenAI-compatible embeddings
│   ├── container.js     # Container routing logic
│   └── extract.js       # LLM fact extraction + heuristic fallback
└── skills/mymemory/SKILL.md  # Skill file explaining tools to the agent

Author

Meshari Almejladalmjlad@gmail.com

Contributing

Issues and pull requests welcome on github.com/me515/openclaw-mymemory.

Ideas for follow-up work: periodic memory merging/dedup, real vector index option, per-message container override.

License

MIT — see LICENSE.

About

Auto-recall + auto-capture long-term memory plugin for OpenClaw. 100% local, zero config.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages