prism-mcp

mcp
SUMMARY

๐Ÿง  Prism MCP โ€” Persistent memory for AI coding agents. Session history, semantic search, TurboQuant 10x compression, visual memory, autonomous Web Scholar, CRDT multi-agent merging, and a Mind Palace dashboard. Works with Claude, Cursor, Windsurf, Gemini.

README.md

๐Ÿง  Prism MCP โ€” The Mind Palace for AI Agents

npm version
MCP Registry
Glama
Smithery
License: MIT
TypeScript
Node.js

Your AI agent forgets everything between sessions. Prism fixes that.

One command. Persistent memory. Local-first by default. Optional cloud power-ups.

npx -y prism-mcp-server

Works with Claude Desktop ยท Claude Code ยท Cursor ยท Windsurf ยท Cline ยท Gemini ยท Antigravity โ€” any MCP client.

๐Ÿ“– Table of Contents


Why Prism?

Every time you start a new conversation with an AI coding assistant, it starts from scratch. You re-explain your architecture, re-describe your decisions, re-list your TODOs. Hours of context โ€” gone.

Prism gives your agent a brain that persists. Save what matters at the end of each session. Load it back instantly on the next one. Your agent remembers what it did, what it learned, and what's left to do.


๐Ÿš€ Quick Start

Add to your MCP client config (claude_desktop_config.json, .cursor/mcp.json, etc.):

{
  "mcpServers": {
    "prism-mcp": {
      "command": "npx",
      "args": ["-y", "prism-mcp-server"]
    }
  }
}

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.

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.)

Capability Matrix

Feature Local (Offline) Cloud (API Key)
Session memory & handoffs โœ… โœ…
Keyword search (FTS5) โœ… โœ…
Time travel & versioning โœ… โœ…
Mind Palace Dashboard โœ… โœ…
GDPR export (JSON/Markdown/Vault) โœ… โœ…
Semantic vector search โŒ โœ… GOOGLE_API_KEY
Morning Briefings โŒ โœ… GOOGLE_API_KEY
Auto-compaction โŒ โœ… GOOGLE_API_KEY
Web Scholar research โŒ โœ… BRAVE_API_KEY
VLM image captioning โŒ โœ… Provider key

๐Ÿ”‘ The core Mind Palace works 100% offline with zero API keys. Cloud keys unlock intelligence features. See Environment Variables.


โœจ The Magic Moment

Session 1 (Monday evening):

You: "Analyze this auth architecture and plan the OAuth migration."
Agent: *deep analysis, decisions, TODO list*
Agent: session_save_ledger โ†’ session_save_handoff โœ…

Session 2 (Tuesday morning โ€” new conversation, new context window):

Agent: session_load_context โ†’ "Welcome back! Yesterday we decided to use PKCE
       flow with refresh tokens. 3 TODOs remain: migrate the user table,
       update the middleware, and write integration tests."
You: "Pick up where we left off."

Your agent remembers everything. No re-uploading files. No re-explaining decisions.


๐Ÿ“– Setup Guides

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "prism-mcp": {
      "command": "npx",
      "args": ["-y", "prism-mcp-server"]
    }
  }
}
Cursor

Add to .cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

{
  "mcpServers": {
    "prism-mcp": {
      "command": "npx",
      "args": ["-y", "prism-mcp-server"]
    }
  }
}
Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "prism-mcp": {
      "command": "npx",
      "args": ["-y", "prism-mcp-server"]
    }
  }
}
VS Code + Continue / Cline

Add to your Continue config.json or Cline MCP settings:

{
  "mcpServers": {
    "prism-mcp": {
      "command": "npx",
      "args": ["-y", "prism-mcp-server"],
      "env": {
        "PRISM_STORAGE": "local",
        "BRAVE_API_KEY": "your-brave-api-key"
      }
    }
  }
}

Migration

Migrating Existing History (Claude, Gemini, OpenAI)

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 Import tab (file picker + manual path + dry-run toggle).

Supported Formats

  • Claude Code (.jsonl logs) โ€” Automatically handles streaming chunk deduplication and requestId normalization.
  • Gemini (JSON history arrays) โ€” Supports large-file streaming for 100MB+ exports.
  • OpenAI (JSON chat completion history) โ€” Normalizes disparate tool-call structures into the unified Ledger schema.

