API Reference

Memory Tools API

Complete reference for the 4 memory tools that store and retrieve observations.


remember

Store an observation with context.

Parameters

NameTypeRequiredDescription
observationstringYesWhat happened - the knowledge to store
domainstringYesProject or area (e.g., "cloudflare", "testing")
task_typestringYesCategory of work (e.g., "debugging", "deployment")
outcomestringYesResult: success, failure, partial, unknown
tools_usedstring[]NoTools involved in the observation
tagsstring[]NoFree-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

Text search across memories, skills, or both. Query matches against observation text, tags, skill names, descriptions, and instructions.

Parameters

NameTypeRequiredDescription
memory_idstringNoGet a specific memory by ID (bypasses search)
querystringNoText search query. Matches observation text, tags, skill names/descriptions/instructions.
domainstringNoFilter by domain
includestringNoWhat to search: "memories" (default), "skills", or "all"
limitnumberNoMaximum results to return (default 10)
offsetnumberNoPagination offset
formatstringNo"compact" (default) or "full"
skill_detailstringNo"name_only" (default), "summary", or "full"
summarizebooleanNoAI-summarize results

Example: Search memories

{
  "query": "CORS debugging",
  "domain": "cloudflare",
  "limit": 5
}

Example: Search memories and skills

{
  "query": "deployment",
  "include": "all",
  "limit": 5,
  "skill_detail": "summary"
}

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"
    }
  ],
  "skills": [
    {
      "id": "skill-xyz",
      "name": "cloudflare-deployment",
      "description": "Steps for deploying to Cloudflare Workers"
    }
  ]
}

forget

Mark a memory as forgotten (soft delete).

Parameters

NameTypeRequiredDescription
memory_idstringYesID of memory to forget
superseded_bystringNoID 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

NameTypeRequiredDescription
memory_idstringYesID of memory to correct
correctionstringYesUpdated 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

FieldTypeDescription
idstringUnique identifier
observationstringThe stored knowledge
contextobjectDomain, task type, outcome, tools
tagsstring[]Categorization tags
embeddingnumber[]Vector for semantic search
derived_skillsstring[]Skills generated from this memory
superseded_bystringID of replacing memory (if corrected)
user_idstringOwner's user ID
createdstringISO timestamp of creation
updatedstringISO 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 worked
  • failure - It didn't work
  • partial - Partially worked
  • unknown - Haven't verified yet
Previous
Messaging