Memory API
Read, write, search, dedupe, consolidate, export, import — the full Jettson Memory surface.
Memory belongs to the user. Every endpoint below scopes to the API key's owner — there's no cross-account leakage and no need to pass a userId.
For the conceptual model see Memory.
Put a memory
/api/v1/memoryCreate or version-update a memory. Idempotent on identical (key, namespace, value).
| Field | Type | Description |
| --- | --- | --- |
| key (required) | string | Short snake_case identifier, unique per namespace. |
| value (required) | string | Up to 5,000 characters. Plain text — stringify JSON if structured. |
| namespace | string | Logical bucket (default default). |
| tags | string[] | Up to 20 tags, each up to 50 chars. |
| importance | number (1-10) | Higher = ranks higher in search (default 5). |
| expires_in_days | number | If set, memory is excluded from search after this many days. |
curl -X POST https://jettson.dev/api/v1/memory \
-H "Authorization: Bearer $JETTSON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"key": "brand_color",
"value": "Brand primary color is #FF5733",
"namespace": "user_profile",
"tags": ["brand", "design"],
"importance": 8
}'Returns the created memory record (memory_id, all fields, created_at).
Get a memory
/api/v1/memory?key=&namespace=Fetch a memory by (namespace, key). Bumps accessCount as a side effect.
curl "https://jettson.dev/api/v1/memory?key=brand_color&namespace=user_profile" \
-H "Authorization: Bearer $JETTSON_API_KEY"Returns 404 with not_found if no live memory matches.
Delete a memory
/api/v1/memory?key=&namespace=&hard=falseSoft delete by default — sets isLatestVersion=false and stamps deletedAt. Pass hard=true to actually remove.
curl -X DELETE "https://jettson.dev/api/v1/memory?key=stale_thing&namespace=research" \
-H "Authorization: Bearer $JETTSON_API_KEY"Search
/api/v1/memory/searchHybrid semantic+keyword search across the user's memory pool.
| Field | Type | Description |
| --- | --- | --- |
| query (required) | string | Natural-language query. |
| namespace | string | Restrict to this namespace if set. |
| tags | string[] | AND-filter on these tags. |
| limit | number | Max results (default 10, cap is 50). |
| mode | 'hybrid' \| 'semantic' \| 'keyword' | Ranker mode (default hybrid). See the concept page for weights. |
| min_score | number | Filter out results below this combined score 0-1 (default 0). |
curl -X POST https://jettson.dev/api/v1/memory/search \
-H "Authorization: Bearer $JETTSON_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"query": "what color is my brand",
"namespace": "user_profile",
"limit": 5
}'Response:
{
"results": [
{
"memory_id": "mem_...",
"key": "brand_color",
"value": "Brand primary color is #FF5733",
"namespace": "user_profile",
"tags": ["brand", "design"],
"importance": 8,
"source": "manual",
"score": 0.82,
"breakdown": { "semantic": 0.78, "keyword": 1.0, "importance": 0.8, "timeDecay": 0.97 },
"created_at": 1715712000000
}
]
}List
/api/v1/memory/list?namespace=&tags=a,b&limit=NPage through live memories. No ranking — newest first.
Dedupe
/api/v1/memory/dedupeFind near-duplicate memories (semantic similarity ≥ threshold) and soft-delete the less-useful copies.
| Field | Type | Description |
| --- | --- | --- |
| namespace | string | Restrict to one namespace, otherwise scan everything. |
| threshold | number (0-1) | Cosine similarity above which two memories are "the same" (default 0.92). |
| dry_run | boolean | If true, only report which pairs would be removed (default false). |
{
"removed": 3,
"kept": 42,
"pairs": [
{ "kept": "mem_abc", "removed": "mem_xyz", "similarity": 0.94 }
]
}Consolidate
/api/v1/memory/consolidateCluster related memories and fold each cluster into a single Mind-generated summary.
| Field | Type | Description |
| --- | --- | --- |
| namespace | string | Restrict to one namespace. |
| min_cluster_size | number | Don't consolidate clusters smaller than this (default 3). |
| threshold | number (0-1) | Semantic-similarity threshold for clustering (default 0.75). |
This call uses the Mind to write the summaries — it consumes tokens. Don't loop it.
Namespaces
/api/v1/memory/namespacesList all of the user's namespaces with live-memory counts.
{
"namespaces": [
{ "namespace": "research", "count": 42 },
{ "namespace": "coding_standards", "count": 15 },
{ "namespace": "default", "count": 7 }
]
}Export
/api/v1/memory/exportDownload every live memory as a JSON document. Round-trips through /import.
curl https://jettson.dev/api/v1/memory/export \
-H "Authorization: Bearer $JETTSON_API_KEY" \
-o memory-export.jsonImport
/api/v1/memory/importBulk insert memories (or restore from an export). Goes through putMemory, so versioning + quotas apply.
{
"memories": [
{ "key": "brand_color", "value": "#FF5733", "namespace": "user_profile", "tags": ["brand"], "importance": 8 }
]
}Returns { imported: N, failed: N, errors: [...] }. Quota exceeded mid-batch halts with HTTP 402.
Related
- Memory concept page — the why
- Memory tools — the same operations callable from inside an agent
- Guide: using memory effectively — patterns