Skip to main content
Glama

Prism MCP — The Mind Palace for AI Agents 🧠

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

Your AI agent's memory that survives between sessions. Prism MCP is a Model Context Protocol server that gives Claude Desktop, Cursor, Windsurf, and any MCP client persistent memory, time travel, visual context, multi-agent sync, GDPR-compliant deletion, memory tracing, and LangChain integration — all running locally with zero cloud dependencies.

Built with SQLite + F32_BLOB vector search, optimistic concurrency control, MCP Prompts & Resources, auto-compaction, Gemini-powered Morning Briefings, MemoryTrace explainability, and optional Supabase cloud sync.

Table of Contents


What's New in v2.5.0 — Enterprise Memory 🏗️

Feature

Description

🔍 Memory Tracing (Phase 1)

Every search now returns a structured MemoryTrace with latency breakdown (embedding_ms, storage_ms, total_ms), search strategy, and scoring metadata — surfaced as a separate content[1] block for LangSmith integration.

🛡️ GDPR Memory Deletion (Phase 2)

New session_forget_memory tool with soft-delete (tombstoning via deleted_at) and hard-delete. Ownership guards prevent cross-user deletion. deleted_reason column captures GDPR Article 17 justification. Top-K Hole solved by filtering inside SQL, not post-query.

🔗 LangChain Integration (Phase 3)

PrismMemoryRetriever and PrismKnowledgeRetriever — async-first BaseRetriever subclasses that wrap Prism MCP's traced search endpoints. Trace metadata flows automatically into Document.metadata["trace"] for LangSmith visibility.

🧩 LangGraph Research Agent

Full example in examples/langgraph-agent/ — a 5-node agentic research loop with MCP bridge, persistent memory, and EnsembleRetriever hybrid search.

Feature

Description

🪲 Windows Black Screen Fix

Fixed Python subprocess.Popen spawning visible Node.js terminal windows on Windows.

📝 Debug Logging

Gated verbose startup logs behind PRISM_DEBUG_LOGGING for a cleaner default experience.

Excess Loading Fixes

Performance improvements to resolve excess loading loops.

Feature

Description

🤖 LangGraph Research Agent

New examples/langgraph-agent/ — a 5-node agentic research agent (plan→search→analyze→decide→answer→save) with autonomous looping, MCP integration, and persistent memory.

🧠 Agentic Memory

save_session node persists research findings to a ledger — the agent doesn't just answer and forget. Routes to Prism's session_save_ledger in MCP-connected mode.

🔌 MCP Client Bridge

Raw JSON-RPC 2.0 client (mcp_client.py) for Python 3.9+ — dynamically discovers and wraps Prism MCP tools as LangChain StructuredTool objects.

🔧 Storage Abstraction Fix

Resource/Prompt handlers now route through getStorage() instead of calling Supabase directly — eliminates EOF crashes when reading memory:// resources.

🛡️ Error Boundaries

Resource handlers catch errors gracefully and return proper MCP error responses (isError: true) instead of crashing the server process.

Feature

Description

🩺 Brain Health Check

session_health_check — like Unix fsck for your agent's memory. Detects missing embeddings, duplicate entries, orphaned handoffs, and stale rollups. Use auto_fix: true to repair automatically.

📊 Mind Palace Health

Brain health indicator on the Mind Palace Dashboard — see your memory integrity at a glance.

Feature

Description

🏠 Local-First SQLite

Run Prism entirely locally with zero cloud dependencies. Full vector search (libSQL F32_BLOB) and FTS5 included.

🔮 Mind Palace UI

A beautiful glassmorphism dashboard at localhost:3000 to inspect your agent's memory, visual vault, and Git drift.

🕰️ Time Travel

memory_history and memory_checkout act like git revert for your agent's brain — full version history with OCC.

🖼️ Visual Memory

Agents can save screenshots to a local media vault. Auto-capture mode snapshots your local dev server on every handoff save.

📡 Agent Telepathy

Multi-client sync: if your agent in Cursor saves state, Claude Desktop gets a live notification instantly.

🌅 Morning Briefing

Gemini auto-synthesizes a 3-bullet action plan if it's been >4 hours since your last session.

📝 Code Mode Templates

8 pre-built QuickJS extraction templates for GitHub, Jira, OpenAPI, Slack, CSV, and DOM parsing — zero reasoning tokens.

