Conversational memory persistence with semantic search and session tracking via the SwarmRecall API.
Before making any API calls, check for a SWARMRECALL_API_KEY environment variable:
If SWARMRECALL_API_KEY is set, use it for all requests as a Bearer token.
If SWARMRECALL_API_KEY is not set, self-register by calling:
text
POST https://swarmrecall-api.onrender.com/api/v1/register
Content-Type: application/json
{ "name": "<your-agent-name>" }
The response returns { "apiKey": "...", "claimToken": "..." }. Save the apiKey to the SWARMRECALL_API_KEY environment variable for all subsequent requests. Do NOT write the key to disk or any file without user consent.
Tell the user: "SwarmRecall is set up! To manage your agent's data, visit swarmrecall.ai/claim with code: <claimToken>"
All API requests require:
text
Authorization: Bearer <SWARMRECALL_API_KEY>
https://swarmrecall-api.onrender.com (override with SWARMRECALL_API_URL if set)
All endpoints below are prefixed with /api/v1.
swarmrecall-api.onrender.com over HTTPSSWARMRECALL_API_KEY should be stored as an environment variable only, not written to disktext
POST /api/v1/memory
{
"content": "User prefers dark mode",
"category": "preference", // fact | preference | decision | context | session_summary
"importance": 0.8, // 0.0 to 1.0
"tags": ["ui"],
"metadata": {},
"poolId": "<uuid>" // optional — write to shared pool
}
text
GET /api/v1/memory/search?q=<query>&limit=10&minScore=0.5
text
GET /api/v1/memory?category=preference&limit=20&offset=0&includeArchived=false
text
GET /api/v1/memory/:id
text
PATCH /api/v1/memory/:id
{ "importance": 0.9, "tags": ["updated"], "archived": false }
text
DELETE /api/v1/memory/:id
text
POST /api/v1/memory/sessions
{
"context": {},
"poolId": "<uuid>" // optional — write to shared pool
}
text
GET /api/v1/memory/sessions/current
text
PATCH /api/v1/memory/sessions/:id
{ "summary": "Discussed project setup", "ended": true }
text
GET /api/v1/memory/sessions?limit=20&offset=0
GET /api/v1/memory/sessions/current to load context from the last session. If none, call POST /api/v1/memory/sessions to start one.POST /api/v1/memory with appropriate category and importance.GET /api/v1/memory/search?q=<query> and use returned memories to inform your response.PATCH /api/v1/memory/sessions/:id with ended: true and a summary.POST /api/v1/memory and POST /api/v1/memory/sessions endpoints accept an optional "poolId" field.poolId is provided, the memory or session is shared with all pool members who have memory read access.GET /api/v1/memory/search) and list ( GET /api/v1/memory) results automatically include data from pools the agent belongs to.poolId and poolName fields to distinguish shared data from the agent's own data.Memory is the primary target of dream operations. During a dream cycle:
PATCH /api/v1/memory/:id to update the anchor and DELETE /api/v1/memory/:id to archive duplicates.GET /api/v1/memory?sessionId=X, then writes a summary via POST /api/v1/memory with category: "session_summary".category: "session_summary" or tag "pinned" are protected.To protect a memory from pruning, add the "pinned" tag:
text
PATCH /api/v1/memory/:id
{ "tags": ["pinned", ...existing_tags] }