AI Memory Infrastructure

The Memory Layer
for AI Agents.

Zero-knowledge, model-agnostic long-term memory with conflict resolution and memory decay. Open-source.

Read the architecture →
memory.ts
import { SynapseLayer } from "synapse-layer"
 
const synapse = new SynapseLayer({ userId, password })
// password never leaves the client
 
// Store — auto-encrypted AES-256-GCM before transmission
await synapse.store("User prefers TypeScript and dark mode", {
intent: "preference", importance: 0.9, source: "explicit"
})
 
// Recall — semantic search + trust scoring
const results = await synapse.recall("user preferences")
// → [{ content: "...", trust_score: 0.94, is_winner: true }]
 
// Neural Handover — HMAC-signed, 24h TTL
const handover = await synapse.createHandover({ targetModel: "gpt-4o" })
// → { handover_id: "abc123", hmac: "a3f9...", expires_in: "24h" }
AES-256-GCM client-side·PBKDF2-SHA256 210k·pgvector HNSW·MCP-native·HMAC-signed handover·Apache 2.0·sa-east-1
synapse-runtime

Zero-Knowledge Context

Outcome

Agents remember users without exposing data to any server.

Mechanism

Encryption happens client-side before any network call.

Proof

AES-256-GCM · PBKDF2-SHA256 · 210,000 iterations

Deterministic Recall

Outcome

Consistent, ranked context on every retrieval.

Mechanism

Semantic search + trust scoring formula.

Proof

pgvector HNSW · cosine similarity · importance(35%) + confidence(25%) + stability(20%)

Consensus Engine

Outcome

Contradictory memories resolve to a deterministic winner.

Mechanism

Truth Quotient (TQ) formula with source weights.

Proof

explicit=1.5× · system=1.0× · inference=0.5× · winner promoted, loser deprecated

Neural Handover™

Outcome

Switch models without losing agent state.

Mechanism

Model-neutral JSON signed with HMAC-SHA256, injected via MCP.

Proof

TTL 24h · XML for Claude · Markdown for GPT · minimal for Llama

LLMs are stateless. Every session starts from zero.
Agents repeat context, lose continuity, and hallucinate state.
Synapse Layer is the persistent memory layer that fixes this —
encrypted on the client, retrieved semantically, resolved deterministically.

Architecture

How It Works

Client Boundary
plaintext input
PBKDF2-SHA256 (210k)
AES-256-GCM encrypt ─▶
embed(text) ───▶
decrypt on recall ◀─
Server Boundary
✗ never sees plaintext
stores: [AES-256 blob]
stores: [384-dim vector]
cosine search (pgvector)
returns: blob + metadata
never decrypts

Plaintext never leaves the client. The server stores only encrypted blobs and embedding vectors.

Encryption happens before any network call

Server performs vector search on embeddings, not on content

Recall returns encrypted payload — decryption is client-side only

Conflict resolution runs on metadata (TQ scores), never on plaintext

Conflict Resolution

Memory That Resolves Itself

Without Synapse Layer

  • Agent receives conflicting user preferences
  • No resolution mechanism exists
  • Latest write wins — or random
  • Agent behavior becomes inconsistent and unpredictable

With Synapse Layer

  • Conflict detected automatically on store
  • TQ formula elects winner deterministically
  • Loser deprecated, winner promoted
  • Agent behavior is consistent and auditable
Step 1 — Store two conflicting memories
store("User prefers conservative investments", source="explicit", stability=8)
store("User wants to invest in crypto", source="inference", stability=1)
Step 2 — Run conflict resolution
resolveConflicts({ userId })
Step 3 — TQ breakdown
Memory A → TQ: 0.94 ✔ WINNER   (explicit · stability: 8 · recalled: 12×)
Memory B → TQ: 0.34 ✗ DEMOTED  (inference · stability: 1 · recalled: 0×)
Result: agent uses Memory A. Memory B deprecated.

Security

Trust Boundaries

The server is a blind vault.
It stores encrypted blobs and embedding vectors.
It cannot reconstruct, read, or infer the original content.

ENCRYPTED

All memory content (AES-256-GCM, client-side)

SIGNED

Neural Handover packages (HMAC-SHA256)

SERVER NEVER SEES

Plaintext · passwords · decrypted content

VISIBLE METADATA

Vector dimensions · timestamps · fact_hash · intent · credit balance

ASSUMPTIONS

Client device security · embedding vectors stored unencrypted (required for search)

COMPLIANCE NOTE — Synapse Layer may qualify as an encrypted data processor, not a data controller. Consult your legal team for your specific jurisdiction.

Use Cases

Built for Real Infrastructure

SaaS Copilot Personalization

Product teams building AI assistants

Stored

User preferences, workflow patterns, tool configs

Enables

Personalized responses without re-prompting every session.

Support Agent Continuity

Customer support platforms

Stored

Issue history, resolution patterns, user sentiment

Enables

Agents that remember past interactions across sessions and models.

Multi-Model Orchestration

Teams running Claude + GPT + Llama in parallel

Stored

Shared user context, session state, preferences

Enables

Seamless handover between models with zero context loss.

Privacy-First Personal Assistants

Developers building tools for sensitive use cases

Stored

Personal preferences, health context, financial behavior

Enables

Persistent personalization without server-side plaintext exposure.

CRM Intelligence Layer

Sales and GTM engineering teams

Stored

Customer interaction history, deal context, communication style

Enables

AI agents that evolve their understanding of each customer over time.

Regulated Environments (LGPD / GDPR)

Teams in healthcare, finance, legal

Stored

Encrypted user context with soft-delete compliance

Enables

Compliant memory with delete_memory audit trail.

Get Started

First memory in 2 minutes

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

Your agents are stateless.

They don't have to be.

Open-source. Self-hostable. Apache 2.0.