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.

HTTP 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

Production
https://api.memory-nexus.org

Quick Start

Store and recall a memory bash
# 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 Codebash
claude mcp add memory-nexus \
  -e MEMORY_API_KEY=YOUR_KEY \
  -- npx memory-nexus-cloud
MCP Config (JSON)json
{
  "mcpServers": {
    "memory-nexus": {
      "command": "npx",
      "args": ["memory-nexus-cloud"],
      "env": {
        "MEMORY_API_KEY": "YOUR_KEY"
      }
    }
  }
}
MCP Tools Available: remember, recall, connect_memories, get_session_context, list_contexts, memory_stats, forget

POST /v1/remember

Store a memory with semantic indexing. Content is embedded for meaning-based recall.

Request Body

FieldTypeRequiredDescription
contentstringYesThe text to remember (1-50,000 chars)
contextstringNoCategory (e.g. "architecture", "preferences"). Default: "general"
importancefloatNo0.0 to 1.0. Higher = recalled more easily. Default: 0.5
metadataobjectNoArbitrary JSON metadata attached to the memory
POST /v1/remember Request
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"}
  }'
Response200 OK
{
  "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

FieldTypeRequiredDescription
querystringYesNatural language search query
contextstringNoFilter results to a specific context
limitintegerNoMax results to return (default: 10, max: 50)
thresholdfloatNoMinimum relevance score 0.0-1.0 (default: 0.5)
POST /v1/recall Request
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}'
Response200 OK
{
  "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

FieldTypeRequiredDescription
source_idstringYesID of the source memory
target_idstringYesID of the target memory
relationshipstringNoType: RELATED_TO, LEADS_TO, CONTRADICTS, etc. Default: RELATED_TO
POST /v1/connect Request
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.

GET /v1/context Request
curl https://api.memory-nexus.org/v1/context \
  -H "X-API-Key: YOUR_KEY"
Response200 OK
{
  "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.

POST /v1/demo/recall No auth required
curl -X POST https://api.memory-nexus.org/v1/demo/recall \
  -H "Content-Type: application/json" \
  -d '{"query": "how to implement rate limiting"}'
Response200 OK
{
  "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

TierDaily API CallsStorageAgentsHats
Solo ($19/mo)10,000500 MB13
Crew ($49/mo)50,0002 GB510
Fleet ($149/mo)200,00010 GB2550

Rate limit headers are included in every response:

Response Headers
X-RateLimit-Limit: 10000
X-RateLimit-Remaining: 9847
X-RateLimit-Reset: 1710460800

Error Handling

All errors return JSON with a consistent structure:

Error Response4xx / 5xx
{
  "detail": "API key not found or invalid"
}
StatusMeaning
400Bad request -- check required fields
401Missing or invalid API key
403API key does not have access to this resource
429Rate limit exceeded -- check Retry-After header
500Server error -- retry with exponential backoff

Pricing Tiers

All plans include full API access, MCP integration, semantic search, knowledge graphs, and pattern learning. No feature gating -- only usage limits.
TierPriceBest For
Solo$19/moSingle agent with persistent memory
Crew$49/moMulti-agent teams sharing knowledge
Fleet$149/moEnterprise-scale agent operations

Get Solo Get Crew Get Fleet