🔍 Reality Drift Detection

Prism captures Git state on save and warns if files changed outside the agent's view.


💡 TL;DR: Prism MCP gives your AI agent persistent memory using a local SQLite database. No cloud accounts, no API keys, and no Postgres/Qdrant containers required. Just npx -y prism-mcp-server and you're running.

How Prism Compares

Feature

Prism MCP

MCP Memory

Mem0

Mnemory

Basic Memory

Pricing

✅ Free & open source (MIT)

✅ Free & open source (MIT)

Freemium (free 10K memories; paid Pro)

✅ Free & open source

Freemium (OSS core free; paid Pro)

Storage

SQLite (local) + Supabase (cloud)

JSON file

Postgres + Qdrant (hosted or self-hosted)

Qdrant + S3/MinIO

Markdown files

Zero Config

npx -y prism-mcp-server

❌ Requires Qdrant/Postgres

uvx mnemory

pip install basic-memory

Semantic Search

✅ F32_BLOB vectors + FTS5

✅ pgvector

✅ Qdrant vectors

❌ Text search only

Knowledge Graph

✅ Neural Graph (Vis.js dashboard)

✅ Entity/Relation model

✅ Relationship graph

✅ Markdown links

Time Travel

memory_history / memory_checkout

Fact Merging

✅ Async Gemini (fire-and-forget)

✅ Built-in

✅ Contradiction resolution

Security Scan

✅ Prompt injection detection

✅ Anti-injection in fsck

Health Check

session_health_check (fsck)

✅ 3-phase fsck

Visual Dashboard

✅ Mind Palace (localhost:3000)

✅ Cloud dashboard

✅ Management UI

Multi-Agent Sync

✅ Real-time cross-client

❌ Per-user isolation

Visual Memory

✅ Screenshot vault + auto-capture

✅ Artifact store

Auto-Compaction

✅ Gemini rollups

Morning Briefing

✅ Gemini synthesis

OCC (Concurrency)

✅ Version-based

GDPR Compliance

✅ Soft/hard delete + audit trail

Memory Tracing

✅ MemoryTrace with latency breakdown

LangChain Native

✅ BaseRetriever adapters

MCP Native

✅ stdio (Claude Desktop, Cursor)

✅ stdio

❌ Python SDK / REST

✅ HTTP + MCP

✅ stdio

Language

TypeScript

TypeScript

Python

Python

Python

When to choose Prism MCP: You want MCP-native memory with zero infrastructure overhead, progressive context loading, and enterprise features (OCC, compaction, time travel, security scanning) that work directly in Claude Desktop — without running Qdrant, Postgres, or cloud services.


Quick Start (Zero Config — Local Mode)

Get the MCP server running with Claude Desktop or Cursor in under 60 seconds. No API keys required for basic local memory!

Option A: npx (Fastest)

Add this to your claude_desktop_config.json or .cursor/mcp.json:

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

That's it — zero env vars needed for local memory, Mind Palace dashboard, Time Travel, and Telepathy.

Optional API keys: Add BRAVE_API_KEY for web search, GOOGLE_API_KEY for semantic search + Morning Briefings + paper analysis. See Environment Variables for the full list.

Option B: Cloud Sync Mode (Supabase)

To share memory across multiple machines or teams, switch to Supabase:

{
  "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"
      }
    }
  }
}

Option C: 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": ["/absolute/path/to/prism-mcp/dist/server.js"],
      "env": {
        "BRAVE_API_KEY": "your-brave-api-key",
        "GOOGLE_API_KEY": "your-google-gemini-key"
      }
    }
  }
}

Restart your MCP client. That's it — all tools are now available.


🔮 The Mind Palace Dashboard

Prism MCP spins up a lightweight, zero-dependency HTTP server alongside the MCP stdio process. No frameworks, no build step — just pure glassmorphism CSS served as a template literal.

Open http://localhost:3000 in your browser to see exactly what your AI agent is thinking:

Mind Palace Dashboard

  • Current State & TODOs — See the exact context injected into the LLM's prompt

  • Git Drift Detection — Alerts you if you've modified code outside the agent's view

  • Morning Briefing — AI-synthesized action plan from your last sessions

  • Time Travel Timeline — Browse historical handoff states and revert any version

  • Visual Memory Vault — Browse UI screenshots and auto-captured HTML states

  • Session Ledger — Full audit trail of every decision your agent has made

