Skip to main content

API Reference

SharedMemory exposes a REST API for agent integration. All endpoints use JSON request/response bodies.

Getting Started

If you prefer a higher-level interface, check out the TypeScript SDK or MCP Server which wrap these endpoints.

Base URL

EnvironmentURL
Productionhttps://api.sharedmemory.ai
Local devhttp://localhost:3000

Authentication

All agent API endpoints require a Bearer token in the Authorization header:

curl -X POST https://api.sharedmemory.ai/agent/memory/write \
-H "Authorization: Bearer sm_agent_..." \
-H "Content-Type: application/json" \
-d '{"content": "hello", "volume_id": "..."}'
info

API keys are created when you create an agent in the dashboard, or via POST /agents. See Authentication for details.

Common Response Format

Success 200 OK

{
"status": "ok",
"data": { ... }
}

Error 4xx / 5xx

{
"error": "error_code",
"details": "Human-readable description"
}

Validation Error 400

{
"error": "validation_failed",
"details": {
"content": ["String must contain at least 1 character(s)"],
"volume_id": ["Invalid uuid"]
}
}

Rate Limits

EndpointLimitWindow
Memory write30 requestsper minute
Memory query60 requestsper minute
Document upload50 requestsper hour

Rate limit headers are included in every response:

X-RateLimit-Limit: 30
X-RateLimit-Remaining: 29
X-RateLimit-Reset: 1700000000

Endpoints

✏️ Memory

Write, query, and subscribe to memories in real time.

🔗 Knowledge Graph

Get entities, search relationships, and explore the graph.

📄 Documents

Upload files (PDF, DOCX, TXT) and list document chunks.

🤖 Agents

Register agents, connect to volumes, and broadcast messages.