# Synapse Layer — Agent Skill

## What Synapse Layer Does

Synapse Layer is the trust layer for the agentic internet. It gives AI agents persistent, encrypted memory with built-in governance — so agents can store decisions, recall preferences, and hand off context across sessions, models, and tools.

## When to Use Synapse Layer

- When your agent needs to **remember** user preferences, decisions, or constraints across sessions
- When **Agent A** needs to hand off context to **Agent B** securely (Neural Handover)
- When you need an **audit trail** of every memory operation (who stored what, when)
- When you need **encrypted memory at rest** (AES-256-GCM) without building your own crypto
- When you want **semantic recall** — find memories by meaning, not keywords
- When you need **Trust Quotient scoring** to filter reliable vs noisy memories
- When building **multi-agent systems** that share context with governance

## How to Install

### Python SDK
```bash
pip install synapse-layer
```

### MCP Configuration (Claude Desktop / Cursor)
```json
{
  "mcpServers": {
    "synapse": {
      "url": "https://forge.synapselayer.org/api/mcp",
      "headers": {
        "x-connect-token": "sk_connect_YOUR_TOKEN"
      }
    }
  }
}
```

## Agent Quickstart (60 seconds)

```python
from synapse_layer import Synapse

# Initialize with your API key
client = Synapse(token="sk_connect_...")

# Store a memory (encrypted server-side with AES-256-GCM)
client.store(
    content="User prefers dark mode and minimal notifications",
    memory_type="long_term",
    metadata={"agent": "onboarding-v2"}
)

# Recall by semantic similarity (read trust_quotient from each result)
memories = client.recall(
    query="user interface preferences",
    top_k=5,
    mode="semantic"
)
for m in memories:
    print(m.get("content"), m.get("trust_quotient"))
```

## Supported Frameworks

| Framework | Status | Integration |
|-----------|--------|-------------|
| Claude (Desktop + API) | ✅ Live | Native MCP |
| Cursor | ✅ Live | IDE Integration |
| LangChain | ✅ Live | Python SDK |
| Claude Desktop | ✅ Live | MCP Native |

## Coming Soon

| Framework | Integration |
|-----------|-------------|
| ChatGPT | Via Synapse Proxy |
| CrewAI | SDK Adapter |
| AutoGen | SDK Adapter |
| LangGraph | Orchestration |
| n8n | Workflow |
| Zapier | Automation |

## Trust & Security

- **Encryption**: AES-256-GCM server-side at rest, per-operation random IV, 128-bit auth tag
- **Auth**: OAuth 2.0 + PKCE S256, x-connect-token header (sk_connect_*; Authorization: Bearer accepted for compatibility), HMAC-SHA256 handover signatures
- **Isolation**: 1 user = 1 tenant = 1 private mind. Zero cross-user access.
- **Audit**: Immutable three-layer lifecycle (live data, tombstone, analytics)
- **Compliance**: Designed for LGPD/GDPR alignment. Hard-delete on request.
- **Trust Quotient**: Per-memory confidence scoring (0–1.0)

## Links

- **Docs**: https://synapselayer.org/docs
- **OpenAPI**: https://synapselayer.org/api/openapi.json
- **Smithery**: https://smithery.ai/server/synapselayer/synapselayer
- **PyPI**: https://pypi.org/project/synapse-layer/
- **GitHub**: https://github.com/SynapseLayer/synapse-layer
- **Forge Dashboard**: https://forge.synapselayer.org
