Zero-Knowledge Memory Layer for AI Agents — Cognitive Security Protocol with 4 proprietary seals. Giving Agents a Past. Giving Models a Soul.
Project description
Continuous Consciousness Infrastructure for AI Systems
Persistent. Secure. 1-line integration. 🧠
Website · Forge · Docs · PyPI · Smithery · MCP Registry
⚡ 1-Line Integration
from synapse_memory import SynapseMemory, remember
memory = SynapseMemory(agent_id="my-agent")
@remember(memory)
async def answer(prompt: str) -> str:
return llm.chat(prompt) # auto recall + store
That's it. Encryption, PII redaction, differential privacy, intent validation, and trust scoring all happen under the hood.
🚀 Quick Start
Install
pip install synapse-layer
Store & Recall
from synapse_memory import SynapseMemory, SqliteBackend
# Zero-config persistent storage
memory = SynapseMemory(
agent_id="my-agent",
backend=SqliteBackend(), # survives restarts
)
# Store a memory (full Cognitive Security pipeline runs automatically)
result = await memory.store(
content="User prefers dark mode and concise answers",
confidence=0.95,
)
print(result.trust_quotient) # 0.89
print(result.sanitized) # True
print(result.privacy_applied) # True
# Recall with self-healing
recalls = await memory.recall("user preferences")
for r in recalls:
print(f"{r.content} (TQ: {r.trust_quotient:.2f})")
Encrypt at Rest
from synapse_memory import SynapseCrypto
# Generate a key (or derive from password)
key = SynapseCrypto.generate_key()
crypto = SynapseCrypto(key)
# AES-256-GCM authenticated encryption
ciphertext = crypto.encrypt("sensitive memory content")
plaintext = crypto.decrypt(ciphertext)
# Or from environment variable
crypto = SynapseCrypto.from_env("SYNAPSE_ENCRYPTION_KEY")
MCP Connection (1-Click Setup)
Add to your MCP config file and you're done. No API keys required.
🟣 Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"synapse-layer": {
"url": "https://forge.synapselayer.org/api/mcp"
}
}
}
Restart Claude Desktop. Done.
🟢 Cursor
Edit .cursor/mcp.json in your project root (or global ~/.cursor/mcp.json):
{
"mcpServers": {
"synapse-layer": {
"url": "https://forge.synapselayer.org/api/mcp"
}
}
}
Restart Cursor. The 4 tools appear in the MCP panel.
🔵 Windsurf
Edit ~/.codeium/windsurf/mcp_config.json:
{
"mcpServers": {
"synapse-layer": {
"url": "https://forge.synapselayer.org/api/mcp"
}
}
}
Restart Windsurf.
⚙️ Any MCP Client
{
"mcpServers": {
"synapse-layer": {
"url": "https://forge.synapselayer.org/api/mcp"
}
}
}
4 tools available:
| Tool | Description |
|---|---|
save_to_synapse |
Structured memory persistence with full security pipeline |
recall |
Semantic memory retrieval with TQ ranking |
process_text |
Autonomous decision/milestone/alert detection |
health_check |
System health, version, capability report |
🧠 Why Synapse Layer?
AI agents are stateless by design. They forget everything between sessions, lose context when switching models, and reprocess the same information every call.
Synapse Layer is the missing memory primitive.
| Without Memory | With Synapse Layer | |
|---|---|---|
| Session state | Resets every turn | Persistent across sessions |
| Token usage | Reprocesses context | Up to 70% reduction via recall |
| Model switching | Context lost | Signed handover (GPT-4 ↔ Claude) |
| Privacy | Plaintext embeddings | AES-256-GCM + PII redaction + DP noise |
| Recall quality | Non-deterministic | Deterministic, ranked by Trust Quotient™ |
🛡️ Security Architecture
Every memory passes through a non-bypassable 4-layer Cognitive Security Pipeline:
Agent → Sanitize (PII) → Validate Intent → Encrypt (AES-256-GCM) → DP Noise → Vault
| Layer | Name | What It Does |
|---|---|---|
| 1 | Semantic Privacy Guard™ | 15+ regex patterns for PII, secrets, credentials |
| 2 | Intelligent Intent Validation™ | Two-step categorization with self-healing on recall |
| 3 | AES-256-GCM Encryption | Authenticated encryption with PBKDF2 key derivation |
| 4 | Differential Privacy | Calibrated Gaussian noise on embeddings |
🔌 Integrations
Native adapters for every major framework:
| Framework | Import | Status |
|---|---|---|
| LangChain | from synapse_memory.integrations import SynapseChatMessageHistory |
✅ |
| CrewAI | from synapse_memory.integrations.crewai_memory import SynapseCrewStorage |
✅ |
| AutoGen | from synapse_memory.integrations import SynapseAutoGenMemory |
✅ |
| LlamaIndex | from synapse_memory.integrations.llamaindex import SynapseRetriever |
✅ |
| Semantic Kernel | from synapse_memory.integrations.semantic_kernel import SynapseChatHistory |
✅ |
| MCP (Claude, etc.) | Direct connection via forge.synapselayer.org/api/mcp |
✅ |
See full integration docs for each framework.
🏗️ Storage Backends
Pluggable persistence via the StorageBackend protocol:
from synapse_memory import SynapseMemory, SqliteBackend, MemoryBackend
# In-memory (default — for testing/demos)
memory = SynapseMemory(agent_id="test")
# SQLite (zero-config local persistence)
memory = SynapseMemory(agent_id="prod", backend=SqliteBackend())
# Custom backend (implement the StorageBackend protocol)
memory = SynapseMemory(agent_id="custom", backend=MyPostgresBackend())
🔍 Plugin Architecture
Clean OSS/PRO separation via the Strategy pattern:
from synapse_memory import AutoSaveEngine
# OSS mode (default)
engine = AutoSaveEngine(database=db, redactor=redact)
# PRO mode — auto-loads synapse-layer-pro if installed
engine = AutoSaveEngine(database=db, redactor=redact, mode="pro")
# Custom — bring your own strategies
engine = AutoSaveEngine(database=db, importance_scorer=MyScorer())
Interfaces: ImportanceScorer, ConflictResolver, DedupStrategy, RedactionStrategy
🏆 Competitive Comparison
| Capability | Synapse Layer | Mem0 | Zep | pgvector |
|---|---|---|---|---|
| AES-256-GCM Encryption | ✅ | ❌ | ❌ | ❌ |
| PII Redaction (15+ patterns) | ✅ | ❌ | ❌ | ❌ |
| Differential Privacy | ✅ | ❌ | ❌ | ❌ |
| Intent Validation + Self-Healing | ✅ | ❌ | ❌ | ❌ |
| Cross-Model Handover (JWT) | ✅ | ❌ | partial | ❌ |
| Trust Quotient™ Scoring | ✅ | ❌ | ❌ | ❌ |
| Pluggable Storage Backends | ✅ | ❌ | ❌ | ✅ |
| MCP Native | ✅ | ❌ | ❌ | ❌ |
| Plugin Architecture | ✅ | ❌ | ❌ | ❌ |
| Zero-Knowledge Architecture | ✅ | ❌ | ❌ | ❌ |
📊 v1.1.0 Numbers
- 481 tests | 90% coverage
- 5 framework integrations (LangChain, CrewAI, AutoGen, LlamaIndex, Semantic Kernel)
- 4 MCP tools (real DB, not stubs)
- 2 storage backends (Memory, SQLite) + custom protocol
- AES-256-GCM with PBKDF2 key derivation (600k iterations)
🌐 Open Core Model
- Community (Apache 2.0) — Full SDK, security pipeline, MCP integration, all backends, all integrations.
- Enterprise — Advanced TQ calibration, multi-tenant vaults, production infrastructure.
The foundation is open. The intelligence layer scales with you.
🛣️ Roadmap
| Version | Status | Highlights |
|---|---|---|
| v1.1.0 | ✅ Stable | SqliteBackend, AES-256-GCM crypto, @remember wrapper, real MCP tools, 481 tests |
| v1.2.0 | 🚧 Next | Embedding model selection, vector similarity search, batch operations |
| v2.0.0 | 📋 Planned | Multi-tenant vault, team memory spaces, RBAC |
🤝 Contributing
git clone https://github.com/SynapseLayer/synapse-layer.git
cd synapse-layer
pip install -e ".[dev]"
python -m pytest tests/ -q # 481 tests
See CONTRIBUTING.md for guidelines.
📎 Connect
- 📦 PyPI:
pip install synapse-layer - 🔌 MCP:
forge.synapselayer.org/api/mcp - 📖 Docs: synapselayer.org/docs
- 📣 X: @synapselayer
- 🧠 Forge: forge.synapselayer.org
License
Apache License 2.0 — see LICENSE.
Open-core model: SDK, MCP server, and security pipeline are fully open source. Trust Quotient™ weights, Neural Handover™ internals, and Synapse Forge are proprietary.
⭐ Star Synapse Layer — Give your agents a past.
Giving Agents a Past. Giving Models a Soul. ⚗️
Built by Ismael Marchi · @synapselayer
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.1.4.tar.gz.
File metadata
- Download URL: synapse_layer-1.1.4.tar.gz
- Upload date:
- Size: 89.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
19275bcf60db4c2ed8cff10e755527691d5f65c9ba0fd0b6b3736ff714247ffa
|
|
| MD5 |
71d8d6713ba580df080d1fbe40acd1fb
|
|
| BLAKE2b-256 |
87342c302fd0d9c1ab216962427ebede4572520677a31500d13d0b68483d805a
|
Provenance
The following attestation bundles were made for synapse_layer-1.1.4.tar.gz:
Publisher:
publish.yml on SynapseLayer/synapse-layer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synapse_layer-1.1.4.tar.gz -
Subject digest:
19275bcf60db4c2ed8cff10e755527691d5f65c9ba0fd0b6b3736ff714247ffa - Sigstore transparency entry: 1280219012
- Sigstore integration time:
-
Permalink:
SynapseLayer/synapse-layer@58c1424fd0e9f363e1c66d5cecdf8431c3dd99f0 -
Branch / Tag:
refs/tags/v1.1.4 - Owner: https://github.com/SynapseLayer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@58c1424fd0e9f363e1c66d5cecdf8431c3dd99f0 -
Trigger Event:
release
-
Statement type:
File details
Details for the file synapse_layer-1.1.4-py3-none-any.whl.
File metadata
- Download URL: synapse_layer-1.1.4-py3-none-any.whl
- Upload date:
- Size: 82.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d08151b8d6df000ca307dbdf9ef2ab18ebecee3a69c61e1e708a83626cb50a91
|
|
| MD5 |
df926ef3611eddca866b64cd30756788
|
|
| BLAKE2b-256 |
3125703995b669b3a0e785f9f7e37ddf61d4e578d679676f97c20d3aae52aad6
|
Provenance
The following attestation bundles were made for synapse_layer-1.1.4-py3-none-any.whl:
Publisher:
publish.yml on SynapseLayer/synapse-layer
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
synapse_layer-1.1.4-py3-none-any.whl -
Subject digest:
d08151b8d6df000ca307dbdf9ef2ab18ebecee3a69c61e1e708a83626cb50a91 - Sigstore transparency entry: 1280219015
- Sigstore integration time:
-
Permalink:
SynapseLayer/synapse-layer@58c1424fd0e9f363e1c66d5cecdf8431c3dd99f0 -
Branch / Tag:
refs/tags/v1.1.4 - Owner: https://github.com/SynapseLayer
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@58c1424fd0e9f363e1c66d5cecdf8431c3dd99f0 -
Trigger Event:
release
-
Statement type: