@memorilabs/openclaw-memori 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +95 -13
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
</p>
|
|
6
6
|
|
|
7
7
|
<p align="center">
|
|
8
|
-
<i>
|
|
8
|
+
<i>Give OpenClaw persistent, structured memory with Memori. Capture what matters, recall it when relevant, and move from lightweight experimentation to production-ready memory infrastructure.</i>
|
|
9
9
|
</p>
|
|
10
10
|
|
|
11
11
|
<p align="center">
|
|
@@ -25,14 +25,69 @@
|
|
|
25
25
|
|
|
26
26
|
---
|
|
27
27
|
|
|
28
|
-
##
|
|
28
|
+
## Why Memori for OpenClaw?
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
- **Auto-Capture:** After the agent responds, the plugin securely sends the exchange to Memori to extract new facts, update stale ones, and merge duplicates.
|
|
32
|
-
- **Bulletproof Sanitization:** Automatically strips OpenClaw system metadata, internal timestamps, and thinking blocks to prevent context pollution and feedback loops.
|
|
33
|
-
- **Stateless & Thread-Safe:** A completely stateless architecture ensures zero memory leaks and 100% thread safety for multi-agent OpenClaw gateways.
|
|
30
|
+
OpenClaw ships with a simple file-first memory system designed for lightweight experimentation. As deployments scale into production environments, teams often run into memory problems that need more structured, deterministic infrastructure.
|
|
34
31
|
|
|
35
|
-
|
|
32
|
+
Memori provides a drop-in memory layer purpose-built for agentic systems running OpenClaw in production. It works through OpenClaw's plugin lifecycle, so you get persistent, structured memory without changing your agent logic.
|
|
33
|
+
|
|
34
|
+
## Common Challenges with Default OpenClaw Memory
|
|
35
|
+
|
|
36
|
+
### 1. Fact conflicts in long-running agents
|
|
37
|
+
|
|
38
|
+
OpenClaw stores memory as plain markdown files. When facts change or contradict over time, there is no deterministic conflict resolution or lifecycle management.
|
|
39
|
+
|
|
40
|
+
Memori introduces structured memory with update logic, decay policies, and deterministic fact handling.
|
|
41
|
+
|
|
42
|
+
### 2. Context loss from token limits
|
|
43
|
+
|
|
44
|
+
As sessions grow, context must be compacted to fit within model token limits. Important details can be dropped during compression.
|
|
45
|
+
|
|
46
|
+
Memori stores memory outside the prompt and retrieves the right facts at query time, eliminating compaction loss.
|
|
47
|
+
|
|
48
|
+
### 3. No relationship reasoning
|
|
49
|
+
|
|
50
|
+
OpenClaw retrieves semantically similar text but does not model relationships between entities.
|
|
51
|
+
|
|
52
|
+
Memori builds structured memory graphs that let agents reason across linked facts, not just retrieve similar chunks.
|
|
53
|
+
|
|
54
|
+
### 4. Cross-project noise
|
|
55
|
+
|
|
56
|
+
When multiple projects share memory storage, irrelevant context can bleed across workflows.
|
|
57
|
+
|
|
58
|
+
Memori supports scoped memory namespaces to isolate projects and workflows.
|
|
59
|
+
|
|
60
|
+
### 5. No user-level isolation
|
|
61
|
+
|
|
62
|
+
Default memory systems do not provide deterministic isolation across users.
|
|
63
|
+
|
|
64
|
+
Memori enforces user-scoped memory boundaries for secure multi-user deployments.
|
|
65
|
+
|
|
66
|
+
## What Changes When You Add Memori?
|
|
67
|
+
|
|
68
|
+
The Memori plugin replaces OpenClaw's flat-file memory workflow with managed, structured memory that is scoped by `entity_id`, `process_id`, and `session_id` and enriched automatically through OpenClaw's existing hooks.
|
|
69
|
+
|
|
70
|
+
| Capability | What changes |
|
|
71
|
+
| --- | --- |
|
|
72
|
+
| **Structured memory storage** | Instead of raw markdown blobs, Memori stores conversations, facts, preferences, and knowledge-graph triples as structured records tied to an entity, process, and session. Facts are extracted as subject-predicate-object relationships, deduplicated over time, and connected into a graph so related memories stay queryable instead of being buried in text files. |
|
|
73
|
+
| **Advanced Augmentation** | After each conversation, Memori processes the user and assistant exchange asynchronously in the background, identifies facts, preferences, skills, and attributes, generates embeddings for semantic search, and updates the knowledge graph without blocking the agent's response path. |
|
|
74
|
+
| **Intelligent Recall** | Before the agent responds, Memori searches the current entity's stored facts and knowledge graph, ranks memories by semantic relevance and importance, and injects the most useful context into the prompt so durable knowledge survives context-window compression. |
|
|
75
|
+
| **Production-ready observability** | Memori Cloud gives you dashboard visibility into memory creation, recalls, cache hit rate, sessions, quota usage, top subjects, per-memory retrieval metrics, and knowledge-graph relationships, so you can inspect what was stored and how recall is behaving in production. |
|
|
76
|
+
|
|
77
|
+
The plugin still remains drop-in: OpenClaw handles the agent loop, while Memori adds recall, augmentation, sanitization, and observability around it.
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
## Quickstart
|
|
81
|
+
|
|
82
|
+
Get persistent memory running in your OpenClaw gateway in three steps.
|
|
83
|
+
|
|
84
|
+
### Prerequisites
|
|
85
|
+
|
|
86
|
+
- [OpenClaw](https://openclaw.com) `v2026.3.2` or later
|
|
87
|
+
- A Memori API key from [app.memorilabs.ai](https://app.memorilabs.ai)
|
|
88
|
+
- An Entity ID to attribute memories to, such as a user ID, tenant ID, or agent name
|
|
89
|
+
|
|
90
|
+
### 1. Install and Enable
|
|
36
91
|
|
|
37
92
|
Run the following commands in your terminal to install and enable the plugin:
|
|
38
93
|
|
|
@@ -47,9 +102,9 @@ openclaw plugins enable openclaw-memori
|
|
|
47
102
|
openclaw gateway restart
|
|
48
103
|
```
|
|
49
104
|
|
|
50
|
-
|
|
105
|
+
### 2. Configure
|
|
51
106
|
|
|
52
|
-
The plugin needs your Memori API key and an Entity ID to function. You can configure this via the OpenClaw CLI
|
|
107
|
+
The plugin needs your Memori API key and an Entity ID to function. You can configure this via the OpenClaw CLI or your `openclaw.json` file.
|
|
53
108
|
|
|
54
109
|
### Option A: Via OpenClaw CLI (Recommended)
|
|
55
110
|
|
|
@@ -85,12 +140,39 @@ Add the following to your `~/.openclaw/openclaw.json` file:
|
|
|
85
140
|
| `apiKey` | `string` | **Yes** | Your Memori API key. |
|
|
86
141
|
| `entityId` | `string` | **Yes** | The unique identifier for the entity (e.g., user, agent, or tenant) to attribute these memories to. |
|
|
87
142
|
|
|
88
|
-
|
|
143
|
+
### 3. Verify
|
|
144
|
+
|
|
145
|
+
Restart the gateway and inspect the logs:
|
|
146
|
+
|
|
147
|
+
```bash
|
|
148
|
+
openclaw gateway restart
|
|
149
|
+
openclaw gateway logs --filter "[Memori]"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
You should see:
|
|
153
|
+
|
|
154
|
+
```text
|
|
155
|
+
[Memori] === INITIALIZING PLUGIN ===
|
|
156
|
+
[Memori] Tracking Entity ID: your-app-user-id
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
To test the full memory loop:
|
|
160
|
+
|
|
161
|
+
1. Send a message with a durable preference:
|
|
162
|
+
`I always use TypeScript and prefer functional patterns.`
|
|
163
|
+
2. Confirm augmentation ran:
|
|
164
|
+
`Augmentation successful!`
|
|
165
|
+
3. Start a new session and ask:
|
|
166
|
+
`Write a hello world script.`
|
|
167
|
+
4. Confirm recall ran:
|
|
168
|
+
`Successfully injected memory context.`
|
|
169
|
+
|
|
170
|
+
## How It Works
|
|
89
171
|
|
|
90
|
-
This plugin integrates
|
|
172
|
+
This plugin integrates with OpenClaw's event lifecycle to provide persistent memory without interfering with the agent's core logic:
|
|
91
173
|
|
|
92
|
-
1. **`before_prompt_build` (Recall):** When a user sends a message, the plugin intercepts the event, queries the Memori API, and safely prepends relevant memories to the agent's system context.
|
|
93
|
-
2. **`agent_end` (
|
|
174
|
+
1. **`before_prompt_build` (Intelligent Recall):** When a user sends a message, the plugin intercepts the event, queries the Memori API, and safely prepends relevant memories to the agent's system context.
|
|
175
|
+
2. **`agent_end` (Advanced Augmentation):** Once the agent finishes generating its response, the plugin captures the final `user` and `assistant` messages, sanitizes them, and sends them to the Memori integration endpoint for long-term storage and entity mapping.
|
|
94
176
|
|
|
95
177
|
## Contributing
|
|
96
178
|
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "0.0.
|
|
1
|
+
export declare const SDK_VERSION = "0.0.3";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const SDK_VERSION = '0.0.
|
|
1
|
+
export const SDK_VERSION = '0.0.3';
|