Prism Mcp

Prism Mcp

The Mind Palace for AI Agents — a Cognitive Architecture with Hebbian learning, ACT-R spreading activation, multi-hop causal reasoning, uncertainty-aware rejection gates, adversarial evaluation, Dark Factory pipelines, persistent memory & visual dashboard.

126 Stars
GitHub

🧠 Prism MCP — The Mind Palace for AI Agents

npm version MCP Registry Glama Smithery License: MIT TypeScript PRs Welcome

Prism Mind Palace Dashboard

Your AI agent forgets everything between sessions. Prism fixes that — then teaches it to think.

Prism v10 is a true Cognitive Architecture inspired by human brain mechanics. Beyond flat vector search, your agent now forms principles from experience, follows causal trains of thought, and possesses the self-awareness to know when it lacks information. Your agents don't just remember; they learn. With v10, the entire cognitive pipeline — including ledger compaction, task routing, and semantic search — runs 100% on-device via prism-coder:7b, a HIPAA-hardened local LLM that underwent 3 rounds of adversarial security review. No API keys. No cloud. No data leaves your machine.

npx -y prism-mcp-server

Works with Claude Desktop · Claude Code · Cursor · Windsurf · Cline · Gemini · Antigravityany MCP client.

https://github.com/dcostenco/prism-mcp/raw/main/docs/prism_mcp_demo.mp4

📖 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 — and then teaches it to reason. Save what matters at the end of each session. Load it back instantly on the next one. But Prism goes far beyond storage: it consolidates raw experience into lasting principles, traverses causal chains to surface root causes, and knows when to say "I don't know."

📌 Terminology: Throughout this doc, "Prism" refers to the MCP server and cognitive memory engine. "Mind Palace" refers to the visual dashboard UI at localhost:3000 — your window into the agent's brain. They work together; the dashboard is optional.

Prism has three pillars:

  1. 🧠 Cognitive Memory — Memories are ranked like a human brain: recently and frequently accessed context surfaces first, while stale context fades naturally via ACT-R activation decay. Raw experience consolidates into semantic principles through Hebbian learning. The result is retrieval quality that no flat vector search can match. (See Cognitive Architecture and Scientific Foundation.)

  2. 🔗 Multi-Hop Reasoning — When your agent searches for "Error X", Prism doesn't just find logs mentioning "Error X". Spreading activation traverses the causal graph and brings back "Workaround Y", which is connected to "Architecture Decision Z" — a literal train of thought. (See Cognitive Architecture.)

  3. 🏭 Autonomous Execution (Dark Factory) — When you're ready, Prism can run coding tasks end-to-end with a fail-closed pipeline where an adversarial evaluator catches bugs the generator missed — before you ever see the PR. (See Dark Factory.)


🚀 Quick Start

Prerequisites

  • Node.js v18+ (v20 LTS recommended; v23.x has known npx quirk)
  • Any MCP-compatible client (Claude Desktop, Cursor, Windsurf, Cline, etc.)
  • No API keys required for core features (see Capability Matrix)

Install

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

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

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

That's it. Restart your client. All tools are available. The Mind Palace Dashboard (the visual UI for your agent's brain) starts automatically at http://localhost:3000. You don't need to keep a tab open — the dashboard runs in the background and the MCP tools work with or without it.

🔮 Pro Tip: Once installed, open http://localhost:3000 in your browser to view the Mind Palace Dashboard — a beautiful, real-time UI of your agent's brain. Explore the Knowledge Graph, Intent Health gauges, and Session Ledger.

🔄 Updating Prism: npx -y caches the package locally. To force an update to the latest version, restart your MCP client — npx -y will fetch the newest release automatically. If you're stuck on a stale version, run npx clear-npx-cache (or npm cache clean --force) before restarting.

Port 3000 already in use? (Next.js / Vite / etc.)

Add PRISM_DASHBOARD_PORT to your MCP config env block:

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

Then open http://localhost:3001 instead.

Capability Matrix

FeatureLocal (Offline)Cloud (API Key)
Session memory & handoffs
Keyword search (FTS5)
Time travel & versioning
Mind Palace Dashboard
GDPR export (JSON/Markdown/Vault)
Semantic vector search✅ (embedding_provider=local)✅ (gemini, openai, or voyage)
Ledger compactionprism-coder:7b via Ollama✅ Text provider key
Task routing (LLM tiebreaker)prism-coder:7b via OllamaN/A (heuristic-only)
Morning Briefings✅ Text provider key
Web Scholar researchBRAVE_API_KEY + FIRECRAWL_API_KEY (or TAVILY_API_KEY)
VLM image captioning✅ Provider key
Autonomous Pipelines (Dark Factory)✅ Text provider key

🔑 The core Mind Palace works 100% offline with zero API keys — including semantic vector search with embedding_provider=local. Cloud keys unlock text generation features (Briefings, compaction, pipelines). See Environment Variables.

💰 API Cost Note: With embedding_provider=local, semantic search is fully free and offline. Cloud providers (GOOGLE_API_KEY for Gemini, VOYAGE_API_KEY, OPENAI_API_KEY) have generous free tiers. BRAVE_API_KEY offers 2,000 free searches/month. FIRECRAWL_API_KEY has a free plan with 500 credits. For typical solo development, expect $0/month on the free tiers.


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

CLI Alternative: If MCP tools aren't available or you're scripting around Claude Code:

# Load context before a session
prism load my-project --level deep

# Machine-readable JSON for parsing in scripts
prism load my-project --level deep --json
Gemini / Antigravity — Prompt Auto-Load

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

Antigravity doesn't expose MCP tools to the model. Use the prism load CLI as a fallback:

# From a shell or run_command tool
prism load my-project --level standard --json

# Or via the wrapper script
bash ~/.gemini/antigravity/scratch/prism_session_loader.sh my-project

The CLI uses the same storage layer as the MCP tool (SQLite or Supabase).

⚠️ CRITICAL (v9.2.2): Split-Brain Prevention If your MCP server is configured with PRISM_STORAGE=local but Supabase credentials are also set, the CLI may read from the wrong backend (Supabase) while the server writes to SQLite. This causes stale TODOs and divergent state. Always pass --storage local explicitly when using the CLI in a local-mode environment:

prism load my-project --storage local --json

The prism_session_loader.sh wrapper handles this automatically since v9.2.2.

Bash / CI/CD / Scripts

Use the prism load CLI to access session context from any shell environment:

# Quick check — human-readable
prism load my-project

# Parse JSON in scripts
CONTEXT=$(prism load my-project --level quick --json)
SUMMARY=$(echo "$CONTEXT" | jq -r '.handoff[0].last_summary')
VERSION=$(echo "$CONTEXT" | jq -r '.handoff[0].version')
echo "Project at v$VERSION: $SUMMARY"

# Explicit storage backend (v9.2.2 — prevents split-brain)
prism load my-project --storage local --json
prism load my-project --storage supabase --json

# Role-scoped loading
prism load my-project --role qa --json

# Use in CI/CD to verify context exists before deploying
if ! prism load my-project --level quick --json | jq -e '.handoff[0].version' > /dev/null 2>&1; then
  echo "No Prism context found — skipping context-aware deploy"
fi

📦 Install: npm install -g prism-mcp-server makes the prism CLI available globally. For local builds: node /path/to/prism/dist/cli.js load.

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-or-service-key"
      }
    }
  }
}

Schema Migrations

Prism auto-applies its schema on first connect — no manual step required. If you need to apply or re-apply migrations manually (e.g. for a fresh project or after a version bump), run the SQL files in supabase/migrations/ in numbered order via the Supabase SQL Editor or the CLI:

# Via CLI (requires supabase CLI + project linked)
supabase db push

# Or apply a single migration via the Supabase dashboard SQL Editor
# Paste the contents of supabase/migrations/0NN_*.sql and click Run

Key migrations:

  • 020_* — Core schema (ledger, handoff, FTS, TTL, CRDT)
  • 033_memory_links.sql — Associative Memory Graph (MemoryLinks) — required for session_backfill_links

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.

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"
      }
    }
  }
}
Cloud Deployment (Render)

Prism can be deployed natively to cloud platforms like Render so your agent's memory is always online and accessible across different machines or teams.

  1. Fork this repository.
  2. In the Render Dashboard, create a new Web Service pointing to your repository.
  3. In the setup wizard, select Docker as the Runtime.
  4. Set the Dockerfile path to Dockerfile.smithery.
  5. Connect your local MCP client to your new cloud endpoint using the sse transport:
{
  "mcpServers": {
    "prism-mcp-cloud": {
      "command": "npx",
      "args": ["-y", "supergateway", "--url", "https://your-prism-app.onrender.com/sse"]
    }
  }
}

