Voice
Mymemory
Auto-recall + auto-capture long-term memory plugin for OpenClaw. 100% local, zero config.
Install
openclaw plugins install /path/to/openclaw-mymemory
README
# openclaw-mymemory
Built by [Meshari Almejlad](https://github.com/me515).
A long-term memory plugin for [OpenClaw](https://openclaw.ai) 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
```bash
openclaw plugins install /path/to/openclaw-mymemory
openclaw plugins enable mymemory
openclaw gateway restart
```
See [USAGE.md](./USAGE.md) for how to use the plugin day-to-day.
Or during local development:
```json5
// 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 Almejlad](https://github.com/me515) β `[email protected]`
## Contributing
Issues and pull requests welcome on
[github.com/me515/openclaw-mymemory](https://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](./LICENSE).
voice
Comments
Sign in to leave a comment