How to Run

Option 1 โ€” CLI:

# Ingest Claude Code history
npx -y prism-mcp-server universal-import --format claude --path ~/path/to/claude_log.jsonl --project my-project

# Dry run (verify mapping without saving)
npx -y prism-mcp-server universal-import --format gemini --path ./gemini_history.json --dry-run

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 above.

Key Features

  • OOM-Safe Streaming: Processes massive log files line-by-line using stream-json.
  • Idempotent Dedup: Content-hash prevents duplicate imports on re-run (skipCount reported).
  • Chronological Integrity: Uses timestamp fallbacks and requestId sorting to ensure your memory timeline is accurate.
  • Smart Context Mapping: Extracts cwd, gitBranch, and tool usage patterns into searchable metadata.
Claude Code โ€” Lifecycle Autoload (.clauderules)

Claude Code naturally picks up MCP tools by adding them to your workspace .clauderules. Simply add:

Always start the conversation by calling `mcp__prism-mcp__session_load_context(project='my-project', level='deep')`.
When wrapping up, always call `mcp__prism-mcp__session_save_ledger` and `mcp__prism-mcp__session_save_handoff`.

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.

Gemini / Antigravity โ€” Prompt Auto-Load

See the Gemini Setup Guide for the proven three-layer prompt architecture to ensure reliable session auto-loading.

Supabase Cloud Sync

To sync memory across machines or teams:

{
  "mcpServers": {
    "prism-mcp": {
      "command": "npx",
      "args": ["-y", "prism-mcp-server"],
      "env": {
        "PRISM_STORAGE": "supabase",
        "SUPABASE_URL": "https://your-project.supabase.co",
        "SUPABASE_KEY": "your-supabase-anon-key"
      }
    }
  }
}

See the Supabase Setup section below for schema migration instructions.

Clone & Build (Full Control)
git clone https://github.com/dcostenco/prism-mcp.git
cd prism-mcp && npm install && npm run build

Then add to your MCP config:

{
  "mcpServers": {
    "prism-mcp": {
      "command": "node",
      "args": ["/path/to/prism-mcp/dist/server.js"],
      "env": {
        "BRAVE_API_KEY": "your-key",
        "GOOGLE_API_KEY": "your-gemini-key"
      }
    }
  }
}

Common Installation Pitfalls

โŒ Don't use npm install -g:
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.

โœ… Always use npx instead:

{
  "mcpServers": {
    "prism-mcp": {
      "command": "npx",
      "args": ["-y", "prism-mcp-server"]
    }
  }
}

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.

โ“ Seeing warnings about missing API keys on startup?
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 for what each key unlocks.


โœจ What Makes Prism Different

๐Ÿง  Your Agent Learns From Mistakes

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.

๐Ÿ•ฐ๏ธ Time Travel

Every save creates a versioned snapshot. Made a mistake? memory_checkout reverts your agent's memory to any previous state โ€” like git revert for your agent's brain. Full version history with optimistic concurrency control.

๐Ÿ”ฎ Mind Palace Dashboard

A gorgeous glassmorphism UI at localhost:3000 that lets you see exactly what your agent is thinking:

  • Current State & TODOs โ€” the exact context injected into the LLM's prompt
  • Interactive Knowledge Graph โ€” force-directed neural graph with click-to-filter, node renaming, and surgical keyword deletion (v5.1)
  • Deep Storage Manager โ€” preview and execute vector purge operations with dry-run safety (v5.1)
  • Session Ledger โ€” full audit trail of every decision your agent has made
  • Time Travel Timeline โ€” browse and revert any historical handoff version
  • Visual Memory Vault โ€” browse VLM-captioned screenshots and auto-captured HTML states
  • Hivemind Radar โ€” real-time active agent roster with role, task, and heartbeat
  • Morning Briefing โ€” AI-synthesized action plan after 4+ hours away
  • Brain Health โ€” memory integrity scan with one-click auto-repair

Mind Palace Dashboard

๐Ÿงฌ 10ร— Memory Compression

Powered by a pure TypeScript port of Google's TurboQuant (Inspired by ICLR), 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.

๐Ÿ Multi-Agent Hivemind

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.

๐Ÿ–ผ๏ธ Visual Memory