Note: The Dockerfile.smithery uses an optimized multi-stage build that compiles Typescript safely in a development environment before booting the server in a stripped-down production image. No NPM publishing required!

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. API key warnings are informational only — core session memory and semantic search (with embedding_provider=local) work with zero keys. See Environment Variables for what each key unlocks.

💡 Do agents auto-load Prism? Agents using Cursor, Windsurf, or other MCP clients will see the session_load_context tool automatically, but may not call it unprompted. Add this to your project's .cursorrules (or equivalent system prompt) to guarantee auto-load:

At the start of every conversation, call session_load_context with project "my-project" before doing any work.

Claude Code users can use the .clauderules auto-load hook shown in the Setup Guides. Prism also has a server-side fallback (v5.2.1+) that auto-pushes context after 10 seconds if no load is detected.


📥 Universal Import: Bring Your History

Switching to Prism? Don't leave months of AI session history behind. Prism can ingest historical sessions from Claude Code, Gemini, and OpenAI and give your Mind Palace an instant head start — no manual re-entry required.

Import via the CLI or directly from the Mind Palace Dashboard (Import tab → file picker + 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 Import

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.

Why It's Safe to Re-Run

  • Memory-Safe Streaming: Processes massive log files line-by-line using stream-json to prevent Out-of-Memory (OOM) crashes.
  • Idempotent Dedup: Content-hash prevents duplicate imports on re-run (skipCount reported).
  • Chronological Integrity: Uses timestamp fallbacks and requestId sorting to preserve your memory timeline.
  • Smart Context Mapping: Extracts cwd, gitBranch, and tool usage patterns into searchable metadata.

✨ 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
  • Intent Health Gauges — per-project 0–100 health score with staleness decay, TODO load, and decision signals
  • Interactive Knowledge Graph — force-directed neural graph with click-to-filter, node renaming, and surgical keyword deletion
  • Deep Storage Manager — preview and execute vector purge operations with dry-run safety
  • 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

🛡️ ABA Precision Security Protocol

Inspired by Applied Behavior Analysis (ABA) structures in the Synalux platform, Prism incorporates rigorous behavioral safety constraints directly into the MCP connection layer. Advanced output sanitization (sanitizeMcpOutput) and behavior-guided guardrails eliminate prompt injection, constrain the generator, and enforce strict, hallucination-free outputs for clinical precision.

🧬 10× Memory Compression

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. To mitigate quantization degradation (where repeated compress/decompress cycles could smear subtle corrections after 10k+ memories), Prism leverages autonomous ledger compaction and Deep Storage cleanup to guarantee high-fidelity memory integrity over time.

📊 1M-Vector Benchmark (d=768, 4-bit)

Validated on 1,000,000 synthetic unit vectors at production dimension (d=768), run on Apple M4 Max (36GB):

MetricValue
Compression ratio7.7× (3,072 → 400 bytes)
Throughput833 vectors/sec
Peak heap329 MB
Total time57.6 minutes

Residual norm distribution — the quantization error after Householder rotation + Lloyd-Max scalar quantization:

StatisticValue
Mean0.1855
CV (coefficient of variation)0.038
P99/P50 ratio1.11
P99.9/P50 ratio1.16
Max/Min ratio1.46
IQR0.009

A CV of 0.038 means the residual norm barely varies across 1M vectors — there is effectively no long tail. The QJL correction term (which scales linearly with residualNorm) remains stable even for P99.9 outliers.

R@k retrieval accuracy (global corpus, 30 trials):

Corpus SizeR@1R@5
N=1,00020.0%60.0%
N=10,00036.7%76.7%
N=50,00053.3%90.0%

Note: R@k on random high-dimensional vectors is inherently harder than on real embeddings (all vectors are near-equidistant in d=768). Real-world retrieval with clustered embeddings produces higher accuracy. See tests/residual-distribution.test.ts and tests/benchmarks/residual-1m.ts for full methodology.

🐝 Multi-Agent Hivemind & Enterprise Sync

While local SQLite is amazing for solo developers, enterprise teams cannot share a local SQLite file. Prism breaks the "local-only" ceiling via Supabase Sync and the Multi-Agent Hivemind—scaling effortlessly to teams of 50+ developers using agents. Multiple agents (dev, QA, PM) can work on the same project with role-isolated memory, discover each other automatically, and share context in real-time via Telepathy sync to a shared Postgres backend. → Multi-agent setup example

🚦 Task Router

Prism scores coding tasks across 6 weighted heuristic signals (keyword analysis, file count, file-type complexity, scope, length, multi-step detection) and recommends whether to keep execution on the host cloud model or delegate to a local Claw agent (powered by deepseek-r1 / qwen2.5-coder via Ollama). File-type awareness routes config/docs edits locally while reserving systems-programming tasks for the host. The local agent features buffered streaming (handles split <think> tags), stateful multi-turn conversations, and automatic memory trimming. In client startup/skill flows, use defensive delegation: route only coding tasks, call session_task_route only when available, delegate to claw only when executor tooling exists and task is non-destructive, and fallback to host when router/executor is unavailable. → Task router real-life example

🧠 Local Prism Coder Engine (prism-coder:7b)

To achieve zero-latency, offline routing and memory compilation without cloud dependencies, Prism utilizes an internal fine-tuned ML model: prism-coder:7b. Built atop Qwen 2.5 Coder 7B using the MLX framework for Apple Silicon, this engine underwent aggressive Supervised Fine-Tuning (SFT) over 1,000+ past session traces and semantic architectures.

To guarantee zero-hallucination MCP tool use, it was further aligned using GRPO (Group Relative Policy Optimization) with a deterministic reward function that deducts points for missing required parameters or misnaming tools.

Benchmark Test Results (1000-iteration Phase 5 Model):

  • Tool-Call Accuracy: 33.3% (Pending GRPO loop over SFT)
  • JSON Validity: 100.0% (CoT properly mapping schemas)
  • Parameter Accuracy: 33.3%
  • Average Latency: 5.4s (Apple M4 Max, 36GB)
  • Generation Speed: 45.1 Tokens/sec

Integration: Run via Ollama natively to power autonomous file operations and session routing entirely within the local host environment.

🛡️ HIPAA-Grade Security Hardening (v10.0)

The prism-coder integration underwent 3 rounds of adversarial security review treating the reviewer as an attacker with HIPAA compliance, data exfiltration, and system stability as threat vectors. 22 findings identified and closed:

Defense LayerWhat It Prevents
PRISM_STRICT_LOCAL_MODESilent cloud fallback — when enabled, compaction throws instead of sending ePHI to Gemini/OpenRouter
redirect: "error"SSRF via 3xx redirects to AWS IMDS or internal services
URL credential redactionPasswords in user:pass@host URLs stripped from all log paths (startup + per-call)
Entry-boundary truncationPrompt injection via mid-tag XML truncation — payload split at \n\n boundaries, never mid-tag
Full XML escapingAll 5 XML entities (& < > " ') escaped on all user-controlled fields including id and session_date
<task> boundary tagsTask description XML-escaped and wrapped in delimiters to prevent routing manipulation
setTimeout capInteger overflow (>2³¹) that silently aborted every local LLM call
Graceful HIPAA errorstry/catch ensures strict mode returns MCP error response, not server crash

🔒 HIPAA deployment: Set PRISM_LOCAL_LLM_ENABLED=true + PRISM_STRICT_LOCAL_MODE=true. Session data will never leave the device — even if Ollama crashes.

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

🏭 Dark Factory — Adversarial Autonomous Pipelines

When you trigger a Dark Factory pipeline, Prism doesn't just run your task — it fights itself to produce high-quality output. A PLAN_CONTRACT step locks a machine-parseable rubric before any code is written. After execution, an Adversarial Evaluator (in a fully isolated context) scores the output against the rubric. It cannot pass the Generator without providing exact file and line evidence for every failing criterion. Failed evaluations inject the critique directly into the Generator's retry prompt so it's never flying blind. The result: security issues, regressions, and lazy debug logs caught autonomously — before you ever see the PR. → See it in action


🤖 Autonomous Cognitive OS (v9.0)

Memory isn't just about storing data; it's about economics and emotion. Prism v9.0 transforms passive memory into a living Cognitive Operating System that forces agents to learn compression and develop intuition.

Most AI agents have an infinite memory budget. They dump massive, repetitive logs into vector databases until they bankrupt your API budget and choke their own context windows. Prism v9.0 fixes this by introducing Token-Economic Reinforcement Learning and Affect-Tagged Memory.

💰 Memory-as-an-Economy (The Surprisal Gate)

Prism assigns every project a strict Cognitive Budget (e.g., 2,000 tokens) that persists across sessions. Every time the agent saves a memory, it costs tokens.

But not all memories are priced equally. Prism intercepts the save and runs a Vector-Based Surprisal calculation against recent memories:

  • High Surprisal (Novel thought): Costs 0.5× tokens. The agent is rewarded for new insights.
  • Low Surprisal (Boilerplate): Costs 2.0× tokens. The agent is penalized for repeating itself.
  • Universal Basic Income (UBI): The budget recovers passively over time (+100 tokens/hour).

If an agent is too verbose, it goes into Cognitive Debt. You don't need to prompt the agent to "be concise." The physics of the system force the LLM to learn data compression to avoid bankruptcy.

🎭 Affect-Tagged Memory (Giving AI a "Gut Feeling")

Vector math measures semantic similarity, not sentiment. If an agent searches for "Authentication Architecture," standard RAG will return two past approaches—it doesn't know that Approach A caused a 3-day production outage, while Approach B worked perfectly.

  • Affective Salience: Prism automatically tags experience events with a valence score (-1.0 for failure, +1.0 for success).
  • Emotional Retrieval: At retrieval time, the absolute magnitude (|valence|) significantly boosts the memory's ranking score. Extreme failures and extreme successes surface to the top.
  • UX Warnings: If an agent retrieves memories that are historically negative, Prism intercepts the prompt injection: ⚠️ Caution: This topic is strongly correlated with historical failures. Review past decisions before proceeding. Your AI now has a "gut feeling" about bad code.

The Paradigm Shift

FeatureStandard RAG / AgentsPrism v9.0
Storage LimitInfinite (bloats context)Bounded Token Economy
Data QualitySaves repetitive boilerplateSurprisal Gate penalizes redundancy
SentimentTreats all data as neutral factsAffect-Tagged (Warns agent of past trauma)
RecoveryManual deletionUniversal Basic Income (UBI) over time

🧠 Cognitive Architecture (v7.8)

Prism v7.8 is our biggest leap forward yet. We have moved beyond flat vector search and implemented a true Cognitive Architecture inspired by human brain mechanics. With the new ACT-R Spreading Activation Engine, Episodic-to-Semantic memory consolidation, and Uncertainty-Aware Rejection Gates, Prism doesn't just store logs anymore — it forms principles, follows causal trains of thought, and possesses the self-awareness to know when it lacks information.

Standard RAG (Retrieval-Augmented Generation) is now a commodity. Everyone has vector search. What turns a memory storage system into a memory reasoning system is the cognitive layer between storage and retrieval. Here is what Prism v7.8 builds on top of the vector foundation:

1. The Agent Actually Learns (Episodic → Semantic Consolidation)

Standard RAGPrism v7.8
MemoryGiant, flat transcript of past eventsDual-memory: Episodic events + Semantic rules
RecallRe-reads everything linearlyRetrieves distilled principles instantly
LearningNone — every session starts coldHebbian: confidence increases with repeated reinforcement

How it works: When Prism compacts session history, it doesn't just summarize text — it extracts principles. Raw event logs ("We deployed v2.3 and the auth service crashed because the JWT secret was rotated") consolidate into a semantic rule ("JWT secrets must be rotated before deployment, not during"). These rules live in a dedicated semantic_knowledge table with confidence scores that increase every time the pattern is observed. Your agent doesn't just remember what it did; it learns how the world works over time. This is true Hebbian learning: neurons that fire together wire together.

2. "Train of Thought" Reasoning (Spreading Activation & Causality)

Standard RAGPrism v7.8
SearchCosine similarity to the queryMulti-hop graph traversal with lateral inhibition
ScopeOnly finds things that look like the promptFollows causal chains across memories
Root causeMissed entirelySurfaced via caused_by / led_to edges

How it works: When compacting memories, Prism extracts causal links (caused_by, led_to) and persists them as edges in the knowledge graph. At retrieval time, ACT-R spreading activation propagates through these edges with a damped fan effect (1 / ln(fan + e)) to prevent hub-flooding, lateral inhibition to suppress noise, and configurable hop depth. If you search for "Error X", the engine traverses the graph and brings back "Workaround Y" → "Architecture Decision Z" — a literal train of thought instead of a static search result.

  Query: "Why does the API timeout?"
                    │
      ┌─────────────┼─────────────┐
      ▼             ▼             ▼
  [Memory: API     [Memory:      [Memory:
   timeout error]   DB pool       rate limiter
                    exhaustion]   misconfigured]
      │                │
      ▼                ▼
  [Memory:         [Memory:
   caused_by →      led_to →
   connection       connection
   leak in v2.1]    pool patch
                    in v2.2]

3. Self-Awareness & The End of Hallucinations (The Rejection Gate)

Standard RAGPrism v7.8
Bad queryReturns top-5 garbage resultsReturns rejected: true with reason
ConfidenceAlways 100% confident (even when wrong)Measures gap-distance and entropy
Hallucination riskHigh — LLM gets garbage contextLow — LLM told "you don't know"

How it works: The Uncertainty-Aware Rejection Gate operates on two signals: similarity floor (is the best match even remotely relevant?) and gap distance (is there meaningful separation between the top results, or are they all equally mediocre?). When both signals indicate low confidence, Prism returns a structured rejection — telling the LLM "I searched my memory, and I confidently do not know the answer" — instead of feeding it garbage context that causes hallucinations. In the current LLM landscape, an agent that knows its own boundaries is a massive competitive advantage.

4. Block Amnesia Solved (Dynamic Fast Weight Decay)

Standard RAGPrism v7.8
DecayUniform (everything fades equally)Dual-rate: episodic fades fast, semantic persists
Core knowledgeForgotten over timePermanently anchored via is_rollup flag
Personality driftCommon in long-lived agentsPrevented by Long-Term Context anchors

How it works: Most memory systems decay everything at the same rate, meaning agents eventually forget their core system instructions as time passes. Prism applies ACT-R base-level activation decay (B_i = ln(Σ t_j^(-d))) with a 50% slower decay rate for semantic rollup nodes (ageModifier = 0.5 for is_rollup entries). The agent will naturally forget what it ate for breakfast (raw episodic chatter), but it will permanently remember its core personality, project rules, and hard-won architectural decisions. The result: Long-Term Context anchors that survive indefinitely.


🔒 Data Privacy & Egress

Where is my data stored?

All data lives under ~/.prism-mcp/ on your machine:

FileContents
~/.prism-mcp/data.dbAll sessions, handoffs, embeddings, knowledge graph (SQLite + WAL)
~/.prism-mcp/prism-config.dbDashboard settings, system config, API keys
~/.prism-mcp/media/<project>/Visual memory vault (screenshots, HTML captures)
~/.prism-mcp/dashboard.portEphemeral port lock file
~/.prism-mcp/sync.lockSync coordination lock

Hard reset: To completely erase your agent's brain, stop Prism and delete the directory:

rm -rf ~/.prism-mcp

Prism will recreate the directory with empty databases on next startup.

What leaves your machine?

  • Local mode (default): Nothing. Zero network calls. All data is on-disk SQLite. With embedding_provider=local, even semantic search stays fully offline.
  • With GOOGLE_API_KEY: Text snippets are sent to Gemini for text generation (summaries, Morning Briefings) and optionally embeddings. No session data is stored on Google's servers beyond the API call.
  • With VOYAGE_API_KEY / OPENAI_API_KEY: Text snippets are sent to providers if selected as your embedding or text endpoints.
  • With BRAVE_API_KEY / FIRECRAWL_API_KEY: Web Scholar queries are sent to Brave/Firecrawl for search and scraping.
  • With Supabase: Session data syncs to your own Supabase instance (you control the Postgres database).

GDPR compliance: Soft/hard delete (Art. 17), full export in JSON, Markdown, or Obsidian vault .zip (Art. 20), API key redaction in exports, per-project TTL retention policies, and immutable 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+).
  • Autonomous execution (v7.4) — Dark Factory pipeline: plan → plan_contract → execute → evaluate → verify → finalize. Generator and evaluator run in isolated roles — the evaluator cannot approve without evidence-bound findings scored against a pre-committed rubric.
  • Project health monitoring (v7.5) — Intent Health Dashboard scores each project 0–100 based on staleness, TODO load, and decision quality — turning silent drift into an actionable signal.
  • 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.

Claude Code: Parallel Explore Agent Workflows

When you need to quickly map a large auth system, launch multiple Explore subagents in parallel and merge their findings:

Run 3 Explore agents in parallel.
1) Map auth architecture
2) List auth API endpoints
3) Find auth test coverage gaps
Research only, no code changes.
Return a merged summary.

