Skip to main content

What it does

Updates an existing memory by its ID, allowing you to correct errors, add new information, change memory classification, or update tags. Only the fields you provide will be modified; unspecified fields remain unchanged.

Parameters

ParameterTypeRequiredDefaultDescription
memoryIdstringYesID of the memory to update
titlestringNoNew title for the memory
contentstringNoNew content body
tagsstring[]NoNew array of tags
storestringNoNew memory store: sensory, episodic, semantic, procedural, or prospective
categorystringNoNew category: decision, lesson, person, rule, event, fact, goal, workflow, or conversation

Returns

{
  "success": true,
  "memoryId": "string",
  "message": "Updated memory {memoryId}"
}
Field descriptions:
  • success — Whether the update succeeded
  • memoryId — The updated memory’s ID (echo of input)
  • message — Confirmation message

Examples

Basic usage

// Fix a typo in an existing memory
crystal_edit({
  memoryId: "abc123def456",
  content: "Use PostgreSQL for session storage because concurrent writes are needed"
})

// Result:
// {
//   "success": true,
//   "memoryId": "abc123def456",
//   "message": "Updated memory abc123def456"
// }

Advanced usage

// Promote a lesson from sensory to semantic store and retag
crystal_edit({
  memoryId: "xyz789",
  store: "semantic",
  category: "lesson",
  tags: ["postgres", "reliability", "database-choice"],
  title: "PostgreSQL concurrency vs SQLite lock contention"
})

// Move a fact to a different category and update content
crystal_edit({
  memoryId: "mem_abc",
  category: "rule",
  content: "Always use prepared statements to prevent SQL injection"
})

When to use this vs alternatives

  • crystal_edit — When you know the exact memory ID and want to modify it surgically
  • crystal_remember — When you want to save a new memory (not update existing)
  • crystal_forget — When you want to remove or archive a memory instead of editing it

Error handling

ErrorCauseResolution
Invalid memoryIdMissing, empty, or non-existent IDProvide a valid memory ID from recall results
Invalid store valueNot one of the 5 allowed storesUse: sensory, episodic, semantic, procedural, or prospective
Invalid category valueNot one of the 9 allowed categoriesUse: decision, lesson, person, rule, event, fact, goal, workflow, or conversation
tags is not an arrayMalformed tag inputPass tags as ["tag1", "tag2"]
Authentication failedInvalid Convex JWT or API keyVerify auth configuration in Convex client setup
Memory not foundID does not exist or was deletedVerify ID against recent recall results

Notes

  • At least one field besides memoryId must be provided (editing nothing is a no-op)
  • All string fields are trimmed of leading/trailing whitespace
  • Category and store enums are case-sensitive and must match exactly
  • Tags are deduplicated automatically on save
  • Editing a memory updates its lastAccessedAt timestamp
  • The update is transactional — either all fields succeed or the entire operation fails