Save UI screenshots, architecture diagrams, and bug states to a searchable vault. Images are auto-captioned by a VLM (Claude Vision / GPT-4V / Gemini) and become semantically searchable across sessions.

๐Ÿ”ญ Full Observability

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.

๐ŸŒ Autonomous Web Scholar

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).

๐Ÿ”’ GDPR Compliant

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.


๐ŸŽฏ Use Cases

Long-running feature work โ€” Save state at end of day, restore full context next morning. No re-explaining.

Multi-agent collaboration โ€” Dev, QA, and PM agents share real-time context without stepping on each other's memory.

Consulting / multi-project โ€” Switch between client projects with progressive loading: quick (~50 tokens), standard (~200), or deep (~1000+).

Visual debugging โ€” Save UI screenshots to searchable memory. Find that CSS bug from last week by description.

Team onboarding โ€” New team member's agent loads the full project history instantly.

Behavior enforcement โ€” Agent corrections auto-graduate into permanent .cursorrules / .clauderules rules.

Offline / air-gapped โ€” Full SQLite local mode + Ollama LLM adapter. Zero internet dependency.

Morning Briefings โ€” After 4+ hours away, Prism auto-synthesizes a 3-bullet action plan from your last sessions.


๐Ÿ†• What's New

v6.1 โ€” Prism-Port, Cognitive Load & Semantic Search โœ…

Current stable release. Data sovereignty meets active memory intelligence.

  • ๐Ÿ“ฆ 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.
  • ๐Ÿฅ Dashboard Health Cleanup โ€” The "Fix Issues" button now repairs missing embeddings directly from the Mind Palace UI.
  • ๐Ÿง  Smart Memory Merge UI โ€” Dynamically merge duplicate knowledge nodes right from the Graph Editor. "Knowledge Gardening" made effortless.
  • โœจ Semantic Search Highlighting โ€” Native RegEx mapping that visually wraps the exact reason a vector result was retrieved during a search.
  • ๐Ÿ“Š Deep Purge Visualization โ€” A zero-overhead "Memory Density" analytic providing instant signal-to-noise ratio visibility (Graduated ideas vs raw concepts).
  • ๐Ÿ›ก๏ธ Context-Boosted Search โ€” Biases semantic queries by intelligently interleaving your current project workspace.

Prism v6 Features

Earlier releases (v5.x and below)

v5.5 โ€” Architectural Hardening

  • ๐Ÿ›ก๏ธ Transactional Migrations โ€” SQLite DDL rebuilds are wrapped in explicit BEGIN/COMMIT blocks.
  • ๐Ÿ›‘ Graceful Shutdown Registry โ€” BackgroundTaskRegistry uses a 5-second Promise.race() to await flushes.
  • ๐Ÿ•ฐ๏ธ Thundering Herd Prevention โ€” Maintenance scheduler migrated from setInterval to state-aware setTimeout.
  • ๐Ÿš€ Zero-Thrashing SDM Scans โ€” Int32Array scratchpad allocations hoisted outside the hot decode loop.

v5.4 โ€” Convergent Intelligence

  • ๐Ÿ”„ CRDT Handoff Merging โ€” Multi-agent saves no longer reject on version conflict. Custom OR-Map engine auto-merges concurrent edits.

  • โฐ Background Purge Scheduler โ€” Fully automated storage maintenance TTL sweep, Ebbinghaus decay, auto-compaction.

  • ๐ŸŒ Autonomous Web Scholar โ€” Agent-driven research pipeline. Brave Search โ†’ Firecrawl scrape โ†’ LLM synthesis.

  • v5.3 โ€” Hivemind Health Watchdog (state machine, loop detection, Telepathy alert injection)

  • v5.2 โ€” Cognitive Memory (Ebbinghaus decay, context-weighted retrieval), Universal History Migration, Smart Consolidation

  • v5.1 โ€” Knowledge Graph Editor, Deep Storage purge

  • v5.0 โ€” TurboQuant 10ร— embedding compression, three-tier search architecture

  • v4.x โ€” OpenTelemetry, VLM multimodal memory, LLM adapters, Behavioral memory, Hivemind

Full CHANGELOG โ†’ ยท Architecture Deep Dive โ†’


๐Ÿ†š How Prism Compares

