Documentation

Synapse Layer Docs

Technical reference for AI Memory Infrastructure. AES-256-GCM encryption, OAuth 2.0 + PKCE, and MCP protocol.

Get Started in 2 Minutes

Install

pip install synapse-layer

Store a Memory (Python)

from synapse_layer import SynapseClient

# API key from Forge (starts with sk_)
client = SynapseClient(api_key="sk_...")
client.remember("User prefers dark mode")
memory = client.recall("user preferences")

Store a Memory (cURL)

curl -X POST https://forge.synapselayer.org/api/v1/capture \
  -H "Authorization: Bearer sk_..." \
  -H "Content-Type: application/json" \
  -d '{"content": "User prefers dark mode", "agent": "my-agent"}'

How It Works

Synapse Layer provides an AES-256-GCM encrypted memory layer accessible via MCP protocol and REST API. Memories are encrypted server-side before storage in PostgreSQL.

Search and recall operate over indexed metadata and derived fields. Memory content remains encrypted at rest (AES-256-GCM) and is decrypted only for authorized responses. Conflict resolution runs via TRUTH QUOTIENT™ scoring on metadata.

Agent Boundary
plaintext input
POST /api/v1/capture
Bearer token auth
recall via MCP or REST
Server Boundary
AES-256-GCM encrypt
stores: [encrypted blob]
SHA-256 content dedup
search on indexed metadata
returns: decrypted content
✘ zero plaintext tokens in DB

Security — Tested Controls

Every security control below is implemented, audited, and production-tested. Public components are available on GitHub. Features marked 🔜 are planned.

01

AES-256-GCM Encryption

All memory content encrypted at rest with unique 96-bit IV per operation. Authentication tag verifies integrity.

02

OAuth 2.0 + PKCE S256

Synapse Connect™ uses PKCE S256 mandatory flow. Auth codes are SHA-256 hashed, single-use, 10min TTL.

03

SQL Injection Protection

All queries use Prisma parameterized queries. Zero raw SQL interpolation.

04

Token Security

All API tokens (sk_connect_*) stored as SHA-256 hashes. Zero plaintext in the database. Scope enforcement on every request.

Core API

POST /api/v1/capture

Store a memory. Requires Bearer token. Content is AES-256-GCM encrypted and stored with SHA-256 deduplication.

MCP recall tool

Recall memories via MCP JSON-RPC. Returns decrypted content matching the query.

MCP search tool

Search memories via MCP JSON-RPC. Search on indexed metadata and derived fields.

POST /api/connect/authorize

OAuth 2.0 authorization endpoint. Requires PKCE S256 code challenge.

POST /api/connect/token

Exchange auth code for Bearer token. PKCE verifier required.

MCP Server Configuration

Synapse Layer is MCP-native. Connect any MCP-compatible client (Claude Desktop, Cursor, custom agents) to the memory server. Tools exposed: health_check, recall, search, store.

Framework agnostic — memories stored via one MCP-compatible client can be recalled from any other using the same API key.

Claude Desktop / Cursor Config

{
  "mcpServers": {
    "synapse-layer": {
      "url": "https://synapselayer.org/api/mcp",
      "headers": {
        "Authorization": "Bearer sk_..."
      }
    }
  }
}

🚀 Roadmap Synapse Layer

Synapse Layer constrói a infraestrutura para memória persistente em IA.

Enquanto sistemas tradicionais apenas recuperam dados (RAG), o Synapse Layer permite que agentes realmente lembrem, evoluam e mantenham contexto ao longo do tempo.

RAG recupera. Synapse lembra.

✅ Infraestrutura Core — Entregue

• Criptografia AES-256-GCM em repouso
• Protocolo MCP JSON-RPC nativo
• API REST + SDK Python oficial
• Agnóstico de framework (Claude, Cursor, LangChain via MCP)
• OAuth 2.0 + PKCE S256 (Synapse Connect™)
• Deduplicação de conteúdo via SHA-256
• Camada de memória semântica pgvector (Beta) ✅
• Motor de estado cognitivo persistente (C5.1.2) ✅

🔄 Inteligência & Experiência — Em progresso

• UI de tela de consentimento (Refinamento de UX Synapse Connect™)
• Otimização de ranking de memória (semântica + recência + escopo)
• Orquestração de memória entre múltiplos agentes
• Camada de observabilidade (latência, precisão de recall, rastreabilidade)
• Expansão de cobertura semântica e backfill de embeddings

🔐 Segurança & Confiança — Em progresso

• Pipeline de testes de segurança automatizados
• Logs de auditoria e acesso rastreável à memória
• Hardening de ciclo de vida de tokens
• Validação de criptografia e políticas fail-closed

🌍 Enterprise & Escala — Planejado

• Isolamento de memória multi-tenant
• Camada avançada de redação de PII (dados sensíveis)
• Suporte a residência de dados regional
• SLAs de nível enterprise e monitoramento dedicado

🧠 Evolução da Camada Cognitiva — Planejado

• Camada de raciocínio sobre memória (além da recuperação)
• Compressão de contexto de longo prazo
• Priorização autônoma de memórias
Handover de Agente Criptografado (V2) — transferência de contexto entre agentes com token SHA-256 de uso único, conteúdo criptografado com AES-256-GCM em repouso e trânsito seguro via TLS/SSL. Eventos críticos registrados em auditoria (Forge Log).