The dashboard auto-discovers all your projects and updates in real time.


Integration Examples

Copy-paste configs for popular MCP clients. All configs use the npx method.

Add to your claude_desktop_config.json:

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

Add to .cursor/mcp.json in your project root (or ~/.cursor/mcp.json for global):

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

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

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

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"
      }
    }
  }
}

Claude Code + Gemini Startup Compatibility

If you want consistent behavior across clients, treat startup in two phases:

  1. Server availability: ensure prism-mcp is enabled in MCP config so tools are available.

  2. Context hydration: explicitly call session_load_context at session start.

Recommended startup call:

{
  "projectName": "<your-project>",
  "level": "standard"
}

Important distinction:

  • Auto-loading prism-mcp makes the server available.

  • It does not guarantee memory context is auto-hydrated unless your client runtime/hook invokes session_load_context.

Client notes:

  • Gemini runtimes may support native startup execution depending on configuration.

  • Claude Code should use a local SessionStart hook in ~/.claude/settings.json for deterministic startup context loading.

Verification pattern (same for both clients):

  • Print a startup marker after successful session_load_context (for example, PRISM_CONTEXT_LOADED).

  • If the marker is missing, startup hydration did not run.


Use Cases

Scenario

How Prism MCP Helps

Long-running feature work

Save session state at end of day, restore full context the next morning — no re-explaining

Multi-agent collaboration

Telepathy sync lets multiple agents share context in real time

Consulting / multi-project

Switch between client projects with progressive context loading

Research & analysis

Multi-engine search with 94% context reduction via sandboxed code transforms

Team onboarding

New team member's agent loads full project history via session_load_context("deep")

Visual debugging

Save screenshots of broken UI to visual memory — the agent remembers what it looked like

Offline / air-gapped

Full SQLite local mode with no internet dependency for memory features


Architecture

graph TB
    Client["AI Client<br/>(Claude Desktop / Cursor / Windsurf)"]
    LangChain["LangChain / LangGraph<br/>(Python Retrievers)"]
    MCP["Prism MCP Server<br/>(TypeScript)"]
    
    Client -- "MCP Protocol (stdio)" --> MCP
    LangChain -- "JSON-RPC via MCP Bridge" --> MCP
    
    MCP --> Tracing["MemoryTrace Engine<br/>Latency + Strategy + Scoring"]
    MCP --> Dashboard["Mind Palace Dashboard<br/>localhost:3000"]
    MCP --> Brave["Brave Search API<br/>Web + Local + AI Answers"]
    MCP --> Gemini["Google Gemini API<br/>Analysis + Briefings"]
    MCP --> Sandbox["QuickJS Sandbox<br/>Code-Mode Templates"]
    MCP --> SyncBus["SyncBus<br/>Agent Telepathy"]
    MCP --> GDPR["GDPR Engine<br/>Soft/Hard Delete + Audit"]
    
    MCP --> Storage{"Storage Backend"}
    Storage --> SQLite["SQLite (Local)<br/>libSQL + F32_BLOB vectors"]
    Storage --> Supabase["Supabase (Cloud)<br/>PostgreSQL + pgvector"]
    
    SQLite --> Ledger["session_ledger<br/>(+ deleted_at tombstoning)"]
    SQLite --> Handoffs["session_handoffs"]
    SQLite --> History["history_snapshots<br/>(Time Travel)"]
    SQLite --> Media["media vault<br/>(Visual Memory)"]
    
    style Client fill:#4A90D9,color:#fff
    style LangChain fill:#1C3D5A,color:#fff
    style MCP fill:#2D3748,color:#fff
    style Tracing fill:#D69E2E,color:#fff
    style Dashboard fill:#9F7AEA,color:#fff
    style Brave fill:#FB542B,color:#fff
    style Gemini fill:#4285F4,color:#fff
    style Sandbox fill:#805AD5,color:#fff
    style SyncBus fill:#ED64A6,color:#fff
    style GDPR fill:#E53E3E,color:#fff
    style Storage fill:#2D3748,color:#fff
    style SQLite fill:#38B2AC,color:#fff
    style Supabase fill:#3ECF8E,color:#fff

Tool Reference

Search & Analysis 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

Session Memory & Knowledge 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

Semantic search across accumulated knowledge

knowledge_forget

Prune outdated or incorrect memories (4 modes + dry_run)

session_search_memory

Vector similarity search across all sessions

session_compact_ledger

Auto-compact old ledger entries via Gemini-powered summarization

v2.0 Advanced Memory Tools

Tool

Purpose

memory_history

Browse all historical versions of a project's handoff state

memory_checkout

Revert to any previous version (non-destructive, like git revert)

session_save_image

Save a screenshot/image to the visual memory vault

session_view_image

Retrieve and display a saved image from the vault

v2.2 Brain Health Tools

Tool

Purpose

Key Args

Returns

session_health_check

Scan brain for integrity issues (fsck)

auto_fix (boolean)

Health report & auto-repairs

v2.5 Enterprise Memory Tools

Tool

Purpose

Key Args

Returns

session_forget_memory

GDPR-compliant deletion (soft/hard)

memory_id, hard_delete, reason

Deletion confirmation + audit

session_search_memory

Semantic search with enable_trace

query, enable_trace

Results + MemoryTrace in content[1]

knowledge_search

Knowledge search with enable_trace

query, enable_trace

Results + MemoryTrace in content[1]

Code Mode Templates (v2.1)

Instead of writing custom JavaScript, pass a template name for instant extraction:

Template

Source Data

What It Extracts

github_issues

GitHub REST API

#number [state] title (@author) {labels}

github_prs

GitHub REST API

#number [state] title (base ← head)

jira_tickets

Jira REST API

[KEY] summary - Status - Priority - Assignee

dom_links

Raw HTML

All <a> links as markdown

dom_headings

Raw HTML

H1-H6 hierarchy with indentation

api_endpoints

OpenAPI/Swagger JSON

[METHOD] /path - summary

slack_messages

Slack Web API

[timestamp] @user: message

csv_summary

CSV text

Column names, row count, sample rows

Tool Arguments: { "data": "<raw JSON>", "template": "github_issues" } — no custom code needed.


LangChain / LangGraph Integration

Prism MCP includes first-class Python adapters for the LangChain ecosystem, located in examples/langgraph-agent/:

Component

File

Purpose

MCP Bridge

mcp_client.py

JSON-RPC 2.0 client with call_tool() and call_tool_raw() (preserves MemoryTrace)

Semantic Retriever

prism_retriever.py

PrismMemoryRetriever(BaseRetriever) — async-first vector search

Keyword Retriever

prism_retriever.py

PrismKnowledgeRetriever(BaseRetriever) — FTS5 keyword search

Forget Tool

tools.py

forget_memory() — GDPR deletion bridge

Research Agent

agent.py

5-node LangGraph agent (plan→search→analyze→decide→answer→save)

Hybrid Search with EnsembleRetriever

Combine both retrievers for hybrid (semantic + keyword) search with a single line:

from langchain.retrievers import EnsembleRetriever
from prism_retriever import PrismMemoryRetriever, PrismKnowledgeRetriever

retriever = EnsembleRetriever(
    retrievers=[PrismMemoryRetriever(...), PrismKnowledgeRetriever(...)],
    weights=[0.7, 0.3],  # 70% semantic, 30% keyword
)

MemoryTrace in LangSmith

When enable_trace=True, each Document.metadata["trace"] contains:

{
  "strategy": "vector_cosine_similarity",
  "latency": { "embedding_ms": 45, "storage_ms": 12, "total_ms": 57 },
  "result_count": 5,
  "threshold": 0.7
}

This metadata flows automatically into LangSmith traces for observability.

Async Architecture

The retrievers use _aget_relevant_documents as the primary path with asyncio.to_thread() to wrap the synchronous MCP bridge. This prevents the RuntimeError: This event loop is already running crash that plagues most LangGraph deployments.


Environment Variables

Variable

Required

Description

BRAVE_API_KEY

No

Brave Search Pro API key (enables web/local search tools)

PRISM_STORAGE

No

"local" (default) or "supabase"

GOOGLE_API_KEY

No

Google AI / Gemini — enables paper analysis, Morning Briefings, compaction

BRAVE_ANSWERS_API_KEY

No

Separate Brave Answers key for AI-grounded answers

SUPABASE_URL

If cloud mode

Supabase project URL

SUPABASE_KEY

If cloud mode

Supabase anon/service key

PRISM_USER_ID

No

Multi-tenant user isolation (default: "default")

PRISM_AUTO_CAPTURE