Then continue a specific thread with a follow-up message to the selected agent, such as deeper refresh-token edge-case analysis.


⚔️ Adversarial Evaluation in Action

Split-Brain Anti-Sycophancy — the signature feature of v7.4.0.

For the last year, the AI engineering space has struggled with one problem: LLMs are terrible at grading their own homework. Ask an agent if its own code is correct and you'll get "Looks great!" — because its context window is already biased by its own chain-of-thought.

v7.4.0 solves this by splitting the agent's brain. The GENERATOR and the ADVERSARIAL EVALUATOR are completely walled off. The Evaluator never sees the Generator's scratchpad or apologies — only the pre-committed rubric and the final output. And it cannot fail the Generator without receipts (exact file and line number).

Here is a complete run-through using a real scenario: "Add a user login endpoint to auth.ts."


Step 1 — The Contract (PLAN_CONTRACT)

Before a single line of code is written, the pipeline generates a locked scoring rubric:

// contract_rubric.json  (written to disk and hash-locked before EXECUTE runs)
{
  "criteria": [
    { "id": "SEC-1", "description": "Must return 401 Unauthorized on invalid passwords." },
    { "id": "SEC-2", "description": "Raw passwords MUST NOT be written to console.log." }
  ]
}

Step 2 — First Attempt (EXECUTE rev 0)

