Skip to main content

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 — Continuous Consciousness Infrastructure

Continuous Consciousness Infrastructure for AI Systems

Persistent. Secure. 1-line integration. 🧠

CI PyPI MCP Registry Smithery Docs License Tests Coverage

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


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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synapse_layer-1.1.2.tar.gz (89.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synapse_layer-1.1.2-py3-none-any.whl (82.1 kB view details)

Uploaded Python 3

File details

Details for the file synapse_layer-1.1.2.tar.gz.

File metadata

  • Download URL: synapse_layer-1.1.2.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

Hashes for synapse_layer-1.1.2.tar.gz
Algorithm Hash digest
SHA256 ad4cf3ebd3364621e35ed7caa9fc8766b9800c19ceafa0f81c7bda2f81d86ee2
MD5 6895d2966bf417f1cf45da7f3b7d135d
BLAKE2b-256 6230b30bb05f24d061c2b012a907e2c3e436485c02731877b46fd404f9a252a3

See more details on using hashes here.

Provenance

The following attestation bundles were made for synapse_layer-1.1.2.tar.gz:

Publisher: publish.yml on SynapseLayer/synapse-layer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file synapse_layer-1.1.2-py3-none-any.whl.

File metadata

  • Download URL: synapse_layer-1.1.2-py3-none-any.whl
  • Upload date:
  • Size: 82.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for synapse_layer-1.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d548887c0596be6f3d8b9d79b6fd90e15fa89543c0e3bfc8844fd1205c929c1a
MD5 22abcb66ee3178dc1f4498ce07486835
BLAKE2b-256 1da9f92fa2c2d06d846c5637c26a920522727405e34f4f81cec2f0c20ebb5969

See more details on using hashes here.

Provenance

The following attestation bundles were made for synapse_layer-1.1.2-py3-none-any.whl:

Publisher: publish.yml on SynapseLayer/synapse-layer

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page