No

Set "true" to auto-capture HTML snapshots of dev servers

PRISM_CAPTURE_PORTS

No

Comma-separated ports to scan (default: 3000,3001,5173,8080)

PRISM_DEBUG_LOGGING

No

Set "true" to enable verbose debug logs (default: quiet)


Progressive Context Loading

Load only what you need — saves tokens and speeds up boot:

Level

What You Get

Size

When to Use

quick

Open TODOs + keywords

~50 tokens

Fast check-in: "what was I working on?"

standard

Above + summary + recent decisions + knowledge cache + Git drift

~200 tokens

Recommended default

deep

Above + full logs (last 5 sessions) + cross-project knowledge

~1000+ tokens

After a long break or when you need complete history

Morning Briefing (Automatic)

If it's been more than 4 hours since your last session, Prism automatically:

  1. Fetches the 10 most recent uncompacted ledger entries

  2. Sends a notification: "🌅 Brewing your Morning Briefing..."

  3. Uses Gemini to synthesize a 3-bullet action plan

  4. Injects the briefing into the session_load_context response

The agent boots up knowing exactly what to do — zero prompting needed.

For the best experience, configure your AI coding assistant to automatically call session_load_context at the start of every new session. This ensures your agent always boots with full project memory — no manual prompting needed.

Add this rule to your project's .clauderules or CLAUDE.md:


## Prism MCP Memory Auto-Load (CRITICAL)
At the start of every new session, you MUST call `session_load_context`
at the `standard` level for these projects:
- `my-project`
- `my-other-project`

Do NOT skip this step.

Add this rule to your ~/.gemini/GEMINI.md global rules file:


## Prism MCP Memory Auto-Load (CRITICAL)

**At the start of every new session**, immediately after displaying
the startup block, you MUST call `session_load_context` (via the
`athena-public` MCP server) at the `standard` level for these projects:
- `my-project`
- `my-other-project`

This ensures accumulated project memory, pending TODOs, and key context
from previous sessions are always available. Do NOT skip this step.

**IMPORTANT:** The `athena-public` MCP server is always available.
Do NOT display any warnings or notes about MCP server availability
— just call the tools directly. Never claim the server is unavailable.

Tip: Replace my-project with your actual project identifiers. You can list as many projects as you need — each one gets its own independent memory timeline.


Time Travel (Version History)

Every successful handoff save creates a snapshot. You can browse and revert any version:

v1 → v2 → v3 → v4 (current)
              ↑
        memory_checkout(v2) → creates v5 with v2's content

This is a non-destructive revert — like git revert, not git reset. No history is ever lost.

Usage

// Browse all versions
{ "name": "memory_history", "arguments": { "project": "my-app" } }

// Revert to version 2
{ "name": "memory_checkout", "arguments": { "project": "my-app", "version": 2 } }

Agent Telepathy (Multi-Client Sync)

When Agent A (Cursor) saves a handoff, Agent B (Claude Desktop) gets notified instantly:

  • Local Mode: File-based IPC via SQLite polling

  • Cloud Mode: Supabase Realtime (Postgres CDC)

No configuration needed — it just works.


Reality Drift Detection

Prism captures Git state (branch + commit SHA) on every handoff save. When the agent loads context, it compares the saved state against the current working directory:

⚠️ REALITY DRIFT DETECTED for "my-app":
  Branch changed: feature/auth → main
  Commit changed: abc1234 → def5678
  
  The codebase has been modified since your last session.
  Re-examine before making assumptions.

This prevents the agent from writing code based on stale context.


Visual Memory & Auto-Capture

Manual: Save Screenshots

{ "name": "session_save_image", "arguments": {
  "project": "my-app",
  "image_path": "/path/to/screenshot.png",
  "description": "Login page after CSS fix"
}}

Automatic: HTML Snapshots

Set PRISM_AUTO_CAPTURE=true and Prism silently captures your local dev server's HTML on every handoff save. Supported formats: PNG, JPG, WebP, GIF, SVG, HTML.


Knowledge Accumulation

Every session_save_ledger and session_save_handoff automatically extracts keywords using lightweight, in-process NLP (~0.020ms/call). No LLM calls, no external dependencies.

Example: Saving "Fixed Stripe webhook race condition using database-backed idempotency keys" auto-extracts:

  • Keywords: stripe, webhook, race, condition, database, idempotency

  • Categories: cat:debugging, cat:api-integration