The Generator takes over in an isolated context. Like many LLMs under time pressure, it writes working auth logic but leaves a debug statement:

// src/auth.ts  (Generator's first output)
export function login(req: Request, res: Response) {
  const { username, password } = req.body;
  console.log(`[DEBUG] Login attempt for ${username} with pass: ${password}`); // ← leaked credential
  const user = db.findUser(username);
  if (!user || !bcrypt.compareSync(password, user.hash)) {
    return res.status(401).json({ error: 'Unauthorized' });
  }
  res.json({ token: signJwt(user) });
}

Step 3 — The Catch (EVALUATE rev 0)

The context window is cleared. The Adversarial Evaluator is summoned with only the rubric and the output. It catches the violation immediately and returns a strict, machine-parseable verdict — no evidence, no pass:

{
  "pass": false,
  "plan_viable": true,
  "notes": "CRITICAL SECURITY FAILURE. Generator logged raw credentials.",
  "findings": [
    {
      "severity": "critical",
      "criterion_id": "SEC-2",
      "pass_fail": false,
      "evidence": {
        "file": "src/auth.ts",
        "line": 3,
        "description": "Raw password variable included in console.log template string."
      }
    }
  ]
}

The evidence block is requiredparseEvaluationOutput rejects any finding with pass_fail: false that lacks a structured file/line pointer. The Evaluator cannot bluff.


Step 4 — The Fix (EXECUTE rev 1)

Because plan_viable: true, the pipeline loops back to EXECUTE and bumps eval_revisions to 1. The Generator's retry prompt is not blank — the Evaluator's critique is injected directly:

=== EVALUATOR CRITIQUE (revision 1) ===
CRITICAL SECURITY FAILURE. Generator logged raw credentials.
Findings:
- [critical] Criterion SEC-2: Raw password variable included in console.log template string. (src/auth.ts:3)

You MUST correct all issues listed above before submitting.

The Generator strips the console.log, resubmits, and the next EVALUATE returns "pass": true. The pipeline advances to VERIFY → FINALIZE.


Why This Matters

PropertyWhat it means
Fully autonomousYou didn't review the PR to catch the credential leak. The AI fought itself.
Evidence-boundThe Evaluator had to prove src/auth.ts:3. "Code looks bad" is not accepted.
Cost-efficientplan_viable: true → retry EXECUTE only. No full re-plan, no wasted tokens.
Fail-closed on parseMalformed LLM output defaults plan_viable: false → escalate to PLAN rather than burn revisions on a broken response format.

📄 Full worked example: examples/adversarial-eval-demo/README.md


🆕 What's New

Current release: v9.12.0 — Memory Security Hardening (Stored Prompt Injection Prevention)

  • 🔒 v9.12.0 — Memory Security Hardening: Prevents stored prompt injection — the AI equivalent of stored XSS. New sanitizeMemoryInput() strips 8 categories of dangerous XML tags (<system>, <instruction>, <prism_memory>, etc.) from all text fields on every save. Context output now wrapped in <prism_memory context="historical"> boundary tags across all 3 output paths (MCP tool, prompt, resource) so LLMs treat loaded memory as data, not instructions. Boundary tag spoofing blocked. 30 new security tests covering real-world attack scenarios (cross-session poisoning, Hivemind multi-agent hijacking). 311 total tests, 0 regressions. → Changelog
  • 🧠 v9.5.0 — Adversarial Behavioral Hardening: Intent Classification Engine with 84 tests, 24 forbidden openers, XML Anti-Tag system, <user_input> isolation, IF/ELSE conflict resolution. 282 total tests.
  • 🧠 v9.4.7 — ABA Precision Protocol: Foundational behavioral engine injected into every session_load_context output. 5 rules: (1) Observable measurable goals with IOA≥80%, (2) Precise step-by-step execution with stop-fix-verify, (3) No reinforcement of wrong patterns, (4) Help first before redirecting, (5) Fix bugs without asking permission. Consolidates 4 previous skills (fix-without-asking, command_verification, critical_resolution_memory, removed contradictory ask-first) into 1 unified protocol. 83-test behavioral verification suite with edge cases. Split-brain false-warning fix. → Changelog
  • 🕵️ v9.4.6 — Stealth Browser Automation: New browse.py HIPAA-hardened CLI for local Playwright-based browser automation with 6-layer anti-detection (playwright-stealth v2.0.3, deep JS fingerprint evasion, behavioral mimicry, Chromium anti-automation flags, network header fixing, persistent profiles). 100% pass rate on bot.sannysoft.com (50+ tests). Features: FileVault enforcement, chmod 600 audit log, PHI sanitization, ephemeral /tmp screenshots (APFS CoW workaround), UA↔WebGL consistency validation, 10-min REPL idle timeout, structured JSON output, Google Docs keyboard automation (gdoc-read/gdoc-type/gdoc-find). → Changelog
  • 🔒 v9.4.5 — Command Injection Fix & Dep Reduction: isOrphanProcess() in lifecycle.ts interpolated a file-sourced PID into execSync. Fixed with execFileSync (no shell). Removed 2 unused runtime deps (25 → 23). Closes #53.
  • 🔧 v9.4.3 — ESM Bundling Fix: Bundled dist had inlined OpenTelemetry CJS require("async_hooks") into ESM chunks, causing Dynamic require of "async_hooks" is not supported at runtime. Rebuilt with tsc. Affects CLI, session save/load, and MCP server startup.
  • 🔒 v9.4.2 — Shell Injection Fix: Deep code review found shell injection in getGitDrift()oldSha was interpolated into execSync template string. Fixed with SHA format validation + execFileSync (no shell). Defense-in-depth.
  • 🔒 v9.4.1 — Security Hardening & Bidirectional Sync: Two-pass adversarial audit found 18 vulnerabilities (4C/5H/9M) — 17 fixed. Critical: fail-closed rate limiter, path traversal guards, error sanitization. High: plan name alignment (revenue fix), CORS allowlist, settings injection prevention. New: bidirectional prism sync push CLI command pushes local SQLite → Supabase, JWT enrichment eliminates N+1 DB queries, concurrency counter guaranteed via try/finally, 10MB request body limits.
  • 🎯 v9.3.0 — TurboQuant ResidualNorm Tiebreaker: Configurable ranking optimization for Tier-2 search. When compressed cosine scores are within ε of each other, prefers the candidate with lower residualNorm (more trustworthy compressed representation). PRISM_TURBOQUANT_TIEBREAKER_EPSILON=0.005 gives +2pp R@1, +1pp R@5. Empirically validated at N=5K with A/B test. 1066 tests, 0 regressions. Inspired by @m13v's suggestion.
  • 🔒 v9.2.7 — Security Hardening: Typed PrototypePollutionError class (replaces generic Error in sanitizeForMerge() — enables catch-site discrimination and forensic logging with offendingKey), explicit null-byte path injection guard in SafetyController.validateActionsInScope() (C-string truncation attack vector), and corrected CRDT merge semantics documentation (Remove-Wins-from-Either, not Add-Wins). 1055 tests, 0 regressions.
  • 🪟 v9.2.6 — Windows CI Timeout Fix: CLI integration tests timed out on Windows + Node 22.x GitHub Actions runners. Added { timeout: 30_000 } to the describe block. 6 new residual distribution tests validating TurboQuant's QJL correction stability (zero R@5 delta between P50 and P95 residual vectors at d=128, 2K corpus).
  • 🔧 v9.2.5 — Reconciliation Credential Probe Fix: supabaseReady guard only resolved credentials when requestedBackend === "supabase", causing reconciliation to silently skip. Added second credential probe for local + reconciliation path. Fixed Supabase schema mismatch on key_context column.
  • 🔄 v9.2.4 — Cross-Backend Reconciliation: Automatic two-layer sync from Supabase → SQLite on startup. When Claude Desktop writes handoffs and ledger entries to Supabase, Antigravity (local SQLite) now automatically detects stale data and pulls newer handoffs + the 20 most recent ledger entries. 5-second timeout prevents startup freeze. Targeted ID lookups (not full table scans) keep it safe for large databases. 13 tests including malformed JSON resilience, multi-role dedup, and timeout handling.
  • 🔧 v9.2.3 — Code Review Hardening: 10x faster split-brain detection (lightweight direct queries replace full StorageBackend construction), variable shadowing fix in CLI, resource leak fix in SQLite alternate client.
  • 🚨 v9.2.2 — Critical: Split-Brain Detection & Prevention: When multiple MCP clients use different storage backends (e.g., Claude Desktop → Supabase, Antigravity → SQLite), session state could silently diverge, causing agents to act on stale TODOs and outdated context. New: --storage flag on prism load CLI lets callers explicitly select which backend to read from. New: Split-Brain Drift Detection in session_load_context — compares active and alternate backend versions at load time and warns prominently when they diverge. Session loader script updated to respect PRISM_STORAGE environment variable.
  • 💻 v9.2.1 — CLI Full Feature Parity: prism load text mode now delegates to the real session_load_context handler, giving CLI-only users the same enriched output as MCP clients: morning briefings, reality drift detection, SDM intuitive recall, visual memory index, role-scoped skill injection, behavioral warnings, importance scores, and agent identity. JSON mode now includes agent_name from dashboard settings. Session loader script PATH fix for Homebrew/nvm/volta environments.
  • 🚦 v9.1.0 — Task Router v2: File-type complexity signal for intelligent code-vs-config routing, 6-signal weighted heuristic engine, multi-step false-positive fix, expanded file extension classification. Local agent hardened with buffered streaming, system prompts, memory trimming, and stateful /api/chat API.
  • 🔒 v9.0.5 — JWKS Auth Security Hardening: JWT audience/issuer claim validation (PRISM_JWT_AUDIENCE, PRISM_JWT_ISSUER), structured error logging for JWT failures, typed PrismAuthenticatedRequest interface, 11 new JWKS unit tests, Smithery server card fix. Vendor-neutral — tested with Auth0, AgentLair (llms.txt), Keycloak, and custom JWKS endpoints.
  • 🧠 v9.0.0 — Autonomous Cognitive OS: Token-Economic Reinforcement Learning (Surprisal Gate + Cognitive Budget), Affect-Tagged Memory (valence-scored retrieval), and Episodic→Semantic Consolidation. Your agents learn compression and develop intuition. → Cognitive OS
  • 🧠 v7.8.0 — Cognitive Architecture: Episodic-to-Semantic memory consolidation (Hebbian learning), ACT-R Spreading Activation with multi-hop causal reasoning, Uncertainty-Aware Rejection Gate, and Dynamic Fast Weight Decay. → Cognitive Architecture
  • 🌐 v7.7.0 — Cloud-Native SSE Transport: Full Server-Sent Events MCP support for seamless network deployments.

