Documentation

Synapse Layer Docs

Technical reference for AI Memory Infrastructure. Zero-knowledge encryption, semantic recall, conflict resolution, and Neural Handover™.

Get Started in 2 Minutes

Install

pip install synapse-layer
# or
npm install synapse-layer

Store a Memory

from synapse_layer import SynapseMemory

memory = SynapseMemory(user_id="uuid", password="strong-password")
memory.store(
  "User prefers dark mode",
  intent="preference",
  importance=0.9
)

Recall

results = memory.recall("user interface preferences")
# → [{ content: "User prefers dark mode", trust_score: 0.94 }]

How It Works

Synapse Layer uses a split-boundary architecture. All encryption happens client-side before any network call. The server stores only encrypted blobs and embedding vectors — it never sees plaintext.

Recall works by performing cosine similarity search on pgvector HNSW indexes. The encrypted payload is returned to the client, which decrypts locally. Conflict resolution runs on metadata (TQ scores), never on content.

Client Boundary
plaintext input
PBKDF2-SHA256 (210K iterations)
AES-256-GCM encrypt → server
embed(text) → server
decrypt on recall ← server
Server Boundary
stores: [AES-256 blob]
stores: [384-dim vector]
cosine search (pgvector)
returns: blob + metadata
✘ never sees plaintext
✘ never decrypts

Cognitive Security Protocol v1.0.6

Every memory passes through 4 security seals before storage:

01

Sanitize

Semantic Privacy Guard™ scans for PII, credentials, and sensitive patterns. Detected content is stripped, masked, or flagged.

02

Validate Intent

Intelligent Intent Validation™ classifies each memory against known attack patterns (prompt injection, data exfiltration, context poisoning).

03

Encrypt + Noise

AES-256-GCM encryption with PBKDF2-SHA256 derived keys (210K iterations). Statistical noise injected into embeddings to prevent inference attacks.

04

Audit Trail

Every operation logged with HMAC-SHA256 signatures, timestamps, source agent ID, and operation type. Immutable and tamper-evident.

Core API

memory.store(content, intent, importance)

Encrypt and store a memory with semantic metadata. Returns the memory ID and trust score.

memory.recall(query, top_k)

Semantic search over encrypted memories. Returns ranked results with TQ scores.

memory.createHandover(target_model)

Create a model-neutral context package signed with HMAC-SHA256 for Neural Handover™.

memory.resolveConflicts()

Run Truth Quotient (TQ) conflict resolution. Winners are promoted, losers deprecated.

memory.delete(memory_id)

Permanently delete a specific memory and its associated vector embedding.

MCP Server Configuration

Synapse Layer is MCP-native. Connect any MCP-compatible client (Claude Desktop, Cursor, custom agents) to the memory server. All tools (store, recall, handover, resolve) are exposed as MCP tools automatically.

Claude Desktop / Cursor Config

{
  "mcpServers": {
    "synapse-memory": {
      "command": "npx",
      "args": ["ts-node", "src/mcp-server/index.ts"],
      "env": {
        "SUPABASE_URL": "https://your-project.supabase.co",
        "SUPABASE_SERVICE_ROLE_KEY": "your-key"
      }
    }
  }
}