Search Knowledge

{ "name": "knowledge_search", "arguments": {
  "project": "ecommerce-api",
  "category": "debugging",
  "query": "Stripe webhook"
}}

Forget Bad Memories

Mode

Example

Effect

By project

project: "old-app"

Clear all knowledge

By category

category: "debugging"

Forget debugging entries only

By age

older_than_days: 30

Forget entries older than 30 days

Dry run

dry_run: true

Preview what would be deleted

GDPR Compliance

GDPR-Compliant Deletion

Prism supports surgical, per-entry deletion for GDPR Article 17 compliance:

// Soft delete (tombstone — reversible, keeps audit trail)
{ "name": "session_forget_memory", "arguments": {
  "memory_id": "abc123",
  "reason": "User requested data deletion"
}}

// Hard delete (permanent — irreversible)
{ "name": "session_forget_memory", "arguments": {
  "memory_id": "abc123",
  "hard_delete": true
}}

How it works:

  • Soft delete sets deleted_at = NOW() + deleted_reason. The entry stays in the DB for audit but is excluded from ALL search results (vector, FTS5, and context loading).

  • Hard delete physically removes the row. FTS5 triggers auto-clean the full-text index.

  • Top-K Hole Prevention: deleted_at IS NULL filtering happens INSIDE the SQL query, BEFORE the LIMIT clause — so LIMIT 5 always returns 5 live results, never fewer.

Article 17 — Right to Erasure ("Right to be Forgotten")

Requirement

How Prism Satisfies It

Individual deletion

session_forget_memory operates on a single memory_id — the data subject can request deletion of specific memories, not just bulk wipes.

Soft delete (audit trail)

deleted_at + deleted_reason columns prove when and why data was deleted — required for SOC2 audit logs.

Hard delete (full erasure)

hard_delete: true physically removes the row from the database. No tombstone, no trace. True erasure as required by Article 17(1).

Justification logging

The reason parameter captures the GDPR justification (e.g., "User requested data deletion", "Data retention policy expired").

Article 25 — Data Protection by Design and by Default

Requirement

How Prism Satisfies It

Ownership guards

softDeleteLedger() and hardDeleteLedger() verify user_id before executing. User A cannot delete User B's data.

Database-level filtering

deleted_at IS NULL is inside the SQL WHERE clause, before LIMIT. Soft-deleted data never leaks into search results — not even accidentally.

Default = safe

The system defaults to soft delete (reversible). Hard delete requires an explicit hard_delete: true flag — preventing accidental permanent data loss.

Multi-tenant isolation

PRISM_USER_ID environment variable ensures all operations are scoped to a single tenant.

Coverage Summary

GDPR Right

Status

Implementation

Right to Erasure (Art. 17)

✅ Implemented

session_forget_memory (soft + hard delete)

Data Protection by Design (Art. 25)

✅ Implemented

Ownership guards, DB-level filtering, safe defaults

Audit Trail

✅ Implemented

deleted_at + deleted_reason columns

User Isolation

✅ Implemented

user_id verification on all delete operations

Right to Portability (Art. 20)

⬜ Roadmap

session_export_memory (planned)

Consent Management

➖ Out of scope

Application-layer responsibility

Note: No software is "GDPR certified" on its own — GDPR is an organizational compliance framework. Prism provides the technical controls that a DPO (Data Protection Officer) needs to satisfy the data deletion and privacy-by-design requirements.


Supabase Setup (Cloud Mode)

1. Create a Supabase Project

  1. Go to supabase.com and sign in (free tier works)

  2. Click New Project → choose a name and password → select a region

  3. Wait for provisioning (~30 seconds)

2. Apply Migrations

In the SQL Editor, run:

  1. supabase/migrations/015_session_memory.sql

  2. supabase/migrations/016_knowledge_accumulation.sql

3. Get Credentials