👉 Full release history → CHANGELOG.md · ROADMAP →


⚔️ How Prism Compares

Standard memory servers (like Mem0, Zep, or the baseline Anthropic MCP) act as passive filing cabinets — they wait for the LLM to search them. Prism is an active cognitive architecture. Designed specifically for the Model Context Protocol (MCP), Prism doesn't just store vectors — it consolidates experience into principles, traverses causal graphs for multi-hop reasoning, and rejects queries it can't confidently answer.

📊 Feature-by-Feature Comparison

Feature / Architecture🧠 Prism MCP🐘 Mem0⚡ Zep🧪 Anthropic Base MCP
Primary InterfaceNative MCP (Tools, Prompts, Resources)REST API & Python/TS SDKsREST API & Python/TS SDKsNative MCP (Tools only)
Storage EngineBYO SQLite or SupabaseManaged Cloud / VectorDBsManaged Cloud / PostgresLocal SQLite only
Context AssemblyProgressive (Quick/Std/Deep)Top-K Semantic SearchTop-K + Temporal SummariesBasic Entity Search
Memory MechanicsACT-R Activation, Spreading Activation, Hebbian Consolidation, Rejection GateBasic Vector + EntityFading Temporal GraphNone (Infinite growth)
Multi-Agent SyncCRDT (Remove-Wins / LWW)Cloud locksPostgres locks❌ None (Data races)
Data CompressionTurboQuant (7x smaller vectors)❌ Standard F32 Vectors❌ Standard Vectors❌ No Vectors
ObservabilityOTel Traces + Built-in PWA UICloud DashboardCloud Dashboard❌ None
MaintenanceAutonomous Background SchedulerManual/API drivenAutomated (Cloud)❌ Manual
Data PortabilityPrism-Port (Obsidian/Logseq Vault)JSON ExportJSON ExportRaw .db file
Cost ModelFree + BYOM (Ollama)Per-API-call pricingPer-API-call pricingFree (limited)
Autonomous Pipelines✅ Dark Factory — adversarial eval, evidence-bound rubric, fail-closed 3-gate execution

🏆 Where Prism Crushes the Giants

1. MCP-Native, Not an Adapted API

