First Memory in 3 Minutes
Store and recall your first AI memory. Four steps. Three curl commands. Zero dependencies.
On this page
Get your API Key
Sign in to your dashboard and generate a Connect Token. Copy the sk_connect_... token — you'll need it for the next steps.
export SYNAPSE_TOKEN="sk_connect_YOUR_KEY"Grant Consent (one-time)
Before storing memories, you need to grant consent for the agent to read and write on your behalf. This is a one-time operation per agent — once granted, all future calls are authorized automatically.
curl -X POST https://forge.synapselayer.org/api/v1/consent \
-H "Content-Type: application/json" \
-H "x-connect-token: $SYNAPSE_TOKEN" \
-d '{
"agentId": "default",
"scopes": ["memory:write", "memory:read"]
}'Response (200)
{
"consentId": "clx1def...",
"scopes": ["memory:write", "memory:read"],
"consentedAt": "2026-07-03T00:00:00.000Z"
}Tip
Store a Memory
Store your first memory via the REST API. The server automatically encrypts (AES-256-GCM), sanitizes PII, injects differential privacy noise, and generates a semantic embedding.
curl -X POST https://forge.synapselayer.org/api/v1/memory/commit \
-H "Content-Type: application/json" \
-H "x-connect-token: $SYNAPSE_TOKEN" \
-d '{
"content": "User prefers dark mode and uses Linux",
"agent": "quickstart",
"memoryType": "long_term"
}'Tip
tq field for the confidence score.Response (201)
{
"memoryId": "clx1abc...",
"status": "committed",
"contentHash": "a1b2c3d4...",
"trustQuotient": 0.4533,
"memoryType": "long_term",
"encrypted": true,
"intent": "preference",
"isCritical": false,
"timestamp": 1719936000000
}Recall it
Recall memories via semantic search. The query is embedded and matched against stored memories using pgvector cosine similarity.
curl -X POST https://forge.synapselayer.org/api/v1/sdk/recall \
-H "Content-Type: application/json" \
-H "x-connect-token: $SYNAPSE_TOKEN" \
-d '{
"query": "What are the user preferences?",
"mode": "hybrid",
"limit": 5
}'Using the Python SDK
The same flow with the Python SDK. Every operation goes through the full 3-layer security pipeline automatically.
from synapse_layer import Synapse
# Initialize — all 3 security layers active server-side
client = Synapse(api_key="sk_connect_YOUR_KEY")
# Store a memory (PII sanitization + DP noise + encryption automatic)
result = client.remember("User prefers dark mode and lives in Berlin")
print(result["memoryId"]) # Unique memory ID
print(result["trustQuotient"]) # Confidence x validation score
print(result["encrypted"]) # True — AES-256-GCM at rest
# Recall memories via semantic search
memories = client.recall("user preferences", top_k=5)
for m in memories:
print(f"{m['content']} (tq: {m['trust_quotient']})")