ContextMesh Docs

Persistent semantic memory for AI agents. Store context once, retrieve it semantically from any agent, any session, any tool.

Base URL: https://contextmesh.dev

Quickstart

Get your API key at contextmesh.dev/#pricing, then store your first memory in 30 seconds:

python
pip install contextmesh

from contextmesh import Mesh

mesh = Mesh("cm_live_your_key")

# Store context
mesh.remember("prod DB is Postgres 15 on AWS us-east-1")

# Retrieve semantically
hits = mesh.query("what database are we running?")
for h in hits:
    print(h["score"], h["text"])
curl
# Store
curl -X POST https://contextmesh.dev/remember \
  -H "Authorization: Bearer cm_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"text": "prod DB is Postgres 15 on AWS us-east-1"}'

# Query
curl -X POST https://contextmesh.dev/query \
  -H "Authorization: Bearer cm_live_your_key" \
  -H "Content-Type: application/json" \
  -d '{"q": "what database are we running?", "top_k": 5}'
javascript
import { Mesh } from "contextmesh-mcp"

const mesh = new Mesh("cm_live_your_key")
await mesh.remember("prod DB is Postgres 15 on AWS us-east-1")
const hits = await mesh.query("what database are we running?")
console.log(hits)
~/.cursor/mcp.json or ~/.claude/mcp.json
{
  "contextmesh": {
    "command": "npx",
    "args": ["contextmesh-mcp"],
    "env": {
      "CM_KEY": "cm_live_your_key"
    }
  }
}

Restart Claude or Cursor after saving. The agent will automatically call remember and query as tools.

Authentication

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

http
Authorization: Bearer cm_live_your_key

API keys start with cm_live_. Get one at contextmesh.dev/#pricing. Keys are workspace-scoped — all data stored under a key belongs to that workspace only.

Keep your key private. Anyone with your key has full read/write access to your workspace.

Errors

StatusMeaning
401Invalid or missing API key
404Entry not found
429Rate limit or monthly quota exceeded — upgrade your plan
400Validation error — check request body
500Server error — contact hello@contextmesh.dev

POST /remember

POST /remember Store a piece of context

Embeds the text and stores it in your workspace. Returns an ID you can use to delete this entry later.

Request body

FieldTypeRequiredDescription
textstringrequiredThe context to store. Max 10,000 chars.
tagsstring[]optionalLabels for filtering later. e.g. ["database", "infra"]
source_agentstringoptionalWhich agent wrote this. e.g. "cursor", "claude"
confidencefloatoptionalHow confident you are (0.0–1.0). Default: 1.0

Response

{"id": "a1b2c3d4", "status": "stored", "chars": 48, "tags": ["database"]}

POST /query

POST /query Semantic search

Finds the most semantically relevant stored entries using vector similarity. Returns results ranked by score.

Request body

FieldTypeRequiredDescription
qstringrequiredNatural language query. Max 2,000 chars.
top_kintoptionalMax results to return (1–20). Default: 5
tag_filterstringoptionalOnly return entries with this tag
min_scorefloatoptionalMinimum similarity score (0.0–1.0). Default: 0.3

Response

{ "query": "what database are we running?", "count": 2, "results": [ {"id": "a1b2c3d4", "text": "prod DB is Postgres 15...", "score": 0.921, "tags": ["database"], "source_agent": "cursor", "created_at": 1711234567}, {"id": "e5f6g7h8", "text": "DB backups run nightly...", "score": 0.784, "tags": ["database"], "source_agent": "claude", "created_at": 1711200000} ] }

DELETE /forget/{entry_id}

DELETE /forget/{entry_id} Remove an entry

Permanently removes a stored context entry by ID. Get the ID from /remember or /list.

Response

{"id": "a1b2c3d4", "status": "deleted"}

GET /list

GET /list Browse stored entries

Returns all stored entries in your workspace. Paginate with limit and offset.

Query parameters

ParamTypeDescription
limitintResults per page (1–200). Default: 50
offsetintSkip N entries. Default: 0
tag_filterstringFilter by tag

Response

{"total": 42, "offset": 0, "limit": 50, "entries": [...]}

GET /usage

GET /usage Check plan usage

Returns this month's usage and your plan limits.

{ "workspace_id": "ws_a4f8c3d2", "plan": "team", "queries_used": 1842, "queries_limit": 1000000, "entries_stored": 234, "entries_limit": 5000000, "rate_limit_rpm": 500 }

Python SDK

bash
pip install contextmesh

Sync client

python
from contextmesh import Mesh

mesh = Mesh("cm_live_your_key")

# Store
id_ = mesh.remember("prod DB is Postgres 15", tags=["database"])

# Query
hits = mesh.query("what database?", top_k=5, min_score=0.3)

# Delete
mesh.forget(id_)

# List all
data = mesh.list(limit=50)

# Check usage
u = mesh.usage()

Async client

python
from contextmesh import AsyncMesh

mesh = AsyncMesh("cm_live_your_key")
await mesh.remember("prod DB is Postgres 15")
hits = await mesh.query("what database?")

JavaScript SDK

bash
npm install contextmesh-mcp
javascript
import { Mesh } from "contextmesh-mcp"

const mesh = new Mesh("cm_live_your_key")
await mesh.remember("prod DB is Postgres 15", { tags: ["database"] })
const hits = await mesh.query("what database?")

MCP — Claude & Cursor

Add ContextMesh as an MCP server so Claude and Cursor automatically remember and recall context during conversations.

~/.cursor/mcp.json or ~/.claude/mcp.json
{
  "contextmesh": {
    "command": "npx",
    "args": ["contextmesh-mcp"],
    "env": {
      "CM_KEY": "cm_live_your_key"
    }
  }
}

After saving, restart Claude or Cursor. The agent gets three tools: remember, query, forget.

No code required. The agent decides when to store and retrieve context automatically.

Plans & Limits

Free
$0/mo
1,000 queries/mo
10,000 entries
20 req/min
1 workspace
Solo
$19/mo
100k queries/mo
500k entries
100 req/min
1 workspace
Team
$99/mo
1M queries/mo
5M entries
500 req/min
10 workspaces
Enterprise
$599/mo
Unlimited queries
Unlimited entries
2,000 req/min
Unlimited workspaces

Upgrade or manage your plan at contextmesh.dev/billing.