API Reference
Memory Tools API
Complete reference for the 4 memory tools that store and retrieve observations.
remember
Store an observation with context.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| observation | string | Yes | What happened - the knowledge to store |
| domain | string | Yes | Project or area (e.g., "cloudflare", "testing") |
| task_type | string | Yes | Category of work (e.g., "debugging", "deployment") |
| outcome | string | Yes | Result: success, failure, partial, unknown |
| tools_used | string[] | No | Tools involved in the observation |
| tags | string[] | No | Free-form categorization tags |
Example
{
"observation": "Fixed CORS by adding Access-Control-Expose-Headers: Mcp-Session-Id",
"domain": "cloudflare",
"task_type": "debugging",
"outcome": "success",
"tools_used": ["curl", "wrangler"],
"tags": ["cors", "headers"]
}
Response
{
"success": true,
"memory_id": "mem-abc123",
"message": "Memory stored"
}
recall
Semantic search over memories.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| query | string | No | Search query (semantic match) |
| domain | string | No | Filter by domain |
| limit | number | No | Maximum results to return |
Example
{
"query": "CORS debugging",
"domain": "cloudflare",
"limit": 5
}
Response
{
"memories": [
{
"id": "mem-abc123",
"observation": "Fixed CORS by adding Access-Control-Expose-Headers",
"context": {
"domain": "cloudflare",
"task_type": "debugging",
"outcome": "success"
},
"tags": ["cors", "headers"],
"created": "2024-01-15T10:30:00Z",
"similarity": 0.92
}
]
}
forget
Mark a memory as forgotten (soft delete).
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| memory_id | string | Yes | ID of memory to forget |
| superseded_by | string | No | ID of replacement memory |
Example
{
"memory_id": "mem-abc123",
"superseded_by": "mem-def456"
}
Response
{
"success": true,
"message": "Memory marked as forgotten"
}
correct
Update a memory with a correction. Creates a new memory that supersedes the old one.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| memory_id | string | Yes | ID of memory to correct |
| correction | string | Yes | Updated observation text |
Example
{
"memory_id": "mem-abc123",
"correction": "Fixed CORS by adding Access-Control-Expose-Headers: X-Custom-Header (not Mcp-Session-Id)"
}
Response
{
"success": true,
"new_memory_id": "mem-def456",
"superseded_memory_id": "mem-abc123",
"message": "Memory corrected"
}
Memory Object
Full memory object structure:
{
"id": "mem-abc123",
"observation": "The observation text",
"context": {
"domain": "cloudflare",
"task_type": "debugging",
"tools_used": ["curl"],
"outcome": "success"
},
"tags": ["cors", "headers"],
"embedding": [0.1, 0.2, ...],
"derived_skills": ["skill-xyz789"],
"superseded_by": null,
"user_id": "google:123456",
"created": "2024-01-15T10:30:00Z",
"updated": "2024-01-15T10:30:00Z"
}
Fields
| Field | Type | Description |
|---|---|---|
| id | string | Unique identifier |
| observation | string | The stored knowledge |
| context | object | Domain, task type, outcome, tools |
| tags | string[] | Categorization tags |
| embedding | number[] | Vector for semantic search |
| derived_skills | string[] | Skills generated from this memory |
| superseded_by | string | ID of replacing memory (if corrected) |
| user_id | string | Owner's user ID |
| created | string | ISO timestamp of creation |
| updated | string | ISO timestamp of last update |
Best Practices
Observation Quality
Good observations are:
- Specific and actionable
- Include the "what" and "why"
- Note the outcome
# Good
"Fixed authentication by checking JWT expiry - tokens were expiring during long requests"
# Less useful
"Fixed a bug"
Domain Consistency
Use consistent domain names:
# Good
domain: "cloudflare-workers" (always the same)
# Problematic
domain: "cloudflare" (first time)
domain: "cf-workers" (second time)
domain: "workers" (third time)
Outcome Tracking
Always specify outcomes:
success- It workedfailure- It didn't workpartial- Partially workedunknown- Haven't verified yet