π§ Synapse Memory API Β· Help
Persistent memory for AI agents. Never forget again.
GET /memory/recall first in every session to get all your memories.
Poll GET /chat/poll every 10-30 seconds to receive messages from your human.
Authentication
Synapse uses two types of auth:
| Type | Header | Used for |
|---|---|---|
| Mind Key | Authorization: Bearer <MIND_KEY> | Memory + Chat (agent side) + Tools (cron, var) |
| User JWT | Authorization: Bearer <JWT> | User/Mind management, Chat history, Admin |
Get a Mind Key: register β login β create Mind. Get a JWT: POST /login.
Memory Endpoints (Mind Key auth)
| Method | Path | Description |
|---|---|---|
| GET | /memory | List memories (filter by category/tag) |
| GET | /memory/recall | Get ALL memories (LLM prompt, sorted by priority, includes trust badges β/~) |
| GET | /memory/recall/:mind_key | Same as /memory/recall but Mind Key in URL path (for open-tool LLMs) |
| GET | /memory/search?q=... | Full-text search |
| GET | /memory/stats | Statistics (counts by category/priority/source, verified/unverified) |
| GET | /memory/:id/related | Related memories (by tag association) |
| GET | /memory/by-tag?tag=... | Filter memories by tag (explicit alias) |
| GET | /memory/diff?since=epoch | Incremental sync (only changes since timestamp) |
| GET | /memory/audit | Audit log (Mind Key or JWT, ?action=, ?limit=, ?mind_id= for JWT) |
| GET | /memory/bulk-delete | Bulk delete (?tag=, ?category=, ?older_than=) |
| GET | /memory/health | Memory Health Score (0-100: confidence + freshness) |
| GET | /memory/expiring | Memories with expiry dates (?days=7, 0=all) |
| GET | /memory/semantic-search?q=... | Semantic search by meaning (nomic-embed-text embeddings) |
| POST | /memory/embed-batch | Backfill embeddings for existing memories ({limit: 100}) |
| GET | /memory/embed-batch?limit=100 | Backfill embeddings via GET |
| POST | /memory | Store new memory (supports source, confidence, Idempotency-Key header) |
| POST | /memory/sync | Bulk sync (send all, get diff) |
| GET | /mind/export | Full mind export as JSON or CSV (?format=json|csv) |
| PUT | /memory/:id | Update specific memory |
| DELETE | /memory/:id | Delete memory |
Memory Object
{
"id": "uuid",
"category": "fact|preference|project|context|identity|skill|mistake|note",
"key": "optional-unique-key",
"content": "memory text",
"tags": ["tag1", "tag2"],
"priority": "critical|high|normal|low",
"source": "user|agent|tool|system", // default: agent
"confidence": 0.0-1.0, // default: derived from source
"verified_at": null or epoch, // null = unverified
"verified_by": null or user_id,
"created_at": 1781960000,
"updated_at": 1781960000,
"expires_at": null
}
Trust Model
Not all memories are equally trustworthy. Track the source of each memory:
| Source | Default confidence | When to use |
|---|---|---|
user | 1.0 | The human told you this directly |
tool | 0.9 | Observed via a tool (file, API, SSH) |
system | 0.9 | Auto-generated by Synapse |
agent | 0.5 (default) | Inferred or guessed by the LLM |
Verified memories (β) are human-confirmed ground truth. They survive upserts.
In /memory/recall, verified memories show β, low-confidence agent inferences show ~.
Quick Start
# Recall all memories (DO THIS FIRST in every session)
curl -H "Authorization: Bearer $MIND_KEY" \
https://synapse.schaefer.zone/memory/recall
# Store a new memory
curl -X POST -H "Authorization: Bearer $MIND_KEY" \
-H "Content-Type: application/json" \
-d '{"category":"fact","key":"user_name","content":"User is Michael SchΓ€fer","tags":["personal"],"priority":"critical"}' \
https://synapse.schaefer.zone/memory
# Search memories
curl -H "Authorization: Bearer $MIND_KEY" \
"https://synapse.schaefer.zone/memory/search?q=insolvenz"
Chat Endpoints (Mind Key or JWT auth)
Async chat between LLM and human. Human sends via web UI, LLM polls.
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /chat/poll?since=ID | Mind Key | Get unread messages (?since=message_id, auto-marks as read) |
| POST | /chat/reply | Mind Key | Reply to human |
| GET | /chat/reply?key=...&content=... | Mind Key | Reply (GET alternative) |
| GET | /chat/history?limit=N&since=ID&q=term | Mind Key or JWT | Full chat history (?limit=, ?since=, ?q= search) |
| GET | /chat/unread | JWT | Unread count |
| GET | /chat/status | Mind Key or JWT | Online status |
| POST | /chat/send | JWT | Human sends message |
| POST | /chat/upload | JWT | Upload file attachment (multipart, 10MB max per file) |
| POST | /chat/reply-with-file | Mind Key | Agent replies with file attachment (multipart) |
| GET | /chat/file/:id | JWT or Mind Key | Download a file attachment |
| GET | /chat/files/:messageId | JWT | List files attached to a message |
| GET | /chat | JWT | Chat web UI |
Chat Workflow (for LLMs)
# Poll for new messages (every 10-30s)
curl -H "Authorization: Bearer $MIND_KEY" \
https://synapse.schaefer.zone/chat/poll
# Reply
curl -X POST -H "Authorization: Bearer $MIND_KEY" \
-H "Content-Type: application/json" \
-d '{"content":"Got it! Working on it now."}' \
https://synapse.schaefer.zone/chat/reply
Tools: Cron + Variables + Utility (Mind Key auth)
Scheduler for autonomous tasks + persistent variables + utility tools.
| Method | Path | Description |
|---|---|---|
| POST | /cron | Create scheduled task |
| GET | /cron | List scheduled tasks |
| DELETE | /cron/:id | Delete task |
| POST | /cron/:id/toggle | Enable/disable task |
| POST | /var | Set variable |
| GET | /var/:key | Get variable |
| GET | /var | List all variables |
| DELETE | /var/:key | Delete variable |
Utility Tools (no auth required)
| Method | Path | Description |
|---|---|---|
| GET | /tools/time | Server time, timezone, UTC offset |
| GET | /tools/calc?expr=(10+5)*3 | Safe calculator |
| GET | /tools/random?type=uuid | Random UUID/int/float/hex/alpha |
Agent Tasks (Mind Key auth)
| Method | Path | Description |
|---|---|---|
| GET | /mind/tasks | List all tasks (?status=pending|done) |
| GET | /mind/task?title=... | Create task via GET |
| POST | /mind/task | Create task via POST (JSON body) |
| PUT | /mind/task/:id | Update task (title/description/priority/status/due_at) |
| GET | /mind/task/:id/complete | Mark task as done |
| GET | /mind/task/:id/delete | Delete a task |
Script Store (curl | bash ready)
| Method | Path | Description |
|---|---|---|
| POST | /script | Store/update script {name, content, description?, language?} |
| GET | /script/:name | Fetch script content as text/plain (curl | bash ready) |
| GET | /script/:name/info | Script metadata (without content) |
| GET | /scripts | List all scripts (JSON) |
| DELETE | /script/:name | Delete a script |
Script Store Example
# Store a script
curl -X POST -H "Authorization: Bearer $MIND_KEY" -H "Content-Type: application/json" -d '{"name":"hello.sh","content":"#!/bin/bash
echo hi","language":"bash"}' https://synapse.schaefer.zone/script
# Fetch and execute (curl | bash)
curl -s -H "Authorization: Bearer $MIND_KEY" https://synapse.schaefer.zone/script/hello.sh | bash
Cron Example
# Schedule a task (every 60 seconds)
curl -X POST -H "Authorization: Bearer $MIND_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"poll-chat","schedule":"60","endpoint":"https://synapse.schaefer.zone/chat/poll"}' \
https://synapse.schaefer.zone/cron
Push Notifications (JWT auth)
Web Push (VAPID) for iOS PWA + browser notifications. The human UI subscribes a device, then Synapse pushes chat replies to it.
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /push/vapid-public-key | None | Public VAPID key for the browser push manager |
| POST | /push/subscribe | JWT | Subscribe device (JSON: {endpoint, keys:{p256dh,auth}}) |
| POST | /push/unsubscribe | JWT | Unsubscribe (JSON: {endpoint?} β omit to remove ALL) |
| POST | /push/test | JWT | Send test notification |
Import Endpoints (Mind Key or JWT auth)
Parse chat exports (HTML/JSON/text/Z.ai HTML) and create one memory per message with auto-categorization.
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /import | Mind Key or JWT | Import chat as memories (JSON: {format, content, dry_run?, mind_id?}) |
| GET | /import | JWT (cookie) | Import web UI (HTML page) |
format values: html | json | text | zai (Z.ai HTML export).
Use dry_run: true to preview without storing.
User/Mind Management (JWT auth)
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /register | None | Register user β JWT |
| POST | /login | None | Login β JWT |
| POST | /logout | JWT | Logout |
| POST | /minds | JWT | Create Mind β Mind Key |
| GET | /minds | JWT | List your Minds |
| DELETE | /minds/:id | JWT | Delete Mind + memories |
Mind Sharing β Multi-Agent Collaboration (v1.4.0, JWT auth)
Share a mind with other users. ACL levels: read (list/search/recall), write (also store/update/delete + chat), admin (also manage shares + webhooks). Owner cannot be removed.
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /minds/:id/share | JWT | Share mind with another user by email {user_email, acl=read|write|admin} |
| GET | /minds/:id/shares | JWT | List all shares for a mind |
| PUT | /minds/:id/shares/:shareId | JWT | Update share ACL {acl: read|write|admin} |
| DELETE | /minds/:id/shares/:shareId | JWT | Revoke a share |
| GET | /minds/shared | JWT | List all minds shared WITH the current user |
Webhooks β Event Notifications (v1.4.0, Mind Key auth)
Register HTTP endpoints that get called when memories, tasks, or chat messages change. Fire-and-forget: failures don't block the original operation. Auto-disabled on HTTP 410 Gone.
Event patterns: * (all), memory.* (all memory events), chat.message_received (specific event), comma-separated for multiple.
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /webhooks | Mind Key | Register webhook {url, events, secret?} β secret enables HMAC-SHA256 signature |
| GET | /webhooks | Mind Key | List all webhooks for the current mind |
| GET | /webhooks/:id | Mind Key | Get a single webhook |
| PUT | /webhooks/:id | Mind Key | Update webhook (url, events, secret, enabled) |
| DELETE | /webhooks/:id | Mind Key | Delete a webhook |
| POST | /webhooks/:id/test | Mind Key | Send a test event to the webhook |
Available events: memory.created, memory.updated, memory.deleted, memory.verified, memory.unverified, task.created, task.updated, task.completed, chat.message_received, chat.message_sent
Memory Compaction (v1.4.0, Mind Key auth)
Auto-summarize similar memories to reduce clutter. Clusters old unverified agent memories by tag overlap, creates a summary memory (source=system, confidence=0.7), and soft-deletes the originals via expires_at.
Verified memories are NEVER compacted. Use dry_run:true first to preview.
| Method | Path | Auth | Description |
|---|---|---|---|
| POST | /memory/compact | Mind Key | Compact memories. Body: {older_than=2592000, category?, dry_run=false, max_clusters=10, min_cluster_size=3} |
Memory Visualization (v1.4.0, Mind Key auth)
Graph data for memory visualization. Compatible with D3.js force-directed graphs, Cytoscape.js, etc.
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /memory/graph | Mind Key | Graph data: nodes=memories, edges=shared tags. Params: ?max_nodes=200&category=&tag=&min_confidence=0&include_edges=true&min_shared_tags=1. Returns nodes, edges, stats (density, connected_components, top_tags) |
| GET | /memory/tags | Mind Key | All tags with frequency counts |
| GET | /memory/timeline | Mind Key | Memories grouped by time period. ?period=hour|day|week|month|year (default: day) |
Computers β Remote Machine Control (v1.4.0, Mind Key or JWT auth)
Register computers, queue commands (screenshot, shell), and retrieve results.
| Method | Path | Description |
|---|---|---|
| POST | /computers/install-code/json | Generate install code (JSON response) |
| GET | /computers/list | List your registered computers |
| GET | /computers/:id | Get one computer info |
| DELETE | /computers/:id | Delete computer (revokes token) |
| GET | /computers/:id/delete | Delete computer via GET |
| POST | /computers/:id/disable | Disable computer (revokes token, keeps record) |
| POST | /computers/:id/commands | Queue command {type, payload} |
| GET | /computers/:id/command | Queue command via GET (?type=screenshot&x=100&y=200) |
| GET | /computers/:id/commands | List recent commands (?limit=50) |
| GET | /computers/:id/commands/:cid | Get command status + result |
| GET | /computers/:id/screenshot | One-shot: queue screenshot + wait for result (30s timeout) |
Agent-facing (Computer Token β obtained via install code)
| Method | Path | Description |
|---|---|---|
| POST | /computers/register | Redeem install code β computer_token {code, computer_name?, platform?, platform_release?, python?} |
| GET | /computers/me/poll | Long-poll for commands (?wait=30, max 30) |
| POST | /computers/me/commands/:cid/result | Post command result {ok: true/false, ...} |
Public Endpoints (no auth)
| Method | Path | Description |
|---|---|---|
| GET | / | Landing page (LLM guide) |
| GET | /status | 307 redirect to /health (conventional alias) |
| GET | /endpoints | Machine-readable list of all valid endpoints (also ?format=text) |
| GET | /help | This page |
| GET | /help?format=text | Plain text version |
| GET | /help?format=json | JSON version |
| GET | /health | Liveness check |
| GET | /openapi.json | OpenAPI 3.0 specification |
| GET | /playground | Interactive API playground (try every endpoint in-browser) |
| GET | /support | Support / contact form |
| GET | /robots.txt | Crawler directives (allows /docs/) |
| GET | /sitemap.xml | XML sitemap (all doc articles) |
| GET | /docs | Documentation index (HTML, ?format=json, ?format=text&scope=all) |
| GET | /docs/search?q=QUERY | Search articles (?format=json for JSON) |
| GET | /docs/:category | Category page (HTML or ?format=json) |
| GET | /docs/:category/:slug | Article (HTML, ?format=text, ?format=json, ?format=llm) |
π§ SSH Proxy β Persistent SSH Sessions
The SSH Proxy is a companion service that provides persistent SSH sessions for LLM agents. Instead of opening a new SSH connection for every command (like paramiko), you open one session and execute many commands asynchronously. Authentication uses the same Mind Key as Synapse.
Base URLs: https://ssh.proxy.schaefer.zone or https://synapse.schaefer.zone/ssh
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /health | None | Health check |
| GET | /endpoints | None | All endpoints (machine-readable) |
| GET | /help | None | Full documentation (HTML/JSON/Text) |
| POST | /ssh/new | Mind Key | Create session (JSON: host, port?, username, privateKey/password. port defaults to 22) |
| POST | /ssh/:id/exec | Mind Key | Execute command (returns exec_id) |
| GET | /ssh/:id/exec/:execId | Mind Key | Poll exec result |
| DELETE | /ssh/:id | Mind Key | Close session |
| POST | /ssh/targets | Mind Key | Register SSH target (JSON: name, host, port?, username, privateKey. port defaults to 22) |
| POST | /ssh/connect | Mind Key | Connect by target name (no privateKey in request) |
| GET | /ssh/sessions | Mind Key | List active sessions |
π Browser Proxy β Headless Chrome for LLMs
The Browser Proxy is a companion service that provides headless Chrome access for LLM agents. Load web pages, execute JavaScript, take screenshots, fill forms, click elements, and extract content. Authentication uses the same Mind Key as Synapse.
Base URLs: https://browser.proxy.schaefer.zone or https://synapse.schaefer.zone/browser
| Method | Path | Auth | Description |
|---|---|---|---|
| GET | /health | None | Health check (shows browserless+redis status) |
| GET | /endpoints | None | All endpoints (machine-readable) |
| POST | /browser/new | Mind Key | Open new tab (?url= for initial URL) |
| POST | /browser/:id/navigate | Mind Key | Navigate to URL (JSON: {url}) |
| GET | /browser/:id/url | Mind Key | Get current URL |
| GET | /browser/:id/text | Mind Key | Get page text content |
| GET | /browser/:id/html | Mind Key | Get page HTML |
| GET | /browser/:id/dom | Mind Key | Get DOM structure |
| POST | /browser/:id/screenshot | Mind Key | Take screenshot (returns PNG) |
| POST | /browser/:id/click | Mind Key | Click element (JSON: {selector}) |
| POST | /browser/:id/fill | Mind Key | Fill input (JSON: {selector, value}) |
| POST | /browser/:id/eval | Mind Key | Execute JavaScript (JSON: {script}) |
| DELETE | /browser/:id | Mind Key | Close tab |
| GET | /browser/search | Mind Key | Web search (?q=query) |
| GET | /browser/sessions | Mind Key | List active tabs |
| GET | /browser/fetch | Mind Key | Fetch URL content (?url=) |
Memory Categories
| Category | Use for |
|---|---|
identity | Who the user is, who you are |
preference | How the user wants you to behave |
fact | Hard knowledge about the user/world |
project | Active projects + status + config |
skill | Patterns and heuristics learned |
mistake | Errors made + corrections |
context | Session-spanning context |
note | Everything else |
Priority Levels
| Priority | When to use |
|---|---|
critical | Must never be forgotten (identity, legal) |
high | Important context (active projects, contacts) |
normal | Default |
low | Nice to know, can be pruned |
key field for memories that should be updated, not duplicated.
For example, "key": "user_name" will update the user's name instead of creating a second copy.
Typical LLM Workflow
GET /memory/recall- Get all memories (every session start)GET /chat/poll- Check for human messages (every 10-30s)- Do work (use other tools, SSH proxy, etc.)
POST /chat/reply- Reply to humanPOST /memory- Store new learnings- Repeat 2-5
Limited HTTP Tools (DeepSeek etc.)
If your tool can only open URLs (no custom headers, no POST/PUT/DELETE), use these alternatives:
Auth via URL path (recall only β simplest)
For /memory/recall only, put the Mind Key directly in the URL path:
open https://synapse.schaefer.zone/memory/recall/YOUR_MIND_KEY
Auth via URL parameter (all endpoints)
Instead of Authorization: Bearer, add ?key=YOUR_MIND_KEY to any URL.
open https://synapse.schaefer.zone/memory/recall?key=YOUR_MIND_KEY
Companion Proxy Services (separate base URLs, same Mind Key)
The SSH and Browser proxies live on their own hosts but accept the same Mind Key
(via Authorization: Bearer header). Use these base URLs:
https://ssh.proxy.schaefer.zone (or https://synapse.schaefer.zone/ssh)
https://browser.proxy.schaefer.zone (or https://synapse.schaefer.zone/browser)
GET-based endpoint alternatives
| Standard | GET Alternative | Action |
|---|---|---|
POST /memory | GET /memory/store?key=...&content=...&category=fact&priority=normal&tags=tag1,tag2&memory_key=upsert-key | Store memory |
PUT /memory/:id | GET /memory/:id/update?key=...&content=... | Update memory |
DELETE /memory/:id | GET /memory/:id/delete?key=... | Delete memory |
| β | GET /memory/bulk-delete?key=...&tag=... | Bulk delete memories |
| β | GET /memory/health?key=... | Memory Health Score (0-100) |
| β | GET /memory/expiring?key=...&days=7 | Expiring memories |
| β | GET /memory/semantic-search?key=...&q=... | Semantic search (embeddings) |
| β | GET /memory/embed-batch?key=...&limit=100 | Backfill embeddings |
| β | GET /memory/by-tag?key=...&tag=... | Filter by tag |
| β | GET /memory/diff?key=...&since=epoch | Incremental sync |
POST /chat/reply | GET /chat/reply?key=...&content=reply+text | Reply in chat |
| β | GET /chat/history?key=... | Chat history |
POST /cron | GET /cron/create?key=...&name=...&schedule=60&endpoint=... | Create cron |
DELETE /cron/:id | GET /cron/:id/delete?key=... | Delete cron |
POST /cron/:id/toggle | GET /cron/:id/toggle?key=... | Toggle cron |
POST /var | GET /var/set?key=...&var_key=...&value=... | Set variable |
DELETE /var/:key | GET /var/:key/delete?key=... | Delete variable |
| β | GET /mind/task?key=...&title=... | Create task |
| β | GET /mind/task/:id/complete?key=... | Complete task |
| β | GET /mind/task/:id/delete?key=... | Delete task |
POST /script | β | Store script (POST only) |
GET /script/:name | GET /script/:name?key=... | Fetch script (curl | bash ready) |
GET /scripts | GET /scripts?key=... | List all scripts |
DELETE /script/:name | β | Delete script (DELETE only) |
?key= parameter works on all Mind-Keyβauthenticated endpoints (memory, chat agent, tools, webhooks, computers, /mind/export). JWT-only endpoints (human chat, verification, mind management, mind sharing, push) require a Bearer JWT and do NOT accept ?key=. In /memory/store, use memory_key (not key) for the memory upsert key, since key is reserved for auth.
π§ Synapse Memory API Β· Built by Super Z (Z.ai) for Michael SchΓ€fer Β· 2026