Capability Prism MCP MCP Memory Mem0 Mnemory Basic Memory
Zero-config (npx one-liner) โœ… โœ… โŒ Docker โœ… โœ…
Time travel (version revert) โœ… โŒ โŒ โŒ โŒ
Behavioral memory (mistake learning) โœ… โŒ โŒ โŒ โŒ
Visual dashboard โœ… โŒ โœ… Web โŒ โŒ
Multi-agent Hivemind โœ… โŒ โŒ โŒ โŒ
CRDT conflict-free merging โœ… โŒ โŒ โŒ โŒ
Autonomous research (Web Scholar) โœ… โŒ โŒ โŒ โŒ
Visual memory (VLM screenshots) โœ… โŒ โŒ โŒ โŒ
10ร— vector compression โœ… โŒ โŒ (Qdrant) โŒ โŒ
Obsidian/Logseq vault export โœ… โŒ โŒ โŒ โœ…
Token budgeting โœ… โŒ โŒ โŒ โŒ
GDPR compliance (Art. 17 + 20) โœ… โŒ โŒ โŒ โŒ
OpenTelemetry tracing โœ… โŒ โŒ โŒ โŒ
IDE rules sync (.cursorrules) โœ… โŒ โŒ โŒ โŒ
Air-gapped mode (Ollama) โœ… โŒ โŒ โŒ โŒ
Morning Briefings โœ… โŒ โŒ โŒ โŒ
Auto-compaction โœ… โŒ โŒ โŒ โŒ

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.


๐Ÿ”ง Tool Reference

Prism ships 30+ tools, but 90% of your workflow uses just three:

๐ŸŽฏ The Big Three

Tool When What it does
session_load_context โ–ถ๏ธ Start of session Loads your agentโ€™s brain from last time
session_save_ledger โน๏ธ End of session Records what was accomplished
knowledge_search ๐Ÿ” Anytime Finds past decisions, context, and learnings

Everything else is a power-up. Start with these three and youโ€™re 90% there.

Session Memory & Knowledge (12 tools)
Tool Purpose
session_save_ledger Append immutable session log (summary, TODOs, decisions)
session_save_handoff Upsert latest project state with OCC version tracking
session_load_context Progressive context loading (quick / standard / deep)
knowledge_search Full-text keyword search across accumulated knowledge
knowledge_forget Prune outdated or incorrect memories (4 modes + dry_run)
knowledge_set_retention Set per-project TTL retention policy
session_search_memory Vector similarity search across all sessions
session_compact_ledger Auto-compact old entries via Gemini summarization
session_forget_memory GDPR-compliant deletion (soft/hard + Art. 17 reason)
session_export_memory Full export (JSON, Markdown, or Obsidian vault .zip with [[Wikilinks]])
session_health_check Brain integrity scan + auto-repair (fsck)
deep_storage_purge Reclaim ~90% vector storage (v5.1)
Behavioral Memory & Knowledge Graph (5 tools)
Tool Purpose
session_save_experience Record corrections, successes, failures, learnings
knowledge_upvote Increase entry importance (+1)
knowledge_downvote Decrease entry importance (-1)
knowledge_sync_rules Sync graduated insights to .cursorrules / .clauderules
session_save_image / session_view_image Visual memory vault
Time Travel & History (2 tools)
Tool Purpose
memory_history Browse all historical versions of a project's handoff state
memory_checkout Revert to any previous version (non-destructive)
Search & Analysis (7 tools)
Tool Purpose
brave_web_search Real-time internet search
brave_local_search Location-based POI discovery
brave_web_search_code_mode JS extraction over web search results
brave_local_search_code_mode JS extraction over local search results
code_mode_transform Universal post-processing with 8 built-in templates
gemini_research_paper_analysis Academic paper analysis via Gemini
brave_answers AI-grounded answers from Brave
Multi-Agent Hivemind (3 tools)

Requires PRISM_ENABLE_HIVEMIND=true.

Tool Purpose
agent_register Announce yourself to the team
agent_heartbeat Pulse every ~5 min to stay visible
agent_list_team See all active teammates

Environment Variables