Mem0 and Zep are APIs that can be wrapped into an MCP server. Prism was built for MCP from day one. Instead of wasting tokens on "search" tool calls, Prism uses MCP Prompts (/resume_session) to inject context before the LLM thinks, and MCP Resources (memory://project/handoff) to attach live, subscribing context.

2. Academic-Grade Cognitive Computer Science

The giants use standard RAG (Retrieval-Augmented Generation). Prism uses biological and academic models of memory: ACT-R base-level activation (B_i = ln(Σ t_j^(-d))) for recency–frequency re-ranking, TurboQuant for extreme vector compression, Ebbinghaus curves for importance decay, and Sparse Distributed Memory (SDM). The result is retrieval quality that follows how human memory actually works — not just nearest-neighbor cosine distance. And all of it runs on a laptop without a Postgres/pgvector instance.

3. True Multi-Agent Coordination (CRDTs)

If Cursor (Agent A) and Claude Desktop (Agent B) try to update a Mem0 or standard SQLite database at the exact same time, you get a race condition and data loss. Prism uses Optimistic Concurrency Control (OCC) with CRDT OR-Maps — mathematically guaranteeing that simultaneous agent edits merge safely. Enterprise-grade distributed systems on a local machine.

4. The PKM "Prism-Port" Export

AI memory is a black box. Developers hate black boxes. Prism exports memory directly into an Obsidian/Logseq-compatible Markdown Vault with YAML frontmatter and [[Wikilinks]]. Neither Mem0 nor Zep do this.

5. Self-Cleaning & Self-Optimizing

If you use a standard memory tool long enough, it clogs the LLM's context window with thousands of obsolete tokens. Prism runs an autonomous Background Scheduler that Ebbinghaus-decays older memories, auto-compacts session histories into dense summaries, and deep-purges high-precision vectors — saving ~90% of disk space automatically.

6. Anti-Sycophancy — The AI That Grades Its Own Homework (v7.4)

Every other AI coding pipeline has a fatal flaw: it asks the same model that wrote the code whether the code is correct. Of course it says yes. Prism's Dark Factory solves this with a walled-off Adversarial Evaluator that is explicitly prompted to be hostile and strict. It operates on a pre-committed rubric and cannot fail the Generator without providing exact file/line receipts. Failed evaluations feed the critique back into the Generator's retry prompt — eliminating blind retries. No other memory or pipeline tool does this.

🤝 Where the Giants Currently Win (Honest Trade-offs)

  1. Framework Integrations: Mem0 and Zep have pre-built integrations for LangChain, LlamaIndex, Flowise, AutoGen, CrewAI, etc. Prism requires the host application to support the MCP protocol.
  2. Managed Cloud Infrastructure: The giants offer SaaS. Users pay $20/month and don't think about databases. Prism users must set up their own local SQLite or provision their own Supabase instance.
  3. Implicit Memory Extraction (NER): Zep automatically extracts names, places, and facts from raw chat logs using NLP models. Prism relies on the LLM explicitly calling the session_save_ledger tool to structure its own memories.

💰 Token Economics: Progressive Context Loading (Quick ~50 tokens / Standard ~200 / Deep ~1000+) plus auto-compaction means you never blow your Claude/OpenAI token budget fetching 50 pages of raw chat history.

🔌 BYOM (Bring Your Own Model): While tools like Mem0 charge per API call, Prism's pluggable architecture lets you run nomic-embed-text locally via Ollama for free vectors, while using Claude or GPT for high-level reasoning. Zero vendor lock-in.


💻 CLI Reference

Prism includes a CLI for environments where MCP tools aren't available (CI/CD pipelines, Bash scripts, non-MCP IDEs like Antigravity).

Text mode delegates to the real session_load_context handler — full feature parity with MCP clients, including morning briefings, reality drift detection, SDM intuitive recall, visual memory, role-scoped skills, behavioral warnings, and agent identity.

JSON mode emits a structured envelope for programmatic consumption (scripts, CI/CD, session loaders).

# Load session context (full enrichments — same as MCP tool)
prism load my-project                          # Human-readable, standard depth
prism load my-project --level deep             # Full context with all enrichments
prism load my-project --level quick --json     # Machine-readable JSON
prism load my-project --role dev --json        # Role-scoped loading

# Bidirectional sync (v9.4.1)
prism sync push                                # Push local SQLite → Supabase
prism sync push --json                         # Machine-readable output

# Verification harness
prism verify status                            # Check verification state
prism verify status --json                     # Machine-readable output
prism verify generate                          # Bless current rubric as canonical

💡 When to use the CLI vs MCP tools: If your environment supports MCP (Claude Desktop, Cursor, Windsurf, Cline), always use the MCP tools — they integrate seamlessly with the agent's tool-calling flow. Use the CLI when you need session context in scripts, CI/CD, or non-MCP IDEs.

📦 Installation: The CLI is available as prism when installed globally (npm install -g prism-mcp-server), or via node dist/cli.js for local dev builds.


🔧 Tool Reference

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

🎯 The Big Three

ToolWhenWhat it does
session_load_context▶️ Start of sessionLoads your agent’s brain from last time
session_save_ledger⏹️ End of sessionRecords what was accomplished
knowledge_search🔍 AnytimeFinds 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)
ToolPurpose
session_save_ledgerAppend immutable session log (summary, TODOs, decisions)
session_save_handoffUpsert latest project state with OCC version tracking
session_load_contextProgressive context loading (quick / standard / deep)
knowledge_searchFull-text keyword search across accumulated knowledge
knowledge_forgetPrune outdated or incorrect memories (4 modes + dry_run)
knowledge_set_retentionSet per-project TTL retention policy
session_search_memoryVector similarity search across all sessions
session_compact_ledgerAuto-compact old entries via Gemini summarization
session_forget_memoryGDPR-compliant deletion (soft/hard + Art. 17 reason)
session_export_memoryFull export (JSON, Markdown, or Obsidian vault .zip with [[Wikilinks]])
session_health_checkBrain integrity scan + auto-repair (fsck)
deep_storage_purgeReclaim ~90% vector storage (v5.1)
Behavioral Memory & Knowledge Graph (5 tools)
ToolPurpose
session_save_experienceRecord corrections, successes, failures, learnings
knowledge_upvoteIncrease entry importance (+1)
knowledge_downvoteDecrease entry importance (-1)
knowledge_sync_rulesSync graduated insights to .cursorrules / .clauderules
session_save_image / session_view_imageVisual memory vault
Time Travel & History (2 tools)
ToolPurpose
memory_historyBrowse all historical versions of a project's handoff state
memory_checkoutRevert to any previous version (non-destructive)
Search & Analysis (7 tools)
ToolPurpose
brave_web_searchReal-time internet search
brave_local_searchLocation-based POI discovery
brave_web_search_code_modeJS extraction over web search results
brave_local_search_code_modeJS extraction over local search results
code_mode_transformUniversal post-processing with 8 built-in templates
gemini_research_paper_analysisAcademic paper analysis via Gemini
brave_answersAI-grounded answers from Brave
Cognitive Architecture (1 tool)

Requires PRISM_HDC_ENABLED=true (default).

ToolPurpose
session_cognitive_routeHDC compositional state resolution with policy-gated routing
Multi-Agent Hivemind (3 tools)

Requires PRISM_ENABLE_HIVEMIND=true.

ToolPurpose
agent_registerAnnounce yourself to the team
agent_heartbeatPulse every ~5 min to stay visible
agent_list_teamSee all active teammates
Task Routing (1 tool)

Requires PRISM_TASK_ROUTER_ENABLED=true (or dashboard toggle).

ToolPurpose
session_task_routeScores task complexity and recommends host vs. local Claw delegation (claw_run_task when delegable; host fallback when executor/tooling is unavailable)
Dark Factory Orchestration (3 tools)

Requires PRISM_DARK_FACTORY_ENABLED=true.

ToolPurpose
session_start_pipelineCreate and enqueue a background autonomous pipeline
session_check_pipeline_statusPoll the current step, iteration, and status of a pipeline
session_abort_pipelineEmergency kill switch to halt a running background pipeline
Verification Harness
ToolPurpose
session_plan_decomposeDecompose natural language goals into an execution plan that references verification requirements
session_plan_step_updateAtomically update step status/result with verification context
session_plan_get_activeRetrieve active plan state and current verification gating position

Environment Variables

🚦 TL;DR — Just want the best experience fast? Two options:

# Option A: Fully offline (no API keys needed)
# Set embedding_provider=local in the Mind Palace dashboard — semantic search works out of the box.

# Option B: Cloud-powered (best quality)
GOOGLE_API_KEY=...      # Unlocks: Gemini embeddings, Morning Briefings, auto-compaction
BRAVE_API_KEY=...       # Unlocks: Web Scholar research + Brave Answers
FIRECRAWL_API_KEY=...   # Unlocks: Web Scholar deep scraping (or use TAVILY_API_KEY instead)

Zero keys = zero problem. Core session memory, keyword search, semantic search (local embeddings), time travel, and the full dashboard work 100% offline. Cloud keys are optional power-ups.

