API Documentation
Persistent semantic memory for AI agents. Store, recall, and connect knowledge across sessions.
Authentication
All API requests require an API key passed in the X-API-Key header.
X-API-Key: mnx_your_api_key_here
Get an API key by subscribing at memory-nexus.org. After payment, your key is provisioned automatically.
Base URL
https://api.memory-nexus.org
Quick Start
# Store a memory curl -X POST https://api.memory-nexus.org/v1/remember \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_KEY" \ -d '{ "content": "We chose PostgreSQL for the main database", "context": "architecture", "importance": 0.9 }' # Recall by meaning curl -X POST https://api.memory-nexus.org/v1/recall \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_KEY" \ -d '{"query": "what database are we using?"}'
MCP Setup
Memory Nexus works as an MCP server with Claude Code, Cursor, Windsurf, and any MCP-compatible client.
claude mcp add memory-nexus \ -e MEMORY_API_KEY=YOUR_KEY \ -- npx memory-nexus-cloud
{
"mcpServers": {
"memory-nexus": {
"command": "npx",
"args": ["memory-nexus-cloud"],
"env": {
"MEMORY_API_KEY": "YOUR_KEY"
}
}
}
}
POST /v1/remember
Store a memory with semantic indexing. Content is embedded for meaning-based recall.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
content | string | Yes | The text to remember (1-50,000 chars) |
context | string | No | Category (e.g. "architecture", "preferences"). Default: "general" |
importance | float | No | 0.0 to 1.0. Higher = recalled more easily. Default: 0.5 |
metadata | object | No | Arbitrary JSON metadata attached to the memory |
curl -X POST https://api.memory-nexus.org/v1/remember \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_KEY" \ -d '{ "content": "User prefers dark mode and vim keybindings", "context": "preferences", "importance": 0.8, "metadata": {"source": "onboarding"} }'
{
"id": "a1b2c3d4-e5f6-...",
"content": "User prefers dark mode and vim keybindings",
"context": "preferences",
"importance": 0.8,
"stored": true
}
POST /v1/recall
Search memories by meaning. Uses semantic search with ensemble reranking for high-quality results.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
query | string | Yes | Natural language search query |
context | string | No | Filter results to a specific context |
limit | integer | No | Max results to return (default: 10, max: 50) |
threshold | float | No | Minimum relevance score 0.0-1.0 (default: 0.5) |
curl -X POST https://api.memory-nexus.org/v1/recall \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_KEY" \ -d '{"query": "what are the user settings?", "limit": 5}'
{
"query": "what are the user settings?",
"results": [
{
"id": "a1b2c3d4-...",
"content": "User prefers dark mode and vim keybindings",
"context": "preferences",
"score": 0.847,
"importance": 0.8
}
],
"total": 1
}
POST /v1/connect
Create a typed relationship between two memories. Builds a knowledge graph for richer recall.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
source_id | string | Yes | ID of the source memory |
target_id | string | Yes | ID of the target memory |
relationship | string | No | Type: RELATED_TO, LEADS_TO, CONTRADICTS, etc. Default: RELATED_TO |
curl -X POST https://api.memory-nexus.org/v1/connect \ -H "Content-Type: application/json" \ -H "X-API-Key: YOUR_KEY" \ -d '{ "source_id": "a1b2c3d4-...", "target_id": "e5f6g7h8-...", "relationship": "LEADS_TO" }'
GET /v1/context
Get session context summary. Call this at the start of each conversation to restore the agent's state.
curl https://api.memory-nexus.org/v1/context \
-H "X-API-Key: YOUR_KEY"
{
"contexts": ["preferences", "architecture", "decisions"],
"total_memories": 142,
"recent": [/* last 5 memories */],
"patterns": [/* learned patterns */]
}
Demo: Try Without Auth
Test semantic search against our expert knowledge base. No API key needed. 10 queries per day.
curl -X POST https://api.memory-nexus.org/v1/demo/recall \ -H "Content-Type: application/json" \ -d '{"query": "how to implement rate limiting"}'
{
"query": "how to implement rate limiting",
"results": [
{
"content": "Rate limiting: Return Retry-After header with 429...",
"context": "rest",
"score": 0.726
}
],
"hat": "API Design Expert",
"total_available": 42,
"demo_queries_remaining": 9
}
Rate Limits
| Tier | Daily API Calls | Storage | Agents | Hats |
|---|---|---|---|---|
| Solo ($19/mo) | 10,000 | 500 MB | 1 | 3 |
| Crew ($49/mo) | 50,000 | 2 GB | 5 | 10 |
| Fleet ($149/mo) | 200,000 | 10 GB | 25 | 50 |
Rate limit headers are included in every response:
X-RateLimit-Limit: 10000 X-RateLimit-Remaining: 9847 X-RateLimit-Reset: 1710460800
Error Handling
All errors return JSON with a consistent structure:
{
"detail": "API key not found or invalid"
}
| Status | Meaning |
|---|---|
400 | Bad request -- check required fields |
401 | Missing or invalid API key |
403 | API key does not have access to this resource |
429 | Rate limit exceeded -- check Retry-After header |
500 | Server error -- retry with exponential backoff |
Pricing Tiers
| Tier | Price | Best For |
|---|---|---|
| Solo | $19/mo | Single agent with persistent memory |
| Crew | $49/mo | Multi-agent teams sharing knowledge |
| Fleet | $149/mo | Enterprise-scale agent operations |