prism-mcp-server 5.5.0 → 6.1.9
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 +257 -350
- package/dist/backgroundScheduler.js +246 -110
- package/dist/config.js +8 -2
- package/dist/dashboard/server.js +198 -101
- package/dist/dashboard/ui.js +491 -54
- package/dist/hivemindWatchdog.js +4 -4
- package/dist/lifecycle.js +5 -5
- package/dist/scholar/webScholar.js +74 -44
- package/dist/server.js +36 -11
- package/dist/storage/configStorage.js +1 -1
- package/dist/storage/sqlite.js +671 -121
- package/dist/storage/supabase.js +187 -12
- package/dist/storage/supabaseMigrations.js +75 -1
- package/dist/tools/commonHelpers.js +127 -0
- package/dist/tools/compactionHandler.js +20 -2
- package/dist/tools/graphHandlers.js +706 -0
- package/dist/tools/hygieneHandlers.js +476 -0
- package/dist/tools/index.js +7 -2
- package/dist/tools/ledgerHandlers.js +1240 -0
- package/dist/tools/sessionMemoryDefinitions.js +330 -93
- package/dist/tools/sessionMemoryHandlers.js +249 -14
- package/dist/utils/autoLinker.js +170 -0
- package/dist/utils/cognitiveMemory.js +46 -0
- package/dist/utils/crdtMerge.js +38 -0
- package/dist/utils/imageCaptioner.js +1 -1
- package/dist/utils/llm/factory.js +1 -1
- package/dist/utils/math.js +10 -0
- package/dist/utils/tavilyApi.js +70 -0
- package/dist/utils/telemetry.js +2 -2
- package/dist/utils/turboquant.js +12 -4
- package/dist/utils/universalImporter.js +0 -0
- package/dist/utils/vaultExporter.js +176 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
**Your AI agent forgets everything between sessions. Prism fixes that.**
|
|
12
12
|
|
|
13
|
-
One command. Persistent memory.
|
|
13
|
+
One command. Persistent memory. Local-first by default. Optional cloud power-ups.
|
|
14
14
|
|
|
15
15
|
```bash
|
|
16
16
|
npx -y prism-mcp-server
|
|
@@ -22,18 +22,18 @@ Works with **Claude Desktop · Claude Code · Cursor · Windsurf · Cline · Gem
|
|
|
22
22
|
|
|
23
23
|
- [Why Prism?](#why-prism)
|
|
24
24
|
- [Quick Start](#-quick-start)
|
|
25
|
+
- [The Magic Moment](#-the-magic-moment)
|
|
25
26
|
- [Setup Guides](#-setup-guides)
|
|
26
27
|
- [What Makes Prism Different](#-what-makes-prism-different)
|
|
27
28
|
- [Use Cases](#-use-cases)
|
|
28
29
|
- [What's New](#-whats-new)
|
|
29
|
-
- [
|
|
30
|
-
- [How Prism Compares](#how-prism-compares)
|
|
30
|
+
- [How Prism Compares](#-how-prism-compares)
|
|
31
31
|
- [Tool Reference](#-tool-reference)
|
|
32
32
|
- [Environment Variables](#environment-variables)
|
|
33
33
|
- [Architecture](#architecture)
|
|
34
|
-
- [
|
|
35
|
-
- [Roadmap](#-roadmap)
|
|
36
|
-
- [Limitations](
|
|
34
|
+
- [Scientific Foundation](#-scientific-foundation)
|
|
35
|
+
- [Product Roadmap](#-product-roadmap)
|
|
36
|
+
- [Limitations](#limitations)
|
|
37
37
|
|
|
38
38
|
---
|
|
39
39
|
|
|
@@ -61,9 +61,47 @@ Add to your MCP client config (`claude_desktop_config.json`, `.cursor/mcp.json`,
|
|
|
61
61
|
}
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
**
|
|
64
|
+
> **Note on Windows/Restricted Shells:** If your MCP client complains that `npx` is not found, use the absolute path to your node binary (e.g. `C:\Program Files\nodejs\npx.cmd`) or install globally with caution.
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
**That's it.** Restart your client. All tools are available. Dashboard at `http://localhost:3000`. *(Note: The MCP server automatically starts this UI on port 3000 when connected. If you have a Next.js/React app running, port 3000 might already be in use.)*
|
|
67
|
+
|
|
68
|
+
### Capability Matrix
|
|
69
|
+
|
|
70
|
+
| Feature | Local (Offline) | Cloud (API Key) |
|
|
71
|
+
|:--------|:---:|:---:|
|
|
72
|
+
| Session memory & handoffs | ✅ | ✅ |
|
|
73
|
+
| Keyword search (FTS5) | ✅ | ✅ |
|
|
74
|
+
| Time travel & versioning | ✅ | ✅ |
|
|
75
|
+
| Mind Palace Dashboard | ✅ | ✅ |
|
|
76
|
+
| GDPR export (JSON/Markdown/Vault) | ✅ | ✅ |
|
|
77
|
+
| Semantic vector search | ❌ | ✅ `GOOGLE_API_KEY` |
|
|
78
|
+
| Morning Briefings | ❌ | ✅ `GOOGLE_API_KEY` |
|
|
79
|
+
| Auto-compaction | ❌ | ✅ `GOOGLE_API_KEY` |
|
|
80
|
+
| Web Scholar research | ❌ | ✅ `BRAVE_API_KEY` + `FIRECRAWL_API_KEY` (or `TAVILY_API_KEY`) |
|
|
81
|
+
| VLM image captioning | ❌ | ✅ Provider key |
|
|
82
|
+
|
|
83
|
+
> 🔑 The core Mind Palace works **100% offline** with zero API keys. Cloud keys unlock intelligence features. See [Environment Variables](#environment-variables).
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## ✨ The Magic Moment
|
|
88
|
+
|
|
89
|
+
> **Session 1** (Monday evening):
|
|
90
|
+
> ```
|
|
91
|
+
> You: "Analyze this auth architecture and plan the OAuth migration."
|
|
92
|
+
> Agent: *deep analysis, decisions, TODO list*
|
|
93
|
+
> Agent: session_save_ledger → session_save_handoff ✅
|
|
94
|
+
> ```
|
|
95
|
+
>
|
|
96
|
+
> **Session 2** (Tuesday morning — new conversation, new context window):
|
|
97
|
+
> ```
|
|
98
|
+
> Agent: session_load_context → "Welcome back! Yesterday we decided to use PKCE
|
|
99
|
+
> flow with refresh tokens. 3 TODOs remain: migrate the user table,
|
|
100
|
+
> update the middleware, and write integration tests."
|
|
101
|
+
> You: "Pick up where we left off."
|
|
102
|
+
> ```
|
|
103
|
+
>
|
|
104
|
+
> **Your agent remembers everything.** No re-uploading files. No re-explaining decisions.
|
|
67
105
|
|
|
68
106
|
---
|
|
69
107
|
|
|
@@ -145,19 +183,19 @@ Add to your Continue `config.json` or Cline MCP settings:
|
|
|
145
183
|
|
|
146
184
|
</details>
|
|
147
185
|
|
|
148
|
-
|
|
186
|
+
### Migration
|
|
149
187
|
|
|
150
188
|
<details>
|
|
151
189
|
<summary><strong>Migrating Existing History (Claude, Gemini, OpenAI)</strong></summary>
|
|
152
190
|
|
|
153
191
|
Prism can ingest months of historical sessions from other tools to give your Mind Palace a massive head start. Import via the **CLI** or directly from the [Mind Palace Dashboard](#-mind-palace-dashboard) Import tab (file picker + manual path + dry-run toggle).
|
|
154
192
|
|
|
155
|
-
|
|
193
|
+
#### Supported Formats
|
|
156
194
|
* **Claude Code** (`.jsonl` logs) — Automatically handles streaming chunk deduplication and `requestId` normalization.
|
|
157
195
|
* **Gemini** (JSON history arrays) — Supports large-file streaming for 100MB+ exports.
|
|
158
196
|
* **OpenAI** (JSON chat completion history) — Normalizes disparate tool-call structures into the unified Ledger schema.
|
|
159
197
|
|
|
160
|
-
|
|
198
|
+
#### How to Run
|
|
161
199
|
|
|
162
200
|
**Option 1 — CLI:**
|
|
163
201
|
|
|
@@ -171,7 +209,7 @@ npx -y prism-mcp-server universal-import --format gemini --path ./gemini_history
|
|
|
171
209
|
|
|
172
210
|
**Option 2 — Dashboard:** Open `localhost:3000`, navigate to the **Import** tab, select the format and file, and click Import. Supports dry-run preview. See the [dashboard screenshot](#-mind-palace-dashboard) above.
|
|
173
211
|
|
|
174
|
-
|
|
212
|
+
#### Key Features
|
|
175
213
|
* **OOM-Safe Streaming:** Processes massive log files line-by-line using `stream-json`.
|
|
176
214
|
* **Idempotent Dedup:** Content-hash prevents duplicate imports on re-run (`skipCount` reported).
|
|
177
215
|
* **Chronological Integrity:** Uses timestamp fallbacks and `requestId` sorting to ensure your memory timeline is accurate.
|
|
@@ -180,166 +218,23 @@ npx -y prism-mcp-server universal-import --format gemini --path ./gemini_history
|
|
|
180
218
|
</details>
|
|
181
219
|
|
|
182
220
|
<details>
|
|
183
|
-
<summary><strong>Claude Code — Lifecycle
|
|
184
|
-
|
|
185
|
-
Claude Code supports `SessionStart` and `Stop` hooks that force the agent to load/save Prism context automatically.
|
|
186
|
-
|
|
187
|
-
### 1. Create the Hook Script
|
|
188
|
-
|
|
189
|
-
Save as `~/.claude/mcp_autoload_hook.py`:
|
|
221
|
+
<summary><strong>Claude Code — Lifecycle Autoload (.clauderules)</strong></summary>
|
|
190
222
|
|
|
191
|
-
|
|
192
|
-
#!/usr/bin/env python3
|
|
193
|
-
import json, sys
|
|
223
|
+
Claude Code naturally picks up MCP tools by adding them to your workspace `.clauderules`. Simply add:
|
|
194
224
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
"suppressOutput": True,
|
|
199
|
-
"systemMessage": (
|
|
200
|
-
"## First Action\n"
|
|
201
|
-
"Call `mcp__prism-mcp__session_load_context(project='my-project', level='deep')` "
|
|
202
|
-
"before responding to the user. Do not generate any text before calling this tool."
|
|
203
|
-
)
|
|
204
|
-
}))
|
|
205
|
-
|
|
206
|
-
if __name__ == "__main__":
|
|
207
|
-
main()
|
|
208
|
-
```
|
|
209
|
-
|
|
210
|
-
### 2. Configure `settings.json`
|
|
211
|
-
|
|
212
|
-
```json
|
|
213
|
-
{
|
|
214
|
-
"hooks": {
|
|
215
|
-
"SessionStart": [
|
|
216
|
-
{
|
|
217
|
-
"matcher": "*",
|
|
218
|
-
"hooks": [
|
|
219
|
-
{
|
|
220
|
-
"type": "command",
|
|
221
|
-
"command": "python3 /Users/you/.claude/mcp_autoload_hook.py",
|
|
222
|
-
"timeout": 10
|
|
223
|
-
}
|
|
224
|
-
]
|
|
225
|
-
}
|
|
226
|
-
],
|
|
227
|
-
"Stop": [
|
|
228
|
-
{
|
|
229
|
-
"matcher": "*",
|
|
230
|
-
"hooks": [
|
|
231
|
-
{
|
|
232
|
-
"type": "command",
|
|
233
|
-
"command": "python3 -c \"import json; print(json.dumps({'continue': True, 'suppressOutput': True, 'systemMessage': 'MANDATORY END WORKFLOW: 1) Call mcp__prism-mcp__session_save_ledger with project and summary. 2) Call mcp__prism-mcp__session_save_handoff with expected_version set to the loaded version.'}))\""
|
|
234
|
-
}
|
|
235
|
-
]
|
|
236
|
-
}
|
|
237
|
-
]
|
|
238
|
-
},
|
|
239
|
-
"permissions": {
|
|
240
|
-
"allow": [
|
|
241
|
-
"mcp__prism-mcp__session_load_context",
|
|
242
|
-
"mcp__prism-mcp__session_save_ledger",
|
|
243
|
-
"mcp__prism-mcp__session_save_handoff",
|
|
244
|
-
"mcp__prism-mcp__knowledge_search",
|
|
245
|
-
"mcp__prism-mcp__session_search_memory"
|
|
246
|
-
]
|
|
247
|
-
}
|
|
248
|
-
}
|
|
225
|
+
```markdown
|
|
226
|
+
Always start the conversation by calling `mcp__prism-mcp__session_load_context(project='my-project', level='deep')`.
|
|
227
|
+
When wrapping up, always call `mcp__prism-mcp__session_save_ledger` and `mcp__prism-mcp__session_save_handoff`.
|
|
249
228
|
```
|
|
250
229
|
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
- **Hook not firing?** Check `timeout` — if your script takes too long, Claude ignores it.
|
|
254
|
-
- **"Tool not available"?** This is a hallucination. Ensure `permissions.allow` exactly matches the double-underscore format.
|
|
230
|
+
> **Format Note:** Claude automatically wraps MCP tools with double underscores (`mcp__prism-mcp__...`), while most other clients use single underscores (`mcp_prism-mcp_...`). Prism's backend natively handles both formats seamlessly.
|
|
255
231
|
|
|
256
232
|
</details>
|
|
257
233
|
|
|
258
234
|
<details id="antigravity-auto-load">
|
|
259
|
-
<summary><strong>Gemini / Antigravity —
|
|
260
|
-
|
|
261
|
-
Gemini-based agents (including Google's Antigravity IDE) use a **three-layer architecture** for reliable auto-load, proven over **14+ iterations** of prompt engineering (March 2026).
|
|
235
|
+
<summary><strong>Gemini / Antigravity — Prompt Auto-Load</strong></summary>
|
|
262
236
|
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
| Layer | File | Purpose |
|
|
266
|
-
|-------|------|---------|
|
|
267
|
-
| **1. User Rules** | `~/.gemini/GEMINI.md` | Slim ~10-line directive injected verbatim into system prompt |
|
|
268
|
-
| **2. Cross-Tool Rules** | `~/.gemini/AGENTS.md` | Reinforcement for multi-client setups (Antigravity + Cursor) |
|
|
269
|
-
| **3. Skill** | `.agent/skills/prism-startup/SKILL.md` | Full startup procedure with greeting detection and context echo |
|
|
270
|
-
| **Server Fallback** | Built into `server.ts` (v5.2.1) | Deferred auto-push via `sendLoggingMessage` if model doesn't comply within 10s |
|
|
271
|
-
|
|
272
|
-
### Layer 1: User Rules
|
|
273
|
-
|
|
274
|
-
Create `~/.gemini/GEMINI.md`:
|
|
275
|
-
|
|
276
|
-
```markdown
|
|
277
|
-
# Startup — MANDATORY
|
|
278
|
-
|
|
279
|
-
Your first action in every conversation is a tool call. Zero text before it.
|
|
280
|
-
|
|
281
|
-
Tool: mcp_prism-mcp_session_load_context
|
|
282
|
-
Args: project="my-project", level="deep"
|
|
283
|
-
|
|
284
|
-
After success: echo agent identity, last summary, open TODOs, session version.
|
|
285
|
-
If the call fails: say "Prism load failed — retrying" and try ONE more time.
|
|
286
|
-
```
|
|
287
|
-
|
|
288
|
-
### Layer 2: Cross-Tool Reinforcement
|
|
289
|
-
|
|
290
|
-
Create `~/.gemini/AGENTS.md`:
|
|
291
|
-
|
|
292
|
-
```markdown
|
|
293
|
-
# Session Memory
|
|
294
|
-
Every conversation starts with: mcp_prism-mcp_session_load_context(project="my-project", level="deep")
|
|
295
|
-
Echo result: agent identity, TODOs, session version.
|
|
296
|
-
```
|
|
297
|
-
|
|
298
|
-
### Layer 3: Prism Startup Skill
|
|
299
|
-
|
|
300
|
-
Create `.agent/skills/prism-startup/SKILL.md` (or `.agents/skills/`) in your project or global config. This is a structured skill file that Antigravity loads with higher priority than plain rules. It includes:
|
|
301
|
-
|
|
302
|
-
- Greeting detection (fires on "hi", "hello", etc.)
|
|
303
|
-
- Full tool call instructions with error handling
|
|
304
|
-
- Context echo template (agent identity, TODOs, version)
|
|
305
|
-
- Startup block display
|
|
306
|
-
|
|
307
|
-
### Server-Side Fallback (v5.2.1)
|
|
308
|
-
|
|
309
|
-
If the model ignores all three layers, Prism's server pushes context automatically:
|
|
310
|
-
|
|
311
|
-
1. After storage warmup, a 10-second timer starts
|
|
312
|
-
2. If `session_load_context` hasn't been called by then, the server pushes context via `sendLoggingMessage`
|
|
313
|
-
3. If the client already called the tool, the push is silently skipped (zero impact on Claude CLI)
|
|
314
|
-
|
|
315
|
-
This ensures context is always available, even with non-compliant models.
|
|
316
|
-
|
|
317
|
-
### Why This Architecture Works
|
|
318
|
-
|
|
319
|
-
- **Gemini uses single underscores** for MCP tools (`mcp_prism-mcp_...`) vs Claude's double underscores
|
|
320
|
-
- **Slim rules** (~10 lines) avoid triggering adversarial "tool not found" reasoning
|
|
321
|
-
- **Skills have dedicated 3-level loading** in Antigravity — higher compliance than plain rules
|
|
322
|
-
- **Server fallback** catches the remaining edge cases without affecting well-behaved clients
|
|
323
|
-
- **Positive "First Action" framing** outperforms negative constraint lists
|
|
324
|
-
|
|
325
|
-
### Antigravity UI Caveat
|
|
326
|
-
|
|
327
|
-
Antigravity **does not visually render MCP tool output blocks** in the chat UI. The tool executes successfully, but the user sees nothing. All three layers instruct the agent to **echo context in its text reply**.
|
|
328
|
-
|
|
329
|
-
### Session End Workflow
|
|
330
|
-
|
|
331
|
-
Tell the agent: *"Wrap up the session."* It should execute:
|
|
332
|
-
|
|
333
|
-
1. `session_save_ledger` — append immutable work log (summary, decisions, files changed)
|
|
334
|
-
2. `session_save_handoff` — upsert project state with `expected_version` for OCC
|
|
335
|
-
|
|
336
|
-
> **Tip:** Include session-end instructions in your `GEMINI.md` or ask the agent to save when you're done.
|
|
337
|
-
|
|
338
|
-
### Platform Gotchas
|
|
339
|
-
|
|
340
|
-
- **`replace_file_content` silently fails** on `~/.gemini/GEMINI.md` in some environments — use `write_to_file` with overwrite instead
|
|
341
|
-
- **Multiple GEMINI.md locations** can conflict: global (`~/.gemini/`), workspace, and User Rules in the Antigravity UI. Keep them synchronized
|
|
342
|
-
- **Camoufox/browser tools** called at startup spawn visible black windows — never call browser tools during greeting handlers
|
|
237
|
+
See the [Gemini Setup Guide](docs/SETUP_GEMINI.md) for the proven three-layer prompt architecture to ensure reliable session auto-loading.
|
|
343
238
|
|
|
344
239
|
</details>
|
|
345
240
|
|
|
@@ -357,7 +252,7 @@ To sync memory across machines or teams:
|
|
|
357
252
|
"env": {
|
|
358
253
|
"PRISM_STORAGE": "supabase",
|
|
359
254
|
"SUPABASE_URL": "https://your-project.supabase.co",
|
|
360
|
-
"SUPABASE_KEY": "your-supabase-anon-key"
|
|
255
|
+
"SUPABASE_KEY": "your-supabase-anon-or-service-key"
|
|
361
256
|
}
|
|
362
257
|
}
|
|
363
258
|
}
|
|
@@ -366,6 +261,8 @@ To sync memory across machines or teams:
|
|
|
366
261
|
|
|
367
262
|
See the **Supabase Setup** section below for schema migration instructions.
|
|
368
263
|
|
|
264
|
+
> **Anon key vs. service role key:** The anon key works for personal use (Supabase RLS policies apply). Use the service role key for team deployments where multiple users share the same Supabase project — it bypasses RLS and allows Prism to manage all rows regardless of auth context. Never expose the service role key client-side.
|
|
265
|
+
|
|
369
266
|
</details>
|
|
370
267
|
|
|
371
268
|
<details>
|
|
@@ -395,10 +292,32 @@ Then add to your MCP config:
|
|
|
395
292
|
|
|
396
293
|
</details>
|
|
397
294
|
|
|
295
|
+
### Common Installation Pitfalls
|
|
296
|
+
|
|
297
|
+
> **❌ Don't use `npm install -g`:**
|
|
298
|
+
> Hardcoding the binary path (e.g. `/opt/homebrew/Cellar/node/23.x/bin/prism-mcp-server`) is tied to a specific Node.js version — when Node updates, the path silently breaks.
|
|
299
|
+
>
|
|
300
|
+
> **✅ Always use `npx` instead:**
|
|
301
|
+
> ```json
|
|
302
|
+
> {
|
|
303
|
+
> "mcpServers": {
|
|
304
|
+
> "prism-mcp": {
|
|
305
|
+
> "command": "npx",
|
|
306
|
+
> "args": ["-y", "prism-mcp-server"]
|
|
307
|
+
> }
|
|
308
|
+
> }
|
|
309
|
+
> }
|
|
310
|
+
> ```
|
|
311
|
+
> `npx` resolves the correct binary automatically, always fetches the latest version, and works identically on macOS, Linux, and Windows. Already installed globally? Run `npm uninstall -g prism-mcp-server` first.
|
|
312
|
+
|
|
313
|
+
> **❓ Seeing warnings about missing API keys on startup?**
|
|
314
|
+
> That's expected and not an error. `BRAVE_API_KEY` / `GOOGLE_API_KEY` warnings are informational only — core session memory works with zero keys. See [Environment Variables](#environment-variables) for what each key unlocks.
|
|
315
|
+
|
|
398
316
|
---
|
|
399
317
|
|
|
400
318
|
## ✨ What Makes Prism Different
|
|
401
319
|
|
|
320
|
+
|
|
402
321
|
### 🧠 Your Agent Learns From Mistakes
|
|
403
322
|
When you correct your agent, Prism tracks it. Corrections accumulate **importance** over time. High-importance lessons auto-surface as warnings in future sessions — and can even sync to your `.cursorrules` file for permanent enforcement. Your agent literally gets smarter the more you use it.
|
|
404
323
|
|
|
@@ -409,8 +328,8 @@ Every save creates a versioned snapshot. Made a mistake? `memory_checkout` rever
|
|
|
409
328
|
A gorgeous glassmorphism UI at `localhost:3000` that lets you see exactly what your agent is thinking:
|
|
410
329
|
|
|
411
330
|
- **Current State & TODOs** — the exact context injected into the LLM's prompt
|
|
412
|
-
- **Interactive Knowledge Graph** — force-directed neural graph with click-to-filter, node renaming, and surgical keyword deletion
|
|
413
|
-
- **Deep Storage Manager** — preview and execute vector purge operations with dry-run safety
|
|
331
|
+
- **Interactive Knowledge Graph** — force-directed neural graph with click-to-filter, node renaming, and surgical keyword deletion
|
|
332
|
+
- **Deep Storage Manager** — preview and execute vector purge operations with dry-run safety
|
|
414
333
|
- **Session Ledger** — full audit trail of every decision your agent has made
|
|
415
334
|
- **Time Travel Timeline** — browse and revert any historical handoff version
|
|
416
335
|
- **Visual Memory Vault** — browse VLM-captioned screenshots and auto-captured HTML states
|
|
@@ -421,7 +340,7 @@ A gorgeous glassmorphism UI at `localhost:3000` that lets you see exactly what y
|
|
|
421
340
|