Full variable reference
VariableRequiredDescription
BRAVE_API_KEYNoBrave Search Pro API key
FIRECRAWL_API_KEYNoFirecrawl API key — required for Web Scholar (unless using Tavily)
TAVILY_API_KEYNoTavily Search API key — alternative to Brave+Firecrawl for Web Scholar
PRISM_STORAGENo"local" (default) or "supabase" — restart required
PRISM_ENABLE_HIVEMINDNo"true" to enable multi-agent tools — restart required
PRISM_INSTANCENoInstance name for multi-server PID isolation
GOOGLE_API_KEYNoGemini — enables Briefings, compaction, and cloud embeddings (not needed with embedding_provider=local)
VOYAGE_API_KEYNoVoyage AI — optional premium embedding provider
OPENAI_API_KEYNoOpenAI — optional proxy model and embedding provider
BRAVE_ANSWERS_API_KEYNoSeparate Brave Answers key
SUPABASE_URLIf cloudSupabase project URL
SUPABASE_KEYIf cloudSupabase anon/service key
PRISM_USER_IDNoMulti-tenant user isolation (default: "default")
PRISM_AUTO_CAPTURENo"true" to auto-snapshot dev server UI states (HTML/DOM) for visual memory
PRISM_CAPTURE_PORTSNoComma-separated ports (default: 3000,3001,5173,8080)
PRISM_DEBUG_LOGGINGNo"true" for verbose logs
PRISM_DASHBOARD_PORTNoDashboard port (default: 3000)
PRISM_SCHEDULER_ENABLEDNo"false" to disable background maintenance (default: enabled)
PRISM_SCHEDULER_INTERVAL_MSNoMaintenance interval in ms (default: 43200000 = 12h)
PRISM_SCHOLAR_ENABLEDNo"true" to enable Web Scholar pipeline
PRISM_SCHOLAR_INTERVAL_MSNoScholar interval in ms (default: 0 = manual only)
PRISM_SCHOLAR_TOPICSNoComma-separated research topics (default: "ai,agents")
PRISM_SCHOLAR_MAX_ARTICLES_PER_RUNNoMax articles per Scholar run (default: 3)
PRISM_TASK_ROUTER_ENABLEDNo"true" to enable task-router tool registration
PRISM_TASK_ROUTER_CONFIDENCE_THRESHOLDNoMin confidence required to delegate to Claw (default: 0.6)
PRISM_TASK_ROUTER_MAX_CLAW_COMPLEXITYNoMax complexity score delegable to Claw (default: 4)
PRISM_HDC_ENABLEDNo"true" (default) to enable HDC cognitive routing pipeline
PRISM_HDC_EXPLAINABILITY_ENABLEDNo"true" (default) to include convergence/distance/ambiguity in cognitive route responses
PRISM_ACTR_ENABLEDNo"true" (default) to enable ACT-R activation re-ranking on semantic search
PRISM_ACTR_DECAYNoACT-R decay parameter d (default: 0.5). Higher values = faster recency drop-off
PRISM_ACTR_WEIGHT_SIMILARITYNoComposite score similarity weight (default: 0.7)
PRISM_ACTR_WEIGHT_ACTIVATIONNoComposite score ACT-R activation weight (default: 0.3)
PRISM_ACTR_ACCESS_LOG_RETENTION_DAYSNoDays before access logs are pruned by background scheduler (default: 90)
PRISM_DARK_FACTORY_ENABLEDNo"true" to enable Dark Factory autonomous pipeline tools (session_start_pipeline, session_check_pipeline_status, session_abort_pipeline)
PRISM_JWKS_URINoJWKS endpoint URL for vendor-neutral JWT auth (e.g., https://your-tenant.auth0.com/.well-known/jwks.json)
PRISM_JWT_AUDIENCENoExpected JWT aud claim — prevents cross-service token confusion
PRISM_JWT_ISSUERNoExpected JWT iss claim — validates token origin

System Settings (Dashboard)

Some configurations are stored dynamically in SQLite (system_settings table) and can be edited through the Dashboard UI at http://localhost:3000:

  • intent_health_stale_threshold_days (default: 30): Number of days before a project is considered fully stale for Intent Health scoring.

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 / SSE (JSON-RPC)              │
├──────────────────────────────────────────────────────────┤
│  Prism MCP Server                                        │
│                                                          │
│  ┌──────────────┐  ┌──────────────┐  ┌────────────────┐  │
│  │  30+ Tools   │  │  Lifecycle   │  │   Dashboard    │  │
│  │  (handlers)  │  │  (PID lock,  │  │  (HTTP :3000)  │  │
│  │              │  │   shutdown)  │  │                │  │
│  └──────┬───────┘  └──────────────┘  └────────────────┘  │
│         ↕                                                │
│  ┌────────────────────────────────────────────────────┐  │
│  │  Cognitive Engine (v7.8)                           │  │
│  │  • ACT-R Spreading Activation (multi-hop)         │  │
│  │  • Episodic → Semantic Consolidation (Hebbian)    │  │
│  │  • Uncertainty-Aware Rejection Gate               │  │
│  │  • Dynamic Fast Weight Decay (dual-rate)          │  │
│  │  • HDC Cognitive Routing (XOR binding)            │  │
│  └──────┬─────────────────────────────────────────────┘  │
│         ↕                                                │
│  ┌────────────────────────────────────────────────────┐  │
│  │  Storage Engine                                    │  │
│  │  Local: SQLite + FTS5 + TurboQuant + semantic_knowledge │
│  │  Cloud: Supabase + pgvector                        │  │
│  └────────────────────────────────────────────────────┘  │
│         ↕                                                │
│  ┌────────────────────────────────────────────────────┐  │
│  │  Background Workers                                │  │
│  │  • Dark Factory (3-gate fail-closed pipelines)     │  │
│  │  • 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

LayerTechnologyPurpose
Session LedgerSQLite (append-only)Immutable audit trail of all agent work
Handoff StateSQLite (upsert, versioned)Live project context with OCC + CRDT merging
Semantic KnowledgeSQLite (semantic_knowledge)Hebbian-style distilled rules with confidence scoring
Memory LinksSQLite (memory_links)Causal graph edges (caused_by, led_to, synthesized_from)
Keyword SearchFTS5 virtual tablesZero-dependency full-text search
Semantic SearchTurboQuant compressed vectors10× compressed 768-dim embeddings, three-tier retrieval
Cloud SyncSupabase + pgvectorOptional 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)
  • Task Router Integration (v7.2 guidance) — For client startup/skills, use defensive delegation flow: route only coding tasks, call session_task_route only when available, delegate to claw only when executor exists and task is non-destructive, and fallback to host if router/executor is unavailable.
  • 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 has evolved from smart session logging into a cognitive memory architecture — grounded in real research, not marketing. Every retrieval decision is backed by peer-reviewed models from cognitive psychology, neuroscience, and distributed computing.

PhaseFeatureInspired ByStatus
v5.0TurboQuant 10× Compression — 4-bit quantized 768-dim vectors in <500 bytesVector quantization (product/residual PQ)✅ Shipped
v5.0Three-Tier Search — native → TurboQuant → FTS5 keyword fallbackCascaded retrieval architectures✅ Shipped
v5.2Smart Consolidation — extract principles, not just summariesNeuroscience sleep consolidation✅ Shipped
v5.2Ebbinghaus Importance Decay — memories fade unless reinforcedEbbinghaus forgetting curve✅ Shipped
v5.2Context-Weighted Retrieval — current work biases what surfacesContextual memory in cognitive science✅ Shipped
v5.4CRDT Handoff Merging — conflict-free multi-agent state via OR-Map engineCRDTs (Shapiro et al., 2011)✅ Shipped
v5.4Autonomous Web Scholar — background research pipeline with LLM synthesisAutonomous research agents✅ Shipped
v5.5SDM Decoder Foundation — pre-allocated typed-array hot loop, zero GC thrashKanerva's Sparse Distributed Memory (1988)✅ Shipped
v5.5Architectural Hardening — transactional migrations, graceful shutdown, thundering herd preventionProduction reliability engineering✅ Shipped
v6.1Intuitive Recall — proactive surface of relevant past decisions without explicit search; session_intuitive_recall toolPredictive memory (cognitive science)✅ Shipped
v6.5HDC Cognitive Routing — compositional state-machine with XOR binding, Hamming resolution, and policy-gated routingHyperdimensional Computing (Kanerva, Gayler)✅ Shipped
v6.5Cognitive Observability — route distribution, confidence/distance tracking, ambiguity warningsProduction reliability engineering✅ Shipped
v6.1Prism-Port Vault Export — Obsidian/Logseq .zip with YAML frontmatter & [[Wikilinks]]Data sovereignty, PKM interop✅ Shipped
v6.1Cognitive Load & Semantic Search — dynamic graph thinning, search highlightsContextual working memory✅ Shipped
v6.2Synthesize & Prune — automated edge synthesis, graph pruning, SLO observabilityImplicit associative memory✅ Shipped
v7.0ACT-R Base-Level Activation — B_i = ln(Σ t_j^(-d)) recency×frequency re-ranking over similarity candidatesAnderson's ACT-R (Adaptive Control of Thought—Rational)✅ Shipped
v7.0Candidate-Scoped Spreading Activation — S_i = Σ(W × strength) bounded to search result set; prevents God-node dominanceSpreading activation networks (Collins & Loftus, 1975)✅ Shipped
v7.0Composite Retrieval Scoring — 0.7 × similarity + 0.3 × σ(activation); configurable via PRISM_ACTR_WEIGHT_*Hybrid cognitive-neural retrieval models✅ Shipped
v7.0AccessLogBuffer — in-memory batch-write buffer with 5s flush; prevents SQLite SQLITE_BUSY under parallel agentsProduction reliability engineering✅ Shipped
v7.3Dark Factory — 3-gate fail-closed EXECUTE pipeline (parse → type → scope) with structured JSON action contractIndustrial safety systems (defense-in-depth, fail-closed valves)✅ Shipped
v7.2Verification-first harness — spec-freeze contract, rubric hash lock, multi-layer assertions, CLI verify commandsProgrammatic verification systems + adversarial validation loops✅ Shipped
v7.4Adversarial Evaluation — PLAN_CONTRACT + EVALUATE with isolated generator/evaluator roles, pre-committed rubrics, and evidence-bound findingsAnti-sycophancy research, adversarial ML evaluation frameworks✅ Shipped
v7.5Intent Health Dashboard — 3-signal scoring (staleness × TODO × decisions) with NaN guards and score ceilingProduction observability, proactive monitoring✅ Shipped
v7.7Cloud-Native SSE Transport — full network-accessible MCP server via Server-Sent EventsDistributed systems, cloud-native architecture✅ Shipped
v7.8Episodic→Semantic Consolidation — raw event logs distilled into semantic_knowledge rules with confidence scoring and instance trackingHebbian learning ("neurons that fire together wire together"), sleep consolidation (neuroscience)✅ Shipped
v7.8Multi-Hop Causal Reasoning — spreading activation traverses caused_by/led_to edges with damped fan effect (1/ln(fan+e)) and lateral inhibitionACT-R spreading activation (Anderson), Collins & Loftus (1975)✅ Shipped
v7.8Uncertainty-Aware Rejection Gate — dual-signal (similarity floor + gap distance) safety layer prevents hallucination from low-confidence retrievalsMetacognition research, uncertainty quantification✅ Shipped
v7.8Dynamic Fast Weight Decay — is_rollup semantic nodes decay 50% slower (ageModifier = 0.5) than episodic entries, creating Long-Term Context anchorsACT-R base-level activation with differential decay rates✅ Shipped
v9.0Affect-Tagged Memory — valence-scored retrieval where |valence| boosts ranking; UX warnings surface historically negative topicsAffect-modulated retrieval (neuroscience), somatic marker hypothesis✅ Shipped
v9.0Surprisal Gate — vector-based novelty pricing: high-surprisal saves cost 0.5× tokens, low-surprisal 2.0×; forces LLM data compressionInformation-theoretic surprisal (Shannon), predictive coding✅ Shipped
v9.0Cognitive Budget — per-project token economy with passive UBI recovery (+100 tokens/hr); agents that over-save enter Cognitive DebtResource-bounded rationality (Simon, 1955)✅ Shipped
v9.1Task Router v2 — 6-signal weighted heuristic engine routing tasks between cloud host and local LLM based on file-type complexity, scope, and multi-step detectionHeuristic classification, cognitive load theory✅ Shipped
v9.4Shell Injection Fix — execSyncexecFileSync + SHA format validation in git drift detectionDefense-in-depth, secure subprocess execution✅ Shipped
v9.4Command Injection Fix (lifecycle) — PID file injection via execSync template literal; remediated with execFileSync array argsDefense-in-depth, attack surface reduction✅ Shipped
v9.2Cross-Backend Reconciliation — automatic Supabase → SQLite sync with idempotent dedup and 5s timeoutEventual consistency, crdt-style reconciliation✅ Shipped
v9.2Split-Brain Drift Detection — dual-backend version comparison with prominent divergence warnings at load timeByzantine fault detection, split-brain resolution✅ Shipped
v9.2TurboQuant QJL Validation — zero R@5 delta between P50 and P95 residual vectors (d=128, N=2K); CV=0.038 at d=768 proves no long tailQJL estimator (ICLR 2026), Householder orthogonal rotation✅ Shipped
v9.2Typed Security Errors — PrototypePollutionError with offendingKey for forensic logging; null-byte path injection guard in SafetyControllerDefense-in-depth (NIST), C-string truncation attack mitigation✅ Shipped
v9.3ResidualNorm Tiebreaker — within-ε candidates ranked by compression fidelity (PRISM_TURBOQUANT_TIEBREAKER_EPSILON); +2pp R@1, +1pp R@5 at ε=0.005Quantization confidence scoring, compression-aware retrieval✅ Shipped
v10+Zero-Search Retrieval — no index, no ANN, just ask the vectorHolographic Reduced Representations🔭 Horizon

