API Reference

Simple, powerful, RESTful.

Two core endpoints: ingest and context. Everything else is optional.

Authentication

All requests require a Bearer token. Include your API key in the Authorization header.

bash
curl https://api.m3mory.ai/v1/status \
-H "Authorization: Bearer m3m_sk_..."

Base URL: https://api.m3mory.ai

Rate Limits

Rate limits are applied per API key. When exceeded, you will receive a 429 response.

Free

30/min

Pro

120/min

Scale

10,000/min

Enterprise

Custom

Memory Ingestion

POST/v1/ingest

Extract and store memories from a conversation.

Request Body

json
{
"agentId": "my-assistant",
"userId": "user_123",
"messages": [
{ "role": "user", "content": "I just moved to Bristol" },
{ "role": "assistant", "content": "Welcome to Bristol!" }
]
}

Response

json
{
"memoriesCreated": 1,
"entitiesExtracted": 2,
"edgesCreated": 1,
"processingMs": 842
}

Context Retrieval

POST/v1/context

Retrieve relevant context for an ongoing conversation. Returns a text block ready for your system prompt.

Request Body

json
{
"agentId": "my-assistant",
"userId": "user_123",
"messages": [
{ "role": "user", "content": "Where do I live?" }
],
"tokenBudget": 2000
}

Response

json
{
"text": "## What you know about user_123\n- Lives in Bristol (moved recently)\n- ...",
"memoriesUsed": 4,
"tokensUsed": 847,
"retrievalMs": 312
}

Search

POST/v1/search

Search memories with filters. Returns raw memory objects.

Request Body

json
{
"agentId": "my-assistant",
"userId": "user_123",
"query": "Bristol",
"limit": 10,
"categories": ["location", "preference"]
}

Response

json
{
"memories": [
{
"id": "mem_abc123",
"content": "User moved to Bristol",
"category": "location",
"score": 0.94,
"createdAt": "2026-03-20T10:30:00Z"
}
],
"total": 1
}

Memory CRUD

GET/v1/memories

List memories with pagination and filters.

Response

json
{
"memories": [...],
"total": 1423,
"page": 1,
"pageSize": 50
}
GET/v1/memories/:id

Get a specific memory by ID.

Response

json
{
"id": "mem_abc123",
"content": "User moved to Bristol",
"category": "location",
"entities": ["Bristol"],
"createdAt": "2026-03-20T10:30:00Z",
"lastAccessed": "2026-03-20T11:00:00Z"
}
DELETE/v1/memories/:id

Delete a specific memory. Permanent.

Response

json
{ "deleted": true }

Account

GET/v1/status

Get account status, usage, and limits.

Response

json
{
"plan": "pro",
"memoriesStored": 14203,
"storageUsedMb": 412,
"storageLimitMb": 2048,
"requestsToday": 847,
"rateLimitPerMin": 120,
"tokensUsed": 1243000,
"tokenLimit": 5000000,
"searchesUsed": 4210,
"searchLimit": 100000
}

Error Codes

400Bad request. Check your request body.
401Invalid or missing API key.
403API key does not have access to this resource.
404Resource not found.
429Rate limit exceeded. Back off and retry.
500Internal server error. Contact support.