Zero-Knowledge Memory Layer for AI Agents — Cognitive Security Protocol with 4 proprietary seals. Giving Agents a Past. Giving Models a Soul.
Project description
Synapse Layer
Zero-Knowledge Memory Layer for AI Agents
Giving Agents a Past. Giving Models a Soul. ⚗️
TL;DR
pip install synapse-layer
from synapse_layer import SynapseMemory
import asyncio
async def main():
mem = SynapseMemory(agent_id="my-agent")
await mem.store("User prefers dark mode", confidence=0.95)
results = await mem.recall("user preferences")
for r in results:
print(f"{r.content} (TQ: {r.trust_quotient:.3f})")
asyncio.run(main())
MCP (Claude Desktop / LangChain / CrewAI):
{
"mcpServers": {
"synapse-layer": {
"command": "uvx",
"args": ["synapse-layer"]
}
}
}
That's it. AES-256-GCM encryption, PII sanitization, differential privacy noise, intent validation, and trust scoring — all happen automatically under the hood.
Why Synapse Layer
AI agents are stateless. They forget everything between sessions, waste tokens re-asking questions, and lose context when switching models. Existing solutions either store plaintext embeddings (security risk), lack cross-model support, or require you to manage vector DBs manually.
Synapse Layer is a persistent, encrypted, cross-model memory infrastructure with four proprietary security layers and cryptographic guarantees. The server never sees plaintext.
Competitive Comparison
| Capability | Synapse Layer | Mem0 | Zep | pgvector (raw) |
|---|---|---|---|---|
| Client-side AES-256-GCM | ✅ | ❌ | ❌ | ❌ |
| Semantic PII Sanitization | ✅ | ❌ | ❌ | ❌ |
| Differential Privacy on Embeddings | ✅ | ❌ | ❌ | ❌ |
| Intent Validation Pipeline | ✅ | ❌ | ❌ | ❌ |
| Cross-Model Handover (JWT) | ✅ | ❌ | partial | ❌ |
| Trust Quotient™ Scoring | ✅ | ❌ | ❌ | ❌ |
| Self-Healing on Recall | ✅ | ❌ | ❌ | ❌ |
| MCP Native | ✅ | ❌ | ❌ | ❌ |
| Open SDK (Apache 2.0) | ✅ | ✅ | partial | ✅ |
| Zero-Knowledge Guarantee | ✅ | ❌ | ❌ | ❌ |
Cognitive Security Pipeline
Every memory passes through four proprietary security layers before persistence:
Agent → Sanitize (PII) → Validate Intent → Encrypt (AES-256) → DP Noise → Vault
↓ ↓ ↓
Semantic Privacy Guard™ Intelligent Intent Differential Privacy
Validation™ (Gaussian, ε-bounded)
Seal 1 — Semantic Privacy Guard™
PII is detected and removed at the semantic level before encryption. 12 precompiled regex patterns cover emails, phone numbers, SSNs, credit cards, Bearer tokens, AWS keys, and more. Aggressive mode strips proper nouns to prevent name-based correlation attacks.
memory = SynapseMemory(agent_id="secure-agent", aggressive_sanitize=True)
await memory.store("John Smith's SSN is 123-45-6789", confidence=0.9)
# Stored content: "[REDACTED_NAME]'s SSN is [REDACTED_SSN]"
# SHA-256 hash of each redacted item preserved for forensic audit
Seal 2 — Differential Privacy
Calibrated Gaussian noise is injected into embedding vectors before storage. This prevents semantic inference attacks — even with database access, the original semantic fingerprint cannot be reconstructed.
memory = SynapseMemory(agent_id="dp-agent", privacy_epsilon=0.5)
# σ = Δf · √(2·ln(1.25/δ)) / ε
# L2 normalization post-noise preserves cosine similarity semantics
# SNR metric included in audit payload
Seal 3 — Intelligent Intent Validation™
Two-step cognitive security: the agent suggests an intent category, then Synapse validates it independently.
| Category | Description | Auto-Critical |
|---|---|---|
PREFERENCE |
Taste, style, language, tone | — |
FACT |
Verified knowledge, research, data | — |
PROCEDURAL |
Steps, workflows, protocols | — |
BIO |
Personal info, identity, demographics | — |
EPHEMERAL |
Session-scoped, transient context | — |
CRITICAL |
Security, compliance, legal, financial | ✅ |
Confidence Contract:
confidence ≥ 0.85→source_type = "validated"confidence < 0.85→source_type = "inference"+ warning- Critical keyword detected →
confidence_boost = 1.0, forcedCRITICAL
Self-Healing: During recall(), semantically proximate memories with conflicting categories are automatically reclassified via keyword consensus.
result = await memory.store("Security breach in auth system", confidence=0.5)
assert result.validation_details['source_type'] == 'critical_override'
assert result.validation_details['is_critical'] is True
# Self-healing on recall
results = await memory.recall("security events")
for item in results:
if item.self_healing:
print(f"⚕️ {item.self_healing.original_category} → {item.self_healing.new_category}")
Seal 4 — Persistence-First Neural Handover™
Secure, fault-tolerant context transfer between AI agents. Memories are vault-persisted before transmission — if the target agent crashes, nothing is lost.
from synapse_layer import SynapseMemory, HandoverStatus
agent_a = SynapseMemory(agent_id="gpt-4")
handover = agent_a.create_handover(target_agent="claude-3.5", user_id="user-123")
# JWT signed (HMAC-SHA256), persisted to Status Ledger as PENDING
agent_b = SynapseMemory(agent_id="claude-3.5")
package = agent_b.accept_handover(handover.handover_id)
# PENDING → ACCEPTED → COMPLETED
Status Ledger:
PENDING → ACCEPTED → COMPLETED (normal flow)
PENDING → FAILED (Emergency Checkpoint created)
PENDING → EXPIRED (grace period: summary returned)
Fault tolerance: fail_handover() creates an Emergency Checkpoint with full context snapshot. Grace period (15 min) auto-generates compact summaries instead of raw data.
Architecture
Your Agent → Synapse SDK → Sanitize → Validate Intent → Encrypt → DP Noise → Vault
↑ ↓
Self-Healing ← Recall ← Cosine Search ←
Cross-Agent: Agent A → create_handover() → JWT Token → Agent B → accept_handover()
↓
Status Ledger (Vault)
The server never sees plaintext. Embeddings are noise-injected before persistence. Handovers are vault-persisted before transmission.
See ARCHITECTURE.md for Mermaid diagrams and deep-dive.
Pricing
| Plan | Price | Memories | Includes |
|---|---|---|---|
| Free | $0 | 1,000/month | Core encryption, sanitization, community support |
| Pro | $29/mo | 100K/month | All Free + priority support, analytics, API access, advanced integrations |
| Enterprise | Custom | Unlimited | All Pro + dedicated support, custom SLA, on-premise, security audit |
Join the Waitlist
Early access to Synapse Forge — the visual memory debugger and agent orchestrator.
Benefits:
- 🔑 Early access to Forge (private beta)
- 📋 NDA-protected feature previews
- 🧪 Forge Live — real-time memory inspection
- 🧠 "Adopt an Agent" program access
- 💬 Direct channel with the core team
Status
| Component | Status |
|---|---|
| SDK (PyPI) | v1.0.6 — stable |
| Semantic Privacy Guard™ | ✅ Production |
| Differential Privacy | ✅ Production |
| Intelligent Intent Validation™ | ✅ Production |
| Persistence-First Neural Handover™ | ✅ Production |
| Trust Quotient™ | ✅ Production |
| MCP Server | ✅ Compatible |
| Synapse Forge | 🔜 Private Beta |
| CI/CD Pipeline | 🔄 In Progress |
Changelog (v1.0.6)
Added — Neural Handover™: Persistence-First Architecture
- NeuralHandover engine: Complete cross-agent context transfer with vault-first persistence
create_handover()→ sanitize → validate → JWT sign → persist as PENDINGaccept_handover()→ verify JWT (HMAC-SHA256) → check TTL → COMPLETEDfail_handover()→ Emergency Checkpoint with full context snapshotget_latest_handover()→ auto-expiry + grace period summary
- HandoverStatus state machine: PENDING → ACCEPTED → COMPLETED | FAILED | EXPIRED
- JWT Tokenization: HMAC-SHA256 signed tokens with origin/target/scope/TTL
- Grace Period Protocol: 15-min window, auto-generates compact summary
- Emergency Checkpoint: Frozen context for recovery on target failure
Security
- HMAC-SHA256 token signatures — tampering is detectable
- Agent identity verification prevents unauthorized access
- Content sanitized and intent-validated before packaging
- All state transitions logged for GDPR/LGPD compliance
Security
See SECURITY.md for full architecture, key management, and compliance documentation (GDPR / LGPD / HIPAA ready).
License
Apache License 2.0 — see LICENSE.
Open-core model: SDK is fully open source. The Synapse Forge platform and advanced engine internals are proprietary.
Website · Forge · GitHub · PyPI
Built by Ismael Marchi
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file synapse_layer-1.0.6.tar.gz.
File metadata
- Download URL: synapse_layer-1.0.6.tar.gz
- Upload date:
- Size: 51.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3d32b0fab9a259a294563b8a8888cd1e258262cc59bbb8581bd0c5351915321d
|
|
| MD5 |
3bc203c9e0a60beaa7be39cd3aa4ec48
|
|
| BLAKE2b-256 |
d41b27eedad5e1fc15c0b285aaf96d6a829bac87ad5ce27e158501cd821466dd
|
File details
Details for the file synapse_layer-1.0.6-py3-none-any.whl.
File metadata
- Download URL: synapse_layer-1.0.6-py3-none-any.whl
- Upload date:
- Size: 41.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dc67ef59f53a6981269dfa7222f6d00375aa891693e61c6024f73fe2c964f16
|
|
| MD5 |
333af91167e7cd1911d201b80d477531
|
|
| BLAKE2b-256 |
baa8f30fd3781749dccfde936cc06bf4f61f50dd49ee3567414fef7bb0ccc402
|