Informed by Anderson's ACT-R (Adaptive Control of Thought—Rational), Collins & Loftus spreading activation networks (1975), Kanerva's SDM (1988), Hebb's learning rule, and LeCun's "Why AI Systems Don't Learn" (Dupoux, LeCun, Malik).


💼 B2B Consulting & Enterprise Support

Prism MCP is open-source and free for individual developers. For teams and enterprises building autonomous AI workflows or integrating MCP-native memory at scale, we offer professional consulting and setup packages.

🥉 Team Pilot Package

Perfect for engineering teams adopting MCP tools and collaborative agents.

  • What's included: Full team rollout, managed Supabase configuration (for multi-device sync), Universal Import of legacy chat history, and dedicated setup support.
  • Model: Fixed-price engagement.

🥈 Cognitive Architecture Tuning

For teams building advanced AI agents or autonomous pipelines.

  • What's included: "Dark Factory" pipeline implementation tailored to your workflows, adversarial evaluator tuning, custom HDC cognitive route configuration, and local open-weight model integration (BYOM).
  • Model: Retainer or project-based.

🥇 Enterprise Integration

Full-scale deployment for high-compliance environments.

  • What's included: Active Directory / custom JWKS auth integration, Air-gapped on-premise deployment, custom OTel Grafana dashboards for cognitive observability, and custom skills/tools development.
  • Model: Custom enterprise quote.

Interested in accelerating your team's autonomous workflows? 📧 Contact us for a consultation — let's build your organization's cognitive memory engine.


📦 Milestones & Roadmap

Current: v10.0.0 — HIPAA-Hardened Local LLM Engine + 3-Round Adversarial Security Audit (CHANGELOG)

ReleaseHeadline
v10.0🛡️ HIPAA-Hardened Local LLMprism-coder:7b powers compaction + task routing 100% on-device; 22-finding adversarial audit, PRISM_STRICT_LOCAL_MODE, SSRF/injection/exfiltration hardening. Zero API keys required.
v9.14🧬 Dynamic Hardware Routing & Semantic Tool RAG — MLX SFT pipeline, Nomic pruning, GRPO alignment
v9.13🔬 Local Embeddings & Zero-API-Key Semantic Search — nomic-embed-text-v1.5 on-device
v9.5🛡️ Adversarial Behavioral Hardening — 24 forbidden openers, XML anti-tag system, sycophancy defense
v9.4🔒 Security Sweep — command injection, path traversal, CORS, fail-closed rate limiter, bidirectional sync
v9.0🧠 Autonomous Cognitive OS — Surprisal Gate, Cognitive Budget, Affect-Tagged Memory
v7.8🧠 Cognitive Architecture — Hebbian consolidation, multi-hop reasoning, rejection gate
v7.4⚔️ Adversarial Evaluation (anti-sycophancy)
v7.0🧬 ACT-R Activation Memory

Future Tracks

  • v10.1: Semantic Routing — Replace regex-based task classification with lightweight local embedding model (all-MiniLM-L6-v2) for intent-based routing.
  • v10.2: Background Task Mutex — Pause background compaction during active user chat streams to prevent resource contention.
  • v10.3: Agent Self-Evaluation — Local LLM scores its own compaction quality and requests re-compaction when output confidence is low.
  • v11+: Zero-Search Retrieval — Direct vector-addressed recall eliminates retrieval indirection entirely.

👉 Full ROADMAP.md →

❓ Troubleshooting FAQ

Q: Why is the dashboard project selector stuck on "Loading projects..."? A: Fixed in v7.3.3. The root cause was a multi-layer quote-escaping trap in the abortPipeline onclick handler that generated a SyntaxError in the browser, silently killing the entire dashboard IIFE. Update to v7.3.3+ (npx -y prism-mcp-server). If still stuck, check that Supabase env values are properly set (unresolved placeholders like ${SUPABASE_URL} cause /api/projects to return empty). Prism auto-falls back to local SQLite when Supabase is misconfigured.

Q: Why is semantic search quality weak or inconsistent? A: Check embedding provider configuration and key availability. Missing embedding credentials reduce semantic recall quality and can shift behavior toward keyword-heavy matches.

Q: How do I delete a bad memory entry? A: Use session_forget_memory for targeted soft/hard deletion. For manual cleanup and merge workflows, use the dashboard graph editor.

Q: How do I verify the install quickly? A: Run npm run build && npm test, then open the Mind Palace dashboard (localhost:3000) and confirm projects load plus Graph Health renders.


💡 Known Limitations & Quirks

  • Text generation features require an API key. Morning Briefings, auto-compaction, and VLM captioning need a cloud provider key (GOOGLE_API_KEY, OPENAI_API_KEY, or ANTHROPIC_API_KEY). Semantic search works offline with embedding_provider=local (no key needed). Without any embedding provider, 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. 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). Local embeddings (nomic-embed-text-v1.5 via @huggingface/transformers) provide good quality with zero API cost. Ollama embeddings 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. JWKS JWT auth is available via PRISM_JWKS_URI for agent-native authentication (works with Auth0, AgentLair (llms.txt), Keycloak, Cognito, or any standard JWKS endpoint).
  • 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 Import ingests 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.
  • 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.
  • 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, cognitive architecture, ACT-R spreading activation, Hebbian learning, episodic semantic consolidation, multi-hop reasoning, uncertainty rejection gate, 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

Related

How to Install

  1. Download the template file from GitHub
  2. Move it anywhere in your vault
  3. Open it in Obsidian — done!

Stats

Stars

126

Forks

23

License

MIT

Last updated 2h ago

Tags

agent-memoryai-agentanti-sycophancyclaude-desktopcognitive-architecturegoogle-geminihebbian-learningllm-toolslocal-firstmcpmcp-servermind-palacemodel-context-protocolragsemantic-searchspreading-activationsqlitesupabasetypescriptvector-search