Skip to content

Commit 1e5a5f3

Browse files
authored
docs(openclaw): simplify install path and clarify success checks (#57)
## Summary - add a prominent OpenClaw entry in main README (with 🦞 marker) - make OpenClaw plugin README friendlier for new users/agents with minimal, operational additions - fix macOS bash compatibility in installer boolean normalization ## What changed 1. Main README - add a clear OpenClaw plugin entrypoint under Quick Start 2. `plugins/openclaw/README.md` - keep structure, but add: - preflight checks - agent-driven install prompt template - explicit memory mode note (`autoObserve=false` default) - success criteria table (plugin loaded / backend reachable / persisted memory) - prefer npm install as default user path and keep `--link` for local development - update uninstall script URL to merged repository path 3. `plugins/openclaw/scripts/install-openclaw-memoria.sh` - replace bash4-only lowercase expansion in `normalize_bool` with portable `tr` conversion to avoid `bad substitution` on macOS default bash ## Why - reduce onboarding friction for ordinary users and agent-assisted installs - make pass/fail diagnosis deterministic - remove a common macOS shell compatibility trap
1 parent b651cd1 commit 1e5a5f3

3 files changed

Lines changed: 86 additions & 6 deletions

File tree

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,16 @@ memoria init -i # Interactive wizard (recommended)
7676

7777
This creates MCP config + steering rules for your AI tool (Kiro, Cursor, or Claude).
7878

79+
### 🦞 OpenClaw Plugin (Already Using OpenClaw?)
80+
81+
Use the native OpenClaw plugin guide: [OpenClaw Plugin Setup](plugins/openclaw/README.md).
82+
83+
```bash
84+
openclaw plugins install @matrixorigin/memory-memoria
85+
openclaw plugins enable memory-memoria
86+
openclaw memoria install
87+
```
88+
7989
### 4. Restart & verify
8090

8191
Restart your AI tool, then ask: *"Do you have memory tools available?"*

plugins/openclaw/README.md

Lines changed: 74 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,21 @@ In practice that means:
1818

1919
## Quick Start
2020

21+
### Preflight
22+
23+
Verify prerequisites before installing:
24+
25+
```bash
26+
openclaw --version
27+
# -> OpenClaw vX.Y.Z (CLI is installed and in PATH)
28+
29+
memoria --version 2>/dev/null || echo "not installed (installer can install it)"
30+
# -> memoria X.Y.Z or fallback message
31+
32+
openclaw plugins list
33+
# -> command succeeds and prints plugin table
34+
```
35+
2136
Assume OpenClaw is already installed and healthy.
2237

2338
If you want the shortest OpenClaw-native path:
@@ -27,10 +42,10 @@ If you want the shortest OpenClaw-native path:
2742
- install the plugin with `openclaw plugins install`
2843
- let the plugin install or validate the Rust `memoria` runtime through `openclaw memoria install`
2944

30-
Example:
45+
For ordinary users and AI agents, prefer npm install first:
3146

3247
```bash
33-
openclaw plugins install --link /path/to/openclaw-memoria/plugins/openclaw
48+
openclaw plugins install @matrixorigin/memory-memoria
3449
openclaw plugins enable memory-memoria
3550

3651
MEMORIA_DB_URL='mysql://root:111@127.0.0.1:6001/memoria' \
@@ -41,10 +56,10 @@ MEMORIA_EMBEDDING_DIM='1536' \
4156
openclaw memoria install
4257
```
4358

44-
If you published the package to npm, the install step becomes:
59+
If you are installing from a local checkout (development/contributor workflow), use:
4560

4661
```bash
47-
openclaw plugins install @matrixorigin/memory-memoria
62+
openclaw plugins install --link /path/to/Memoria/plugins/openclaw
4863
openclaw plugins enable memory-memoria
4964
openclaw memoria install
5065
```
@@ -58,6 +73,22 @@ The installer will:
5873
- add the Memoria tool surface to global and existing agent tool policy
5974
- install the managed skills in `~/.openclaw/skills`
6075

76+
### Agent-Driven Install
77+
78+
If you are operating from an OpenClaw chat/channel and want the agent to install for you, send:
79+
80+
```text
81+
Install Memoria plugin for OpenClaw.
82+
Use: openclaw plugins install @matrixorigin/memory-memoria, then enable memory-memoria.
83+
Then run openclaw memoria install with:
84+
MEMORIA_DB_URL=mysql://root:111@127.0.0.1:6001/memoria
85+
MEMORIA_EMBEDDING_PROVIDER=openai
86+
MEMORIA_EMBEDDING_MODEL=text-embedding-3-small
87+
MEMORIA_EMBEDDING_DIM=1536
88+
MEMORIA_EMBEDDING_API_KEY from my shell env.
89+
Finally run openclaw memoria verify and report pass/fail.
90+
```
91+
6192
## Installer Inputs
6293

6394
Important environment variables:
@@ -82,6 +113,35 @@ Installer flags:
82113
- `--skip-plugin-install`: only rewrite plugin config; assume OpenClaw already installed and the plugin already loaded
83114
- `--verify`: run a post-install smoke check
84115

116+
## ⚠️ Common Pitfalls
117+
118+
**macOS `sh` vs `bash`:** The installer script is bash (`#!/usr/bin/env bash`) and uses bash-specific syntax.
119+
If you pipe a script, use `bash -s --`, not `sh -s --`.
120+
121+
```bash
122+
# ✅ Correct
123+
curl -fsSL <url> | bash -s --
124+
125+
# ❌ May fail with "bad substitution"
126+
curl -fsSL <url> | sh -s --
127+
```
128+
129+
**Explicit memory mode is default (`autoObserve=false`):** the plugin does not auto-write memories from conversation turns.
130+
Writes happen when the agent explicitly calls tools like `memory_store` (or related write tools).
131+
This keeps memory writes intentional and reviewable.
132+
If you want auto-capture, set `MEMORIA_AUTO_OBSERVE=true` and provide `MEMORIA_LLM_API_KEY` + `MEMORIA_LLM_MODEL`.
133+
134+
**Old schema vs new runtime:** If you upgraded from an older Memoria setup, existing DB schema may not match current Rust runtime expectations.
135+
Use a fresh database name in `MEMORIA_DB_URL` for a clean install path.
136+
137+
```text
138+
# Old/default style
139+
mysql://root:111@127.0.0.1:6001/memoria
140+
141+
# Clean-start recommendation
142+
mysql://root:111@127.0.0.1:6001/memoria_v2
143+
```
144+
85145
## Tool Surface
86146

87147
The OpenClaw plugin exposes:
@@ -103,18 +163,27 @@ Current differences to be aware of:
103163
- `memory_stats` is derived from available MCP outputs, so inactive-memory totals and entity totals are not currently available
104164
- `memory_entities` is no longer exposed, because the Rust Memoria MCP toolset does not provide a matching tool
105165
- old `mysql+pymysql://...` DSNs are normalized to `mysql://...` automatically during install and config parsing
166+
- if you previously used an older Memoria stack, schema drift can cause runtime errors; using a fresh DB name (for example `memoria_v2`) avoids most upgrade collisions
106167

107168
## Uninstall
108169

109170
```bash
110-
curl -fsSL https://raw.githubusercontent.com/matrixorigin/openclaw-memoria/main/scripts/uninstall-openclaw-memoria.sh | \
171+
curl -fsSL https://raw.githubusercontent.com/matrixorigin/Memoria/main/plugins/openclaw/scripts/uninstall-openclaw-memoria.sh | \
111172
bash -s --
112173
```
113174

114175
That removes the plugin entry, tool policy additions, managed skills, and the default managed checkout path.
115176

116177
## Verification
117178

179+
### Success Criteria
180+
181+
| Level | Check | Command | Pass |
182+
|---|---|---|---|
183+
| 1. Plugin loaded | OpenClaw recognizes plugin | `openclaw plugins list` | `memory-memoria` is listed and enabled |
184+
| 2. Backend reachable | Memoria can reach configured backend | `openclaw memoria verify` | exits successfully |
185+
| 3. Memory persisted | Store -> retrieve round-trip works | `openclaw memoria stats` + `openclaw ltm list --limit 10` | non-zero memory appears after a write |
186+
118187
Before the smoke check, confirm the CLIs you are about to use are the ones you expect:
119188

120189
```bash

plugins/openclaw/scripts/install-openclaw-memoria.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,8 @@ EOF
143143

144144
normalize_bool() {
145145
local raw="${1:-}"
146-
case "${raw,,}" in
146+
raw="$(printf '%s' "${raw}" | tr '[:upper:]' '[:lower:]')"
147+
case "${raw}" in
147148
1|true|yes|on)
148149
printf 'true'
149150
;;

0 commit comments

Comments
 (0)