ContextMesh Docs
Persistent semantic memory for AI agents. Store context once, retrieve it semantically from any agent, any session, any tool.
https://contextmesh.devQuickstart
Get your API key at contextmesh.dev/#pricing, then store your first memory in 30 seconds:
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"])
# 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}'
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)
{
"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.
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.
Errors
| Status | Meaning |
|---|---|
| 401 | Invalid or missing API key |
| 404 | Entry not found |
| 429 | Rate limit or monthly quota exceeded — upgrade your plan |
| 400 | Validation error — check request body |
| 500 | Server error — contact hello@contextmesh.dev |
POST /remember
Embeds the text and stores it in your workspace. Returns an ID you can use to delete this entry later.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| text | string | required | The context to store. Max 10,000 chars. |
| tags | string[] | optional | Labels for filtering later. e.g. ["database", "infra"] |
| source_agent | string | optional | Which agent wrote this. e.g. "cursor", "claude" |
| confidence | float | optional | How confident you are (0.0–1.0). Default: 1.0 |
Response
POST /query
Finds the most semantically relevant stored entries using vector similarity. Returns results ranked by score.
Request body
| Field | Type | Required | Description |
|---|---|---|---|
| q | string | required | Natural language query. Max 2,000 chars. |
| top_k | int | optional | Max results to return (1–20). Default: 5 |
| tag_filter | string | optional | Only return entries with this tag |
| min_score | float | optional | Minimum similarity score (0.0–1.0). Default: 0.3 |
Response
DELETE /forget/{entry_id}
Permanently removes a stored context entry by ID. Get the ID from /remember or /list.
Response
GET /list
Returns all stored entries in your workspace. Paginate with limit and offset.
Query parameters
| Param | Type | Description |
|---|---|---|
| limit | int | Results per page (1–200). Default: 50 |
| offset | int | Skip N entries. Default: 0 |
| tag_filter | string | Filter by tag |
Response
GET /usage
Returns this month's usage and your plan limits.
Python SDK
pip install contextmesh
Sync client
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
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
npm install contextmesh-mcp
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.
{
"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.
Plans & Limits
Upgrade or manage your plan at contextmesh.dev/billing.