Full variable reference
Variable Required Description
BRAVE_API_KEY No Brave Search Pro API key
FIRECRAWL_API_KEY No Firecrawl API key โ€” required for Web Scholar
PRISM_STORAGE No "local" (default) or "supabase" โ€” restart required
PRISM_ENABLE_HIVEMIND No "true" to enable multi-agent tools โ€” restart required
PRISM_INSTANCE No Instance name for multi-server PID isolation
GOOGLE_API_KEY No Gemini โ€” enables semantic search, Briefings, compaction
BRAVE_ANSWERS_API_KEY No Separate Brave Answers key
SUPABASE_URL If cloud Supabase project URL
SUPABASE_KEY If cloud Supabase anon/service key
PRISM_USER_ID No Multi-tenant user isolation (default: "default")
PRISM_AUTO_CAPTURE No "true" to auto-snapshot dev servers
PRISM_CAPTURE_PORTS No Comma-separated ports (default: 3000,3001,5173,8080)
PRISM_DEBUG_LOGGING No "true" for verbose logs
PRISM_DASHBOARD_PORT No Dashboard port (default: 3000)
PRISM_SCHEDULER_ENABLED No "false" to disable background maintenance (default: enabled)
PRISM_SCHEDULER_INTERVAL_MS No Maintenance interval in ms (default: 43200000 = 12h)
PRISM_SCHOLAR_ENABLED No "true" to enable Web Scholar pipeline
PRISM_SCHOLAR_INTERVAL_MS No Scholar interval in ms (default: 0 = manual only)
PRISM_SCHOLAR_TOPICS No Comma-separated research topics (default: "ai,agents")
PRISM_SCHOLAR_MAX_ARTICLES_PER_RUN No Max articles per Scholar run (default: 3)

Architecture

Prism is a stdio-based MCP server that manages persistent agent memory. Here's how the pieces fit together:

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚  MCP Client (Claude Desktop / Cursor / Antigravity)      โ”‚
โ”‚                    โ†• stdio (JSON-RPC)                    โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค
โ”‚  Prism MCP Server                                        โ”‚
โ”‚                                                          โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  30+ Tools   โ”‚  โ”‚  Lifecycle   โ”‚  โ”‚   Dashboard    โ”‚  โ”‚
โ”‚  โ”‚  (handlers)  โ”‚  โ”‚  (PID lock,  โ”‚  โ”‚  (HTTP :3000)  โ”‚  โ”‚
โ”‚  โ”‚              โ”‚  โ”‚   shutdown)  โ”‚  โ”‚                โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚         โ†•                                                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  Storage Engine                                    โ”‚  โ”‚
โ”‚  โ”‚  Local: SQLite + FTS5 + TurboQuant vectors         โ”‚  โ”‚
โ”‚  โ”‚  Cloud: Supabase + pgvector                        โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ”‚         โ†•                                                โ”‚
โ”‚  โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”  โ”‚
โ”‚  โ”‚  Background Workers                                โ”‚  โ”‚
โ”‚  โ”‚  โ€ข Scheduler (TTL, decay, compaction, purge)       โ”‚  โ”‚
โ”‚  โ”‚  โ€ข Web Scholar (Brave โ†’ Firecrawl โ†’ LLM โ†’ Ledger)  โ”‚  โ”‚
โ”‚  โ”‚  โ€ข Hivemind heartbeats & Telepathy broadcasts      โ”‚  โ”‚
โ”‚  โ”‚  โ€ข OpenTelemetry span export                       โ”‚  โ”‚
โ”‚  โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

Startup Sequence

  1. Acquire PID lock โ€” prevents duplicate instances per PRISM_INSTANCE
  2. Initialize config โ€” SQLite settings cache (prism-config.db)
  3. Register 30+ MCP tools โ€” session, knowledge, search, behavioral, hivemind
  4. Connect stdio transport โ€” MCP handshake with the client (~60ms total)
  5. Async post-connect โ€” storage warmup, dashboard launch, scheduler start (non-blocking)

Storage Layers

Layer Technology Purpose
Session Ledger SQLite (append-only) Immutable audit trail of all agent work
Handoff State SQLite (upsert, versioned) Live project context with OCC + CRDT merging
Keyword Search FTS5 virtual tables Zero-dependency full-text search
Semantic Search TurboQuant compressed vectors 10ร— compressed 768-dim embeddings, three-tier retrieval
Cloud Sync Supabase + pgvector Optional multi-device/team sync

Auto-Load Architecture

