@totalreclaw/totalreclaw 1.0.0
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/.github/workflows/ci.yml +27 -0
- package/.github/workflows/publish.yml +39 -0
- package/README.md +104 -0
- package/SKILL.md +687 -0
- package/api-client.ts +300 -0
- package/crypto.ts +351 -0
- package/embedding.ts +84 -0
- package/extractor.ts +210 -0
- package/generate-mnemonic.ts +14 -0
- package/hot-cache-wrapper.ts +126 -0
- package/index.ts +1885 -0
- package/llm-client.ts +418 -0
- package/lsh.test.ts +463 -0
- package/lsh.ts +257 -0
- package/package.json +40 -0
- package/porter-stemmer.d.ts +4 -0
- package/reranker.test.ts +594 -0
- package/reranker.ts +537 -0
- package/semantic-dedup.test.ts +392 -0
- package/semantic-dedup.ts +100 -0
- package/subgraph-search.ts +278 -0
- package/subgraph-store.ts +342 -0
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- uses: actions/checkout@v4
|
|
14
|
+
|
|
15
|
+
- uses: actions/setup-node@v4
|
|
16
|
+
with:
|
|
17
|
+
node-version: 22
|
|
18
|
+
|
|
19
|
+
- name: Install dependencies
|
|
20
|
+
run: npm install
|
|
21
|
+
|
|
22
|
+
- name: Type check
|
|
23
|
+
run: npx tsc --noEmit --esModuleInterop --moduleResolution bundler --module nodenext --target es2022 --strict --skipLibCheck *.ts
|
|
24
|
+
continue-on-error: true
|
|
25
|
+
|
|
26
|
+
- name: Run tests
|
|
27
|
+
run: npx vitest run --reporter=verbose 2>/dev/null || echo "No test runner configured — skipping"
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: Publish to npm
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
|
|
7
|
+
jobs:
|
|
8
|
+
publish:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
permissions:
|
|
11
|
+
contents: read
|
|
12
|
+
id-token: write
|
|
13
|
+
steps:
|
|
14
|
+
- uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- uses: actions/setup-node@v4
|
|
17
|
+
with:
|
|
18
|
+
node-version: 22
|
|
19
|
+
registry-url: https://registry.npmjs.org
|
|
20
|
+
|
|
21
|
+
- name: Install dependencies
|
|
22
|
+
run: npm install
|
|
23
|
+
|
|
24
|
+
- name: Check if version already published
|
|
25
|
+
id: check
|
|
26
|
+
run: |
|
|
27
|
+
PKG_NAME=$(node -p "require('./package.json').name")
|
|
28
|
+
PKG_VERSION=$(node -p "require('./package.json').version")
|
|
29
|
+
if npm view "${PKG_NAME}@${PKG_VERSION}" version 2>/dev/null; then
|
|
30
|
+
echo "exists=true" >> "$GITHUB_OUTPUT"
|
|
31
|
+
echo "Version ${PKG_VERSION} already published — skipping"
|
|
32
|
+
else
|
|
33
|
+
echo "exists=false" >> "$GITHUB_OUTPUT"
|
|
34
|
+
echo "Version ${PKG_VERSION} not yet published — will publish"
|
|
35
|
+
fi
|
|
36
|
+
|
|
37
|
+
- name: Publish
|
|
38
|
+
if: steps.check.outputs.exists == 'false'
|
|
39
|
+
run: npm publish --provenance --access public
|
package/README.md
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
# TotalReclaw
|
|
2
|
+
|
|
3
|
+
Zero-knowledge encrypted memory vault for AI agents. Your agent remembers -- only you can read it.
|
|
4
|
+
|
|
5
|
+
## What it does
|
|
6
|
+
|
|
7
|
+
TotalReclaw gives your AI agent persistent, encrypted memory that works across sessions and devices. Memories are encrypted on your device before they reach any server. Not even TotalReclaw can read your data.
|
|
8
|
+
|
|
9
|
+
- **True zero-knowledge E2EE** -- Client-side AES-256-GCM encryption. The server only sees encrypted blobs.
|
|
10
|
+
- **Portable** -- One-click plaintext export. No vendor lock-in.
|
|
11
|
+
- **Automatic** -- Memory extraction and recall happen via lifecycle hooks. No manual commands needed.
|
|
12
|
+
- **Cross-device** -- Same 12-word recovery phrase restores all your memories on any device.
|
|
13
|
+
- **98.1% recall** -- Blind-index search with BM25 + cosine + RRF fusion reranking.
|
|
14
|
+
- **Free tier** -- 100 writes/month, unlimited reads. Upgrade at [totalreclaw.xyz/pricing](https://totalreclaw.xyz/pricing).
|
|
15
|
+
|
|
16
|
+
## Install
|
|
17
|
+
|
|
18
|
+
### OpenClaw (recommended)
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
openclaw plugins install @totalreclaw/totalreclaw
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or just ask your OpenClaw agent:
|
|
25
|
+
> "Install the totalreclaw plugin"
|
|
26
|
+
|
|
27
|
+
The plugin sets itself up on first run -- it will ask if you have an existing recovery phrase or need a new one.
|
|
28
|
+
|
|
29
|
+
### Other MCP-compatible agents
|
|
30
|
+
|
|
31
|
+
TotalReclaw also ships a standalone MCP server for Claude Desktop, Cursor, and others. See [totalreclaw.xyz](https://totalreclaw.xyz) for setup instructions.
|
|
32
|
+
|
|
33
|
+
## How it works
|
|
34
|
+
|
|
35
|
+
1. **Install** -- Add the plugin and set a recovery phrase (12-word BIP-39 mnemonic).
|
|
36
|
+
2. **Talk normally** -- TotalReclaw automatically extracts facts, preferences, and decisions from your conversations, encrypts them client-side, and stores them on-chain.
|
|
37
|
+
3. **Recall** -- At the start of each new conversation, relevant memories are decrypted and injected into context. You can also search explicitly with the `totalreclaw_recall` tool.
|
|
38
|
+
4. **Export anytime** -- `totalreclaw_export` dumps all your memories as plaintext JSON or Markdown. Your data, your format.
|
|
39
|
+
|
|
40
|
+
## Tools
|
|
41
|
+
|
|
42
|
+
| Tool | What it does |
|
|
43
|
+
|------|-------------|
|
|
44
|
+
| `totalreclaw_remember` | Store a fact, preference, or decision |
|
|
45
|
+
| `totalreclaw_recall` | Search and retrieve relevant memories |
|
|
46
|
+
| `totalreclaw_forget` | Delete a specific memory (on-chain tombstone) |
|
|
47
|
+
| `totalreclaw_export` | Export all memories as plaintext |
|
|
48
|
+
| `totalreclaw_status` | Check subscription tier and quota |
|
|
49
|
+
|
|
50
|
+
## Lifecycle hooks
|
|
51
|
+
|
|
52
|
+
| Hook | When | What |
|
|
53
|
+
|------|------|------|
|
|
54
|
+
| `before_agent_start` | Every conversation | Recalls relevant memories and injects them into context |
|
|
55
|
+
| `agent_end` | After each turn | Extracts new facts from the conversation |
|
|
56
|
+
| `pre_compaction` | Before context compaction | Full memory extraction to prevent data loss |
|
|
57
|
+
|
|
58
|
+
## Recovery phrase
|
|
59
|
+
|
|
60
|
+
Your recovery phrase is a 12-word BIP-39 mnemonic -- like a crypto wallet seed. It derives all encryption keys locally. The server never sees it.
|
|
61
|
+
|
|
62
|
+
- **New user**: The plugin generates a random phrase and displays it once. Save it somewhere safe.
|
|
63
|
+
- **Returning user**: Enter your existing phrase to restore all your memories on a new device.
|
|
64
|
+
- **Lost phrase**: Memories cannot be recovered. This is the zero-knowledge guarantee.
|
|
65
|
+
|
|
66
|
+
## Privacy and security
|
|
67
|
+
|
|
68
|
+
- All encryption happens client-side (AES-256-GCM + HKDF key derivation)
|
|
69
|
+
- The server stores only encrypted blobs and blind indices
|
|
70
|
+
- On-chain storage via Gnosis Chain (The Graph subgraph) -- fully auditable
|
|
71
|
+
- Master password never leaves your device
|
|
72
|
+
- One-click plaintext export -- no vendor lock-in
|
|
73
|
+
|
|
74
|
+
## Configuration
|
|
75
|
+
|
|
76
|
+
| Environment variable | Default | Description |
|
|
77
|
+
|---------------------|---------|-------------|
|
|
78
|
+
| `TOTALRECLAW_MASTER_PASSWORD` | *(required)* | 12-word BIP-39 recovery phrase |
|
|
79
|
+
| `TOTALRECLAW_SERVER_URL` | `https://api.totalreclaw.xyz` | Relay server URL |
|
|
80
|
+
| `TOTALRECLAW_SUBGRAPH_MODE` | `true` | Enable on-chain storage |
|
|
81
|
+
| `TOTALRECLAW_EXTRACT_EVERY_TURNS` | `1` | Turns between automatic extractions |
|
|
82
|
+
|
|
83
|
+
## Comparison
|
|
84
|
+
|
|
85
|
+
| Feature | TotalReclaw | agentmemory |
|
|
86
|
+
|---------|-------------|-------------|
|
|
87
|
+
| Encryption | Client-side (zero-knowledge) | Server-side (server can read) |
|
|
88
|
+
| Data portability | One-click plaintext export | No export |
|
|
89
|
+
| Key management | BIP-39 seed phrase (user-controlled) | Server-managed keys |
|
|
90
|
+
| Search method | Blind-index + encrypted reranking | Plaintext vector search |
|
|
91
|
+
| On-chain storage | Yes (Gnosis Chain subgraph) | No |
|
|
92
|
+
| Cross-device | Same seed = same memories | Tied to account |
|
|
93
|
+
|
|
94
|
+
The fundamental difference: with TotalReclaw, even a compromised server reveals nothing.
|
|
95
|
+
|
|
96
|
+
## Links
|
|
97
|
+
|
|
98
|
+
- [Website](https://totalreclaw.xyz)
|
|
99
|
+
- [Documentation](https://github.com/p-diogo/totalreclaw)
|
|
100
|
+
- [Pricing](https://totalreclaw.xyz/pricing)
|
|
101
|
+
|
|
102
|
+
## License
|
|
103
|
+
|
|
104
|
+
MIT
|