|
|
422
341
|
|
|
423
342
|
### 🧬 10× Memory Compression
|
|
424
|
-
Powered by a pure TypeScript port of Google's TurboQuant (ICLR
|
|
343
|
+
Powered by a pure TypeScript port of Google's TurboQuant (inspired by Google's ICLR research), Prism compresses 768-dim embeddings from **3,072 bytes → ~400 bytes** — enabling decades of session history on a standard laptop. No native modules. No vector database required.
|
|
425
344
|
|
|
426
345
|
### 🐝 Multi-Agent Hivemind
|
|
427
346
|
Multiple agents (dev, QA, PM) can work on the same project with **role-isolated memory**. Agents discover each other automatically, share context in real-time via Telepathy sync, and see a team roster during context loading.
|
|
@@ -432,11 +351,11 @@ Save UI screenshots, architecture diagrams, and bug states to a searchable vault
|
|
|
432
351
|
### 🔭 Full Observability
|
|
433
352
|
OpenTelemetry spans for every MCP tool call, LLM hop, and background worker. Route to Jaeger, Grafana, or any OTLP collector. Configure in the dashboard — zero code changes.
|
|
434
353
|
|
|
435
|
-
|
|
436
|
-
Prism researches while you sleep. A background pipeline searches the web, scrapes articles, synthesizes findings via LLM, and injects results directly into your semantic memory — fully searchable on your next session.
|
|
354
|
+
### 🌐 Autonomous Web Scholar
|
|
355
|
+
Prism researches while you sleep. A background pipeline searches the web, scrapes articles, synthesizes findings via LLM, and injects results directly into your semantic memory — fully searchable on your next session. Brave Search → Firecrawl scrape → LLM synthesis → Prism ledger. Task-aware, Hivemind-integrated, and zero-config when API keys are missing (falls back to Yahoo + Readability).
|
|
437
356
|
|
|
438
357
|
### 🔒 GDPR Compliant
|
|
439
|
-
Soft/hard delete (Art. 17), full
|
|
358
|
+
Soft/hard delete (Art. 17), full export in JSON, Markdown, or Obsidian vault `.zip` (Art. 20), API key redaction, per-project TTL retention, and audit trail. Enterprise-ready out of the box.
|
|
440
359
|
|
|
441
360
|
---
|
|
442
361
|
|
|
@@ -462,24 +381,65 @@ Soft/hard delete (Art. 17), full ZIP export (Art. 20), API key redaction, per-pr
|
|
|
462
381
|
|
|
463
382
|
## 🆕 What's New
|
|
464
383
|
|
|
465
|
-
###
|
|
466
|
-
> **Current stable release.**
|
|
467
|
-
|
|
468
|
-
-
|
|
469
|
-
-
|
|
470
|
-
-
|
|
471
|
-
-
|
|
472
|
-
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
- 🌐 **
|
|
478
|
-
-
|
|
384
|
+
### v6.1 — Prism-Port, Cognitive Load & Semantic Search ✅
|
|
385
|
+
> **Current stable release (v6.1.9).** Data sovereignty meets active memory intelligence.
|
|
386
|
+
|
|
387
|
+
- 📦 **Prism-Port Vault Export** — New `vault` format for `session_export_memory`. Generates a `.zip` of interlinked Markdown files with YAML frontmatter, `[[Wikilinks]]`, and auto-generated `Keywords/` backlink indices. Drop into Obsidian or Logseq for instant knowledge graph.
|
|
388
|
+
- 🏛️ **Dashboard Export Vault Button** — "🏛️ Export Vault" button in the Mind Palace UI exports the full Prism-Port vault ZIP directly from the browser. Both `/api/export` and `/api/export/vault` now use the unified `buildVaultDirectory` path — same rich format as the MCP tool.
|
|
389
|
+
- 🏥 **Dashboard Health Cleanup** — The "Fix Issues" button now repairs missing embeddings directly from the Mind Palace UI.
|
|
390
|
+
- 🧠 **Smart Memory Merge UI** — Dynamically merge duplicate knowledge nodes right from the Graph Editor. "Knowledge Gardening" made effortless.
|
|
391
|
+
- ✨ **Semantic Search Highlighting** — Native RegEx mapping that visually wraps the exact reason a vector result was retrieved during a search.
|
|
392
|
+
- 📊 **Deep Purge Visualization** — A zero-overhead "Memory Density" analytic providing instant signal-to-noise ratio visibility (Graduated ideas vs raw concepts).
|
|
393
|
+
- 🛡️ **Context-Boosted Search** — Biases semantic queries by intelligently interleaving your current project workspace.
|
|
394
|
+
|
|
395
|
+
#### v6.1.9 — Web Scholar Tavily Integration
|
|
396
|
+
- 🌐 **Tavily Core** — The Web Scholar now supports `@tavily/core` as an all-in-one search and extraction alternative to Brave+Firecrawl.
|
|
397
|
+
- 📦 **API Chunking Limits** — Advanced looping logic transparently works around `tavily.extract` 20-URL boundaries.
|
|
398
|
+
- 🛡️ **Network Resilience** — Handled promise rejections prevent data loss out-of-bounds due to chunk extraction or upstream network timeouts.
|
|
399
|
+
|
|
400
|
+
#### v6.1.8 — Type Guard Hardening (Production Safety)
|
|
401
|
+
- 🛡️ **Missing Guard Added** — `isSessionCompactLedgerArgs` was absent; an LLM passing `{threshold: "many"}` would reach the handler as a string. Added full validation for all four optional fields.
|
|
402
|
+
- ✅ **Array Field Validation** — `isSessionSaveLedgerArgs` now guards `todos`, `files_changed`, and `decisions` with `Array.isArray` checks — prevents a hallucinated `{todos: "string"}` from bypassing the type system.
|
|
403
|
+
- 🔖 **Enum Literal Guard** — `isSessionExportMemoryArgs` now rejects any `format` value outside `'json' | 'markdown' | 'vault'` at the boundary instead of propagating to the handler.
|
|
404
|
+
- 🔢 **Numeric Field Guards** — `isSessionIntuitiveRecallArgs` now validates `limit` and `threshold` as numbers, blocking string coercion (`{limit: "many"}`).
|
|
405
|
+
- 🧹 **Legacy Guard Migration** — `isMemoryHistoryArgs`, `isMemoryCheckoutArgs`, and `isSessionSaveImageArgs` migrated to the consistent `Record<string, unknown>` pattern; `isMemoryHistoryArgs` also gains a previously missing `limit` number check.
|
|
406
|
+
|
|
407
|
+
#### v6.1.7 — Dashboard Toggle Persistence
|
|
408
|
+
- 🔄 **Rollback on Save Failure** — `saveSetting()` now returns `Promise<boolean>`; UI toggles (Hivemind, Auto-Capture) roll back their optimistic state if the server request fails.
|
|
409
|
+
- 🚫 **Cache-Busting** — `loadSettings()` appends `?t=<timestamp>` to bypass stale browser/service-worker caches.
|
|
410
|
+
- 🔔 **HTTP Error Detection** — Explicit 4xx/5xx catching in `saveSetting()` surfaces failed saves as user-visible toast notifications.
|
|
411
|
+
|
|
412
|
+
#### v6.1.6 — Type Guard Audit (Round 1)
|
|
413
|
+
- 🛡️ **11 Type Guards Hardened** — Audited and refactored all MCP tool argument guards to include explicit `typeof` validation for optional fields, preventing LLM-hallucinated payloads from causing runtime type coercion errors.
|
|
414
|
+
|
|
415
|
+
#### v6.1.5 — SQLite Deep Storage TTL
|
|
416
|
+
- 🧪 **Comprehensive Edge-Case Test Suite** — 425 tests across 20 files covering CRDT merges, TurboQuant mathematical invariants, prototype pollution guards, and SQLite retention TTL boundary conditions.
|
|
417
|
+
- 🔒 **Prototype Pollution Guards** — CRDT merge pipeline hardened against `__proto__` / `constructor` injection via `Object.create(null)` scratchpads.
|
|
418
|
+
- 🗜️ **`maintenance_vacuum` Tool** — New tool to reclaim SQLite disk space after large purge operations.
|
|
419
|
+
|
|
420
|
+
#### v6.1.4 — Production Hardening
|
|
421
|
+
- 🔒 **Embedding Binary Strip** — Both `embedding` (raw float32) and `embedding_compressed` (TurboQuant binary blob) are now stripped from all export formats, preventing ~400 bytes of raw binary per entry from appearing in vault/JSON exports.
|
|
422
|
+
- 🔗 **Vault Wikilink Fix** — Keyword backlink paths now use vault-relative `Ledger/filename.md` instead of `../Ledger/filename.md` — ensuring correct internal link resolution in Obsidian and Logseq.
|
|
423
|
+
- 🖼️ **Visual Memory Key Fix** — Export correctly reads `filename` and `timestamp` (the keys written by `session_save_image`), resolving a mismatch that produced `"Unknown"` values in the vault visual memory index.
|
|
424
|
+
- 🛡️ **OOM Guard on Large Exports** — `getLedgerEntries` in the export handler now has a 10,000-entry ceiling with explicit `ORDER BY created_at ASC`, preventing unbounded heap allocation on high-volume projects.
|
|
425
|
+
- ⚡ **O(1) Filename Dedup** — Vault filename collision resolution upgraded from O(n²) loop to O(1) `Map<string, number>` counter. Important for projects with many same-day sessions.
|
|
426
|
+
- 🔧 **TurboQuant Guard** — `bits` parameter now validated to `[2, 6]` range at construction time, preventing accidental multi-second Lloyd-Max initialization at higher bit depths.
|
|
427
|
+
|
|
428
|
+