Each MCP client has its own mechanism for ensuring Prism context loads on session start. See the platform-specific Setup Guides above for detailed instructions:

  • Claude Code โ€” Lifecycle hooks (SessionStart / Stop)
  • Gemini / Antigravity โ€” Three-layer architecture (User Rules + AGENTS.md + Startup Skill)
  • Cursor / Windsurf / VS Code โ€” System prompt instructions

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.


๐Ÿงฌ Scientific Foundation

Prism is evolving from smart session logging toward a cognitive memory architecture โ€” grounded in real research, not marketing.

Phase Feature Inspired By Status
v5.0 TurboQuant 10ร— Compression โ€” 4-bit quantized 768-dim vectors in <500 bytes Vector quantization (product/residual PQ) โœ… Shipped
v5.0 Three-Tier Search โ€” native โ†’ TurboQuant โ†’ FTS5 keyword fallback Cascaded retrieval architectures โœ… Shipped
v5.2 Smart Consolidation โ€” extract principles, not just summaries Neuroscience sleep consolidation โœ… Shipped
v5.2 Ebbinghaus Importance Decay โ€” memories fade unless reinforced Ebbinghaus forgetting curve โœ… Shipped
v5.2 Context-Weighted Retrieval โ€” current work biases what surfaces Contextual memory in cognitive science โœ… Shipped
v5.4 CRDT Handoff Merging โ€” conflict-free multi-agent state via OR-Map engine CRDTs (Shapiro et al., 2011) โœ… Shipped
v5.4 Autonomous Web Scholar โ€” background research pipeline with LLM synthesis Autonomous research agents โœ… Shipped
v5.5 SDM Decoder Foundation โ€” pre-allocated typed-array hot loop, zero GC thrash Kanerva's Sparse Distributed Memory (1988) โœ… Shipped
v5.5 Architectural Hardening โ€” transactional migrations, graceful shutdown, thundering herd prevention Production reliability engineering โœ… Shipped
v5.6 Full Superposed Memory (SDM) โ€” O(1) key-value retrieval via Hamming correlation Kanerva's SDM ๐Ÿ”ฌ In Progress
v5.6 Intuitive Recall โ€” proactive surface of relevant past decisions without explicit search Predictive memory (cognitive science) ๐Ÿ”ฌ In Progress
v6.1 Prism-Port Vault Export โ€” Obsidian/Logseq .zip with YAML frontmatter & [[Wikilinks]] Data sovereignty, PKM interop โœ… Shipped
v6.1 Cognitive Load & Semantic Search โ€” dynamic graph thinning, search highlights Contextual working memory โœ… Shipped
v6.2 Synthesize & Prune โ€” automated edge synthesis and visual decay Implicit associative memory ๐Ÿ”ฌ In Progress
v7.x Affect-Tagged Memory โ€” sentiment shapes what gets recalled Affect-modulated retrieval (neuroscience) ๐Ÿ”ญ Horizon
v8+ Zero-Search Retrieval โ€” no index, no ANN, just ask the vector Holographic Reduced Representations ๐Ÿ”ญ Horizon

Informed by LeCun's "Why AI Systems Don't Learn" (Dupoux, LeCun, Malik) and Kanerva's SDM.


๐Ÿ“ฆ Product Roadmap

Full ROADMAP.md โ†’

v6.2: The "Synthesize & Prune" Phase

The v6.1 update shipped Prism-Port (Obsidian vault export) and enhanced Knowledge Gardening. 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.

  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.
  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.
  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.

Limitations

  • 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).
  • 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 and a server-side fallback (v5.2.1) that auto-pushes context after 10 seconds.
  • 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.
  • No real-time sync without Supabase. Local SQLite mode is single-machine only. Multi-device or team sync requires a Supabase backend.
  • 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.
  • 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.
  • 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.
  • 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 new vault format for Obsidian/Logseq-compatible .zip archives.
  • 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.

License

MIT


Keywords: MCP server, Model Context Protocol, Claude Desktop memory, persistent session memory, AI agent memory, local-first, SQLite MCP, Mind Palace, time travel, visual memory, VLM image captioning, OpenTelemetry, GDPR, agent telepathy, multi-agent sync, behavioral memory, cursorrules, Ollama MCP, Brave Search MCP, TurboQuant, progressive context loading, knowledge management, LangChain retriever, LangGraph agent

Yorumlar (0)

Sonuc bulunamadi