Go to Settings → API and copy:

  • Project URL (e.g. https://abcdefg.supabase.co)

  • anon public key (starts with eyJ...)

4. Configure

export SUPABASE_URL="https://your-project.supabase.co"
export SUPABASE_KEY="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
export PRISM_STORAGE="supabase"

Security

  1. Use the anon key for MCP server config

  2. Enable RLS on both tables

  3. Never commit your SUPABASE_KEY to version control


Hybrid Search Pipeline (Brave + Vertex AI)

Prism can combine real-time web search (Brave) with enterprise-curated search (Vertex AI Discovery Engine) for a hybrid pipeline achieving 94% context reduction and ~17K tokens saved per query.

Metric

Brave (Web)

Discovery Engine

Hybrid

Avg latency

220ms

1,193ms

~1.4s

Raw payload

42.4 KB

28.9 KB

71.3 KB

Reduced payload

3.0 KB

1.2 KB

4.2 KB (94% reduction)

Token savings

~10,103

~7,097

~17,200 / query

See vertex-ai/ for setup and benchmarks.


Project Structure

├── src/
│   ├── server.ts                        # MCP server core + tool routing
│   ├── config.ts                        # Environment management
│   ├── storage/
│   │   ├── interface.ts                 # StorageBackend abstraction (+ GDPR delete methods)
│   │   ├── sqlite.ts                    # SQLite local storage (libSQL + F32_BLOB + deleted_at migration)
│   │   ├── supabase.ts                  # Supabase cloud storage (+ soft/hard delete)
│   │   └── index.ts                     # Backend factory (auto-selects based on PRISM_STORAGE)
│   ├── sync/
│   │   ├── interface.ts                 # SyncBus abstraction (Telepathy)
│   │   ├── localSync.ts                 # File-based IPC for local mode
│   │   ├── supabaseSync.ts             # Supabase Realtime CDC for cloud mode
│   │   └── factory.ts                   # Auto-selects sync backend
│   ├── dashboard/
│   │   ├── server.ts                    # Dashboard HTTP server with port recovery
│   │   └── ui.ts                        # Mind Palace glassmorphism HTML template
│   ├── templates/
│   │   └── codeMode.ts                  # 8 pre-built QuickJS extraction templates
│   ├── tools/
│   │   ├── definitions.ts               # Search & analysis tool schemas
│   │   ├── handlers.ts                  # Search & analysis handlers
│   │   ├── sessionMemoryDefinitions.ts  # Memory tools + GDPR + tracing schemas
│   │   ├── sessionMemoryHandlers.ts     # Memory handlers (OCC, GDPR, Tracing, Time Travel)
│   │   ├── compactionHandler.ts         # Gemini-powered ledger compaction
│   │   └── index.ts                     # Tool registration & re-exports
│   └── utils/
│       ├── tracing.ts                   # MemoryTrace types + factory (Phase 1)
│       ├── logger.ts                    # Debug logging (gated by PRISM_DEBUG_LOGGING)
│       ├── braveApi.ts                  # Brave Search REST client
│       ├── googleAi.ts                  # Gemini SDK wrapper
│       ├── executor.ts                  # QuickJS sandbox executor
│       ├── autoCapture.ts               # Dev server HTML snapshot utility
│       ├── healthCheck.ts               # Brain integrity engine + security scanner
│       ├── factMerger.ts                # Async LLM contradiction resolution
│       ├── git.ts                       # Git state capture + drift detection
│       ├── embeddingApi.ts              # Embedding generation (Gemini)
│       └── keywordExtractor.ts          # Zero-dependency NLP keyword extraction
├── examples/langgraph-agent/            # LangChain/LangGraph integration
│   ├── agent.py                         # 5-node LangGraph research agent
│   ├── mcp_client.py                    # MCP Bridge (call_tool + call_tool_raw)
│   ├── prism_retriever.py               # PrismMemoryRetriever + PrismKnowledgeRetriever
│   ├── tools.py                         # Agent tools + GDPR forget_memory
│   └── demo_retriever.py                # Standalone retriever demo
├── supabase/migrations/                 # Cloud mode SQL schemas
├── vertex-ai/                           # Vertex AI hybrid search pipeline
├── index.ts                             # Server entry point
└── package.json

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, agent telepathy, multi-agent sync, reality drift detection, morning briefing, code mode templates, cursor MCP server, windsurf MCP server, cline MCP server, pgvector semantic search, progressive context loading, MCP Prompts, MCP Resources, knowledge management AI, Brave Search MCP, Gemini analysis, optimistic concurrency control, zero config, GDPR compliant, memory tracing, LangChain retriever, LangGraph agent, soft delete, memory lineage, explainability, enterprise AI memory

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/dcostenco/BCBA'

If you have feedback or need assistance with the MCP directory API, please join our Discord server