|
|
479
429
|
|
|
480
430
|
<details>
|
|
481
|
-
<summary><strong>Earlier releases (v5.
|
|
482
|
-
|
|
431
|
+
<summary><strong>Earlier releases (v5.x and below)</strong></summary>
|
|
432
|
+
|
|
433
|
+
#### v5.5 — Architectural Hardening
|
|
434
|
+
- 🛡️ **Transactional Migrations** — SQLite DDL rebuilds are wrapped in explicit `BEGIN/COMMIT` blocks.
|
|
435
|
+
- 🛑 **Graceful Shutdown Registry** — `BackgroundTaskRegistry` uses a 5-second `Promise.race()` to await flushes.
|
|
436
|
+
- 🕰️ **Thundering Herd Prevention** — Maintenance scheduler migrated from `setInterval` to state-aware `setTimeout`.
|
|
437
|
+
- 🚀 **Zero-Thrashing SDM Scans** — `Int32Array` scratchpad allocations hoisted outside the hot decode loop.
|
|
438
|
+
|
|
439
|
+
#### v5.4 — Convergent Intelligence
|
|
440
|
+
- 🔄 **CRDT Handoff Merging** — Multi-agent saves no longer reject on version conflict. Custom OR-Map engine auto-merges concurrent edits.
|
|
441
|
+
- ⏰ **Background Purge Scheduler** — Fully automated storage maintenance TTL sweep, Ebbinghaus decay, auto-compaction.
|
|
442
|
+
- 🌐 **Autonomous Web Scholar** — Agent-driven research pipeline. Brave Search → Firecrawl scrape → LLM synthesis.
|
|
483
443
|
- **v5.3** — Hivemind Health Watchdog (state machine, loop detection, Telepathy alert injection)
|
|
484
444
|
- **v5.2** — Cognitive Memory (Ebbinghaus decay, context-weighted retrieval), Universal History Migration, Smart Consolidation
|
|
485
445
|
- **v5.1** — Knowledge Graph Editor, Deep Storage purge
|
|
@@ -492,29 +452,27 @@ Soft/hard delete (Art. 17), full ZIP export (Art. 20), API key redaction, per-pr
|
|
|
492
452
|
|
|
493
453
|
---
|
|
494
454
|
|
|
495
|
-
## How Prism Compares
|
|
496
|
-
|
|
497
|
-
**Prism MCP**
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
- ✅
|
|
504
|
-
- ✅
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
- ✅
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
- ✅ IDE rules sync — graduated insights → `.cursorrules` / `.clauderules`
|
|
517
|
-
- ✅ Air-gapped mode — SQLite + Ollama, zero internet needed
|
|
455
|
+
## 🆚 How Prism Compares
|
|
456
|
+
|
|
457
|
+
| Capability | **Prism MCP** | [MCP Memory](https://github.com/modelcontextprotocol/servers/tree/main/src/memory) | [Mem0](https://github.com/mem0ai/mem0) | [Mnemory](https://github.com/fpytloun/mnemory) | [Basic Memory](https://github.com/basicmachines-co/basic-memory) |
|
|
458
|
+
|:-----------|:---:|:---:|:---:|:---:|:---:|
|
|
459
|
+
| Zero-config (`npx` one-liner) | ✅ | ✅ | ❌ Docker | ✅ | ✅ |
|
|
460
|
+
| Time travel (version revert) | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
461
|
+
| Behavioral memory (mistake learning) | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
462
|
+
| Visual dashboard | ✅ | ❌ | ✅ Web | ❌ | ❌ |
|
|
463
|
+
| Multi-agent Hivemind | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
464
|
+
| CRDT conflict-free merging | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
465
|
+
| Autonomous research (Web Scholar) | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
466
|
+
| Visual memory (VLM screenshots) | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
467
|
+
| 10× vector compression | ✅ | ❌ | ❌ (Qdrant) | ❌ | ❌ |
|
|
468
|
+
| Obsidian/Logseq vault export | ✅ | ❌ | ❌ | ❌ | ✅ |
|
|
469
|
+
| Token budgeting | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
470
|
+
| GDPR compliance (Art. 17 + 20) | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
471
|
+
| OpenTelemetry tracing | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
472
|
+
| IDE rules sync (`.cursorrules`) | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
473
|
+
| Air-gapped mode (Ollama) | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
474
|
+
| Morning Briefings | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
475
|
+
| Auto-compaction | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
518
476
|
|
|
519
477
|
> **TL;DR:** Prism is the only MCP memory server with time travel, behavioral learning, autonomous research, CRDT multi-agent sync, and 10× compression — all from a single `npx` command.
|
|
520
478
|
|
|
@@ -522,6 +480,18 @@ Soft/hard delete (Art. 17), full ZIP export (Art. 20), API key redaction, per-pr
|
|
|
522
480
|
|
|
523
481
|
## 🔧 Tool Reference
|
|
524
482
|
|
|
483
|
+
Prism ships 30+ tools, but **90% of your workflow uses just three:**
|
|
484
|
+
|
|
485
|
+
> **🎯 The Big Three**
|
|
486
|
+
>
|
|
487
|
+
> | Tool | When | What it does |
|
|
488
|
+
> |------|------|--------------|
|
|
489
|
+
> | `session_load_context` | ▶️ Start of session | Loads your agent’s brain from last time |
|
|
490
|
+
> | `session_save_ledger` | ⏹️ End of session | Records what was accomplished |
|
|
491
|
+
> | `knowledge_search` | 🔍 Anytime | Finds past decisions, context, and learnings |
|
|
492
|
+
>
|
|
493
|
+
> *Everything else is a power-up. Start with these three and you’re 90% there.*
|
|
494
|
+
|
|
525
495
|
<details>
|
|
526
496
|
<summary><strong>Session Memory & Knowledge (12 tools)</strong></summary>
|
|
527
497
|
|
|
@@ -536,7 +506,7 @@ Soft/hard delete (Art. 17), full ZIP export (Art. 20), API key redaction, per-pr
|
|
|
536
506
|
| `session_search_memory` | Vector similarity search across all sessions |
|
|
537
507
|
| `session_compact_ledger` | Auto-compact old entries via Gemini summarization |
|
|
538
508
|
| `session_forget_memory` | GDPR-compliant deletion (soft/hard + Art. 17 reason) |
|
|
539
|
-
| `session_export_memory` | Full
|
|
509
|
+
| `session_export_memory` | Full export (JSON, Markdown, or Obsidian vault `.zip` with `[[Wikilinks]]`) |
|
|
540
510
|
| `session_health_check` | Brain integrity scan + auto-repair (`fsck`) |
|
|
541
511
|
| `deep_storage_purge` | Reclaim ~90% vector storage (v5.1) |
|
|
542
512
|
|
|
@@ -603,7 +573,8 @@ Requires `PRISM_ENABLE_HIVEMIND=true`.
|
|
|
603
573
|
| Variable | Required | Description |
|
|
604
574
|
|----------|----------|-------------|
|
|
605
575
|
| `BRAVE_API_KEY` | No | Brave Search Pro API key |
|
|
606
|
-
| `FIRECRAWL_API_KEY` | No | Firecrawl API key — required for Web Scholar |
|
|
576
|
+
| `FIRECRAWL_API_KEY` | No | Firecrawl API key — required for Web Scholar (unless using Tavily) |
|
|
577
|
+
| `TAVILY_API_KEY` | No | Tavily Search API key — alternative to Brave+Firecrawl for Web Scholar |
|
|
607
578
|
| `PRISM_STORAGE` | No | `"local"` (default) or `"supabase"` — restart required |
|
|
608
579
|
| `PRISM_ENABLE_HIVEMIND` | No | `"true"` to enable multi-agent tools — restart required |
|
|
609
580
|
| `PRISM_INSTANCE` | No | Instance name for multi-server PID isolation |
|
|
@@ -612,7 +583,7 @@ Requires `PRISM_ENABLE_HIVEMIND=true`.
|
|
|
612
583
|
| `SUPABASE_URL` | If cloud | Supabase project URL |
|
|
613
584
|
| `SUPABASE_KEY` | If cloud | Supabase anon/service key |
|
|
614
585
|
| `PRISM_USER_ID` | No | Multi-tenant user isolation (default: `"default"`) |
|
|
615
|
-
| `PRISM_AUTO_CAPTURE` | No | `"true"` to auto-snapshot dev
|
|
586
|
+
| `PRISM_AUTO_CAPTURE` | No | `"true"` to auto-snapshot dev server UI states (HTML/DOM) for visual memory |
|
|
616
587
|
| `PRISM_CAPTURE_PORTS` | No | Comma-separated ports (default: `3000,3001,5173,8080`) |
|
|
617
588
|
| `PRISM_DEBUG_LOGGING` | No | `"true"` for verbose logs |
|
|
618
589
|
| `PRISM_DASHBOARD_PORT` | No | Dashboard port (default: `3000`) |
|
|
@@ -629,182 +600,118 @@ Requires `PRISM_ENABLE_HIVEMIND=true`.
|
|
|
629
600
|
|
|
630
601
|
## Architecture
|
|
631
602
|
|
|
632
|
-
|
|
633
|
-
|-------|------|---------|
|
|
634
|
-
| **1. User Rules** | `~/.gemini/GEMINI.md` | Slim ~10-line directive injected verbatim into system prompt |
|
|
635
|
-
| **2. Cross-Tool Rules** | `~/.gemini/AGENTS.md` | Reinforcement for multi-client setups (Antigravity + Cursor) |
|
|
636
|
-
| **3. Skill** | `.agent/skills/prism-startup/SKILL.md` | Full startup procedure with greeting detection and context echo |
|
|
637
|
-
| **Server Fallback** | Built into `server.ts` (v5.2.1) | Deferred auto-push via `sendLoggingMessage` if model doesn't comply within 10s |
|
|
638
|
-
|
|
639
|
-
### Layer 1: User Rules
|
|
640
|
-
|
|
641
|
-
Create `~/.gemini/GEMINI.md`:
|
|
642
|
-
|
|
643
|
-
```markdown
|
|
644
|
-
# Startup — MANDATORY
|
|
645
|
-
|
|
646
|
-
Your first action in every conversation is a tool call. Zero text before it.
|
|
647
|
-
|
|
648
|
-
Tool: mcp_prism-mcp_session_load_context
|
|
649
|
-
Args: project="my-project", level="deep"
|
|
603
|
+
Prism is a **stdio-based MCP server** that manages persistent agent memory. Here's how the pieces fit together:
|
|
650
604
|
|
|
651
|
-
After success: echo agent identity, last summary, open TODOs, session version.
|
|
652
|
-
If the call fails: say "Prism load failed — retrying" and try ONE more time.
|
|
653
605
|
```
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
606
|
+
┌──────────────────────────────────────────────────────────┐
|
|
607
|
+
│ MCP Client (Claude Desktop / Cursor / Antigravity) │
|
|
608
|
+
│ ↕ stdio (JSON-RPC) │
|
|
609
|
+
├──────────────────────────────────────────────────────────┤
|
|
610
|
+
│ Prism MCP Server │
|
|
611
|
+
│ │
|
|
612
|
+
│ ┌──────────────┐ ┌──────────────┐ ┌────────────────┐ │
|
|
613
|
+
│ │ 30+ Tools │ │ Lifecycle │ │ Dashboard │ │
|
|
614
|
+
│ │ (handlers) │ │ (PID lock, │ │ (HTTP :3000) │ │
|
|
615
|
+
│ │ │ │ shutdown) │ │ │ │
|
|
616
|
+
│ └──────┬───────┘ └──────────────┘ └────────────────┘ │
|
|
617
|
+
│ ↕ │
|
|
618
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
619
|
+
│ │ Storage Engine │ │
|
|
620
|
+
│ │ Local: SQLite + FTS5 + TurboQuant vectors │ │
|
|
621
|
+
│ │ Cloud: Supabase + pgvector │ │
|
|
622
|
+
│ └────────────────────────────────────────────────────┘ │
|
|
623
|
+
│ ↕ │
|
|
624
|
+
│ ┌────────────────────────────────────────────────────┐ │
|
|
625
|
+
│ │ Background Workers │ │
|
|
626
|
+
│ │ • Scheduler (TTL, decay, compaction, purge) │ │
|
|
627
|
+
│ │ • Web Scholar (Brave → Firecrawl → LLM → Ledger) │ │
|
|
628
|
+
│ │ • Hivemind heartbeats & Telepathy broadcasts │ │
|
|
629
|
+
│ │ • OpenTelemetry span export │ │
|
|
630
|
+
│ └────────────────────────────────────────────────────┘ │
|
|
631
|
+
└──────────────────────────────────────────────────────────┘
|
|
663
632
|
```
|
|
664
633
|
|
|
665
|
-
###
|
|
666
|
-
|
|
667
|
-
Create `.agent/skills/prism-startup/SKILL.md` (or `.agents/skills/`) in your project or global config. This is a structured skill file that Antigravity loads with higher priority than plain rules. It includes:
|
|
668
|
-
|
|
669
|
-
- Greeting detection (fires on "hi", "hello", etc.)
|
|
670
|
-
- Full tool call instructions with error handling
|
|
671
|
-
- Context echo template (agent identity, TODOs, version)
|
|
672
|
-
- Startup block display
|
|
673
|
-
|
|
674
|
-
### Server-Side Fallback (v5.2.1)
|
|
675
|
-
|
|
676
|
-
If the model ignores all three layers, Prism's server pushes context automatically:
|
|
677
|
-
|
|
678
|
-
1. After storage warmup, a 10-second timer starts
|
|
679
|
-
2. If `session_load_context` hasn't been called by then, the server pushes context via `sendLoggingMessage`
|
|
680
|
-
3. If the client already called the tool, the push is silently skipped (zero impact on Claude CLI)
|
|
681
|
-
|
|
682
|
-
This ensures context is always available, even with non-compliant models.
|
|
683
|
-
|
|
684
|
-
### Why This Architecture Works
|
|
685
|
-
|
|
686
|
-
- **Gemini uses single underscores** for MCP tools (`mcp_prism-mcp_...`) vs Claude's double underscores
|
|
687
|
-
- **Slim rules** (~10 lines) avoid triggering adversarial "tool not found" reasoning
|
|
688
|
-
- **Skills have dedicated 3-level loading** in Antigravity — higher compliance than plain rules
|
|
689
|
-
- **Server fallback** catches the remaining edge cases without affecting well-behaved clients
|
|
690
|
-
- **Positive "First Action" framing** outperforms negative constraint lists
|
|
691
|
-
|
|
692
|
-
### Antigravity UI Caveat
|
|
693
|
-
|
|
694
|
-
Antigravity **does not visually render MCP tool output blocks** in the chat UI. The tool executes successfully, but the user sees nothing. All three layers instruct the agent to **echo context in its text reply**.
|
|
695
|
-
|
|
696
|
-
### Session End Workflow
|
|
697
|
-
|
|
698
|
-
Tell the agent: *"Wrap up the session."* It should execute:
|
|
699
|
-
|
|
700
|
-
1. `session_save_ledger` — append immutable work log (summary, decisions, files changed)
|
|
701
|
-
2. `session_save_handoff` — upsert project state with `expected_version` for OCC
|
|
702
|
-
|
|
703
|
-
> **Tip:** Include session-end instructions in your `GEMINI.md` or ask the agent to save when you're done.
|
|
704
|
-
|
|
705
|
-
### Platform Gotchas
|
|
706
|
-
|
|
707
|
-
- **`replace_file_content` silently fails** on `~/.gemini/GEMINI.md` in some environments — use `write_to_file` with overwrite instead
|
|
708
|
-
- **Multiple GEMINI.md locations** can conflict: global (`~/.gemini/`), workspace, and User Rules in the Antigravity UI. Keep them synchronized
|
|
709
|
-
- **Camoufox/browser tools** called at startup spawn visible black windows — never call browser tools during greeting handlers
|
|
710
|
-
|
|
711
|
-
</details>
|
|
712
|
-
|
|
713
|
-
<details>
|
|
714
|
-
<summary><strong>Supabase Cloud Sync</strong></summary>
|
|
715
|
-
|
|
716
|
-
To sync memory across machines or teams:
|
|
717
|
-
|
|
718
|
-
```json
|
|
719
|
-
{
|
|
720
|
-
"mcpServers": {
|
|
721
|
-
"prism-mcp": {
|
|
722
|
-
"command": "npx",
|
|
723
|
-
"args": ["-y", "prism-mcp-server"],
|
|
724
|
-
"env": {
|
|
725
|
-
"PRISM_STORAGE": "supabase",
|
|
726
|
-
"SUPABASE_URL": "https://your-project.supabase.co",
|
|
727
|
-
"SUPABASE_KEY": "your-supabase-anon-key"
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
}
|
|
731
|
-
}
|
|
732
|
-
```
|
|
634
|
+
### Startup Sequence
|
|
733
635
|
|
|
734
|
-
|
|
636
|
+
1. **Acquire PID lock** — prevents duplicate instances per `PRISM_INSTANCE`
|
|
637
|
+
2. **Initialize config** — SQLite settings cache (`prism-config.db`)
|
|
638
|
+
3. **Register 30+ MCP tools** — session, knowledge, search, behavioral, hivemind
|
|
639
|
+
4. **Connect stdio transport** — MCP handshake with the client (~60ms total)
|
|
640
|
+
5. **Async post-connect** — storage warmup, dashboard launch, scheduler start (non-blocking)
|
|
735
641
|
|
|
736
|
-
|
|
642
|
+
### Storage Layers
|
|
737
643
|
|
|
738
|
-
|
|
739
|
-
|
|
644
|
+
| Layer | Technology | Purpose |
|
|
645
|
+
|-------|-----------|---------|
|
|
646
|
+
| **Session Ledger** | SQLite (append-only) | Immutable audit trail of all agent work |
|
|
647
|
+
| **Handoff State** | SQLite (upsert, versioned) | Live project context with OCC + CRDT merging |
|
|
648
|
+
| **Keyword Search** | FTS5 virtual tables | Zero-dependency full-text search |
|
|
649
|
+
| **Semantic Search** | TurboQuant compressed vectors | 10× compressed 768-dim embeddings, three-tier retrieval |
|
|
650
|
+
| **Cloud Sync** | Supabase + pgvector | Optional multi-device/team sync |
|
|
740
651
|
|
|
741
|
-
|
|
742
|
-
git clone https://github.com/dcostenco/prism-mcp.git
|
|
743
|
-
cd prism-mcp && npm install && npm run build
|
|
744
|
-
```
|
|
652
|
+
### Auto-Load Architecture
|
|
745
653
|
|
|
746
|
-
|
|
654
|
+
Each MCP client has its own mechanism for ensuring Prism context loads on session start. See the platform-specific [Setup Guides](#-setup-guides) above for detailed instructions:
|
|
747
655
|
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
"prism-mcp": {
|
|
752
|
-
"command": "node",
|
|
753
|
-
"args": ["/path/to/prism-mcp/dist/server.js"],
|
|
754
|
-
"env": {
|
|
755
|
-
"BRAVE_API_KEY": "your-key",
|
|
756
|
-
"GOOGLE_API_KEY": "your-gemini-key"
|
|
757
|
-
}
|
|
758
|
-
}
|
|
759
|
-
}
|
|
760
|
-
}
|
|
761
|
-
```
|
|
656
|
+
- **Claude Code** — Lifecycle hooks (`SessionStart` / `Stop`)
|
|
657
|
+
- **Gemini / Antigravity** — Three-layer architecture (User Rules + AGENTS.md + Startup Skill)
|
|
658
|
+
- **Cursor / Windsurf / VS Code** — System prompt instructions
|
|
762
659
|
|
|
763
|
-
|
|
660
|
+
All platforms benefit from the **server-side fallback** (v5.2.1): if `session_load_context` hasn't been called within 10 seconds, Prism auto-pushes context via `sendLoggingMessage`.
|
|
764
661
|
|
|
765
662
|
---
|
|
766
663
|
|
|
767
|
-
##
|
|
664
|
+
## 🧬 Scientific Foundation
|
|
768
665
|
|
|
769
666
|
Prism is evolving from smart session logging toward a **cognitive memory architecture** — grounded in real research, not marketing.
|
|
770
667
|
|
|
771
668
|
| Phase | Feature | Inspired By | Status |
|
|
772
669
|
|-------|---------|-------------|--------|
|
|
670
|
+
| **v5.0** | TurboQuant 10× Compression — 4-bit quantized 768-dim vectors in <500 bytes | Vector quantization (product/residual PQ) | ✅ Shipped |
|
|
671
|
+
| **v5.0** | Three-Tier Search — native → TurboQuant → FTS5 keyword fallback | Cascaded retrieval architectures | ✅ Shipped |
|
|
773
672
|
| **v5.2** | Smart Consolidation — extract principles, not just summaries | Neuroscience sleep consolidation | ✅ Shipped |
|
|
774
673
|
| **v5.2** | Ebbinghaus Importance Decay — memories fade unless reinforced | Ebbinghaus forgetting curve | ✅ Shipped |
|
|
775
674
|
| **v5.2** | Context-Weighted Retrieval — current work biases what surfaces | Contextual memory in cognitive science | ✅ Shipped |
|
|
675
|
+
| **v5.4** | CRDT Handoff Merging — conflict-free multi-agent state via OR-Map engine | CRDTs (Shapiro et al., 2011) | ✅ Shipped |
|
|
676
|
+
| **v5.4** | Autonomous Web Scholar — background research pipeline with LLM synthesis | Autonomous research agents | ✅ Shipped |
|
|
776
677
|
| **v5.5** | SDM Decoder Foundation — pre-allocated typed-array hot loop, zero GC thrash | Kanerva's Sparse Distributed Memory (1988) | ✅ Shipped |
|
|
777
|
-
| **v5.
|
|
778
|
-
| **
|
|
779
|
-
| **v6.
|
|
780
|
-
| **
|
|
678
|
+
| **v5.5** | Architectural Hardening — transactional migrations, graceful shutdown, thundering herd prevention | Production reliability engineering | ✅ Shipped |
|
|
679
|
+
| **v6.1** | Intuitive Recall — proactive surface of relevant past decisions without explicit search; `session_intuitive_recall` tool | Predictive memory (cognitive science) | ✅ Shipped |
|
|
680
|
+
| **v6.2+** | Full Superposed Memory (SDM) — O(1) key-value retrieval via Hamming correlation | Kanerva's SDM | 🔬 In Progress |
|
|
681
|
+
| **v6.1** | Prism-Port Vault Export — Obsidian/Logseq `.zip` with YAML frontmatter & `[[Wikilinks]]` | Data sovereignty, PKM interop | ✅ Shipped |
|
|
682
|
+
| **v6.1** | Cognitive Load & Semantic Search — dynamic graph thinning, search highlights | Contextual working memory | ✅ Shipped |
|
|
683
|
+
| **v6.2** | Synthesize & Prune — automated edge synthesis and visual decay | Implicit associative memory | 🔬 In Progress |
|
|
684
|
+
| **v7.x** | Affect-Tagged Memory — sentiment shapes what gets recalled | Affect-modulated retrieval (neuroscience) | 🔭 Horizon |
|
|
685
|
+
| **v8+** | Zero-Search Retrieval — no index, no ANN, just ask the vector | Holographic Reduced Representations | 🔭 Horizon |
|
|
781
686
|
|
|
782
|
-
> Informed by LeCun's "Why AI Systems Don't Learn" (Dupoux, LeCun, Malik
|
|
687
|
+
> Informed by LeCun's "Why AI Systems Don't Learn" (Dupoux, LeCun, Malik) and Kanerva's SDM.
|
|
783
688
|
|
|
784
689
|
---
|
|
785
690
|
|
|
786
|
-
##
|
|
691
|
+
## 📦 Product Roadmap
|
|
787
692
|
|
|
788
693
|
> **[Full ROADMAP.md →](ROADMAP.md)**
|
|
789
694
|
|
|
790
|
-
|
|
791
|
-
-
|
|
695
|
+
### v6.2: The "Synthesize & Prune" Phase
|
|
696
|
+
The v6.1 series (through v6.1.8) shipped Prism-Port vault export, Intuitive Recall, full type guard hardening, and dashboard toggle persistence. The v6.2 phase aims to turn collected data into proactive intelligence, moving the dashboard from a passive storage viewer into an active, self-organizing Mind Palace.
|
|
792
697
|
|
|
793
|
-
**
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
- 📊 **Radar 2.0** — richer Hivemind dashboard with agent task graphs and dependency visualization
|
|
698
|
+
1. 🕸️ **Automated Edge Synthesis (The "Dream" Procedure):** A background routine that runs on the graph payload to find semantically similar but disconnected nodes via Cosine Similarity. It highlights potential ghostly edges in the UI, empowering the system to autonomously suggest new mental models instead of waiting for the user to connect the dots manually.
|
|
699
|
+
2. 🗓️ **Temporal Decay Heatmaps (Visualizing the Ebbinghaus Curve):** A UI overlay toggle where un-accessed nodes dynamically desaturate or physically "fade" while Graduated nodes (Score >= 7) stay vibrant longer. This makes the "Deep Purge" decision-making visceral: if the graph looks gray, trigger a learning session or a cleanup.
|
|
700
|
+
3. 📝 **Active Recall Prompt Generation (Knowledge Activation):** A "Test Me" utility in the `nodeEditorPanel`. Using a node's semantic neighbors, the dashboard generates synthetic quizzes to ensure context retention, pushing the product away from pure "storage" into genuine "active learning" capabilities.
|
|
797
701
|
|
|
798
702
|
---
|
|
799
703
|
|
|
800
|
-
##
|
|
704
|
+
## Limitations
|
|
801
705
|
|
|
802
706
|
- **LLM-dependent features require an API key.** Semantic search, Morning Briefings, auto-compaction, and VLM captioning need a `GOOGLE_API_KEY` (Gemini) or equivalent provider key. Without one, Prism falls back to keyword-only search (FTS5).
|
|
803
|
-
- **Auto-load is model-dependent.** Session auto-loading relies on the LLM following system prompt instructions
|
|
707
|
+
- **Auto-load is model- and client-dependent.** Session auto-loading relies on both the LLM following system prompt instructions *and* the MCP client completing tool registration before the model's first turn. Prism provides platform-specific [Setup Guides](#-setup-guides) and a server-side fallback (v5.2.1) that auto-pushes context after 10 seconds.
|
|
708
|
+
- **MCP client race conditions.** Some MCP clients may not finish tool enumeration before the model generates its first response, causing transient `unknown_tool` errors. This is a client-side timing issue — Prism's server completes the MCP handshake in ~60ms. Workaround: the server-side auto-push fallback and the startup skill's retry logic.
|
|
804
709
|
- **No real-time sync without Supabase.** Local SQLite mode is single-machine only. Multi-device or team sync requires a Supabase backend.
|
|
805
|
-
- **Embedding quality varies by provider.** Gemini `text-embedding-004` and OpenAI `text-embedding-3-small` produce high-quality 768-dim vectors. Ollama embeddings (e.g., `nomic-embed-text`) are usable but may reduce retrieval accuracy.
|
|
710
|
+
- **Embedding quality varies by provider.** Gemini `text-embedding-004` and OpenAI `text-embedding-3-small` produce high-quality 768-dim vectors. Prism passes `dimensions: 768` via the Matryoshka API for OpenAI models (native output is 1536-dim; this truncation is lossless and outperforms ada-002 at full 1536 dims). Ollama embeddings (e.g., `nomic-embed-text`) are usable but may reduce retrieval accuracy.
|
|
806
711
|
- **Dashboard is HTTP-only.** The Mind Palace dashboard at `localhost:3000` does not support HTTPS. For remote access, use a reverse proxy (nginx/Caddy) or SSH tunnel. Basic auth is available via `PRISM_DASHBOARD_USER` / `PRISM_DASHBOARD_PASS`.
|
|
807
|
-
- **
|
|
712
|
+
- **Long-lived clients can accumulate zombie processes.** MCP clients that run for extended periods (e.g., Claude CLI) may leave orphaned Prism server processes. The lifecycle manager detects true orphans (PPID=1) but allows coexistence for active parent processes. Use `PRISM_INSTANCE` to isolate instances across clients.
|
|
713
|
+
- **Migration is one-way.** Universal History Migration imports sessions *into* Prism but does not export back to Claude/Gemini/OpenAI formats. Use `session_export_memory` for portable JSON/Markdown export, or the `vault` format for Obsidian/Logseq-compatible `.zip` archives.
|
|
714
|
+
- **Export ceiling at 10,000 ledger entries.** The `session_export_memory` tool and the dashboard export button cap vault/JSON exports at 10,000 entries per project as an OOM guard. Projects exceeding this limit should use per-project exports and time-based filtering to stay within the ceiling. This limit does not affect search or context loading.
|
|
808
715
|
- **No Windows CI testing.** Prism is developed and tested on macOS/Linux. It should work on Windows via Node.js, but edge cases (file paths, PID locks) may surface.
|
|
809
716
|
|
|
810
717
|
---
|