Edit an existing memory FILE to add, modify, or replace content while maintaining [[concept]] connections to the knowledge graph. This tool provides safe editing operations with checksum validation to prevent conflicting changes and ensures all edits contribute to the Maenifold graph structure.
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| identifier | string | Yes | Memory FILE identifier (URI or title) | “memory://documents/machine-learning.md” |
| operation | string | Yes | Edit operation type | ”append”, “prepend”, “find_replace”, “replace_section” |
| content | string | Yes | Content to add/replace - MUST contain [[concepts]] | “New insights about [[Neural Networks]]“ |
| checksum | string | No | File checksum from ReadMemory (prevents stale edits) | “a1b2c3d4e5f6” |
| findText | string | No | Text to find (required for find_replace) | “old terminology” |
| sectionName | string | No | Section header name (required for replace_section) | “Implementation Details” |
| expectedCount | int | No | Expected match count for find_replace validation | 3 |
Adds new content to the end of the existing file.
{
"identifier": "memory://documents/machine-learning.md",
"operation": "append",
"content": "## Recent Discoveries\n\nNew research in [[Deep Learning]] shows promising results with [[Transformer Architecture]]."
}
Adds new content to the beginning of the existing file.
{
"identifier": "memory://documents/machine-learning.md",
"operation": "prepend",
"content": "# Prerequisites\n\nThis document assumes familiarity with [[Statistics]] and [[Linear Algebra]].\n\n"
}
Replaces all occurrences of specific text with new content.
{
"identifier": "memory://documents/machine-learning.md",
"operation": "find_replace",
"content": "[[Machine Learning]] algorithms",
"findText": "ML algorithms",
"expectedCount": 5
}
Replaces content under a specific markdown section header.
{
"identifier": "memory://documents/machine-learning.md",
"operation": "replace_section",
"content": "Current [[TensorFlow]] and [[PyTorch]] implementations provide excellent performance.",
"sectionName": "Implementation Tools"
}
{
"identifier": "research-notes",
"operation": "append",
"content": "## Latest Findings\n\nDiscovered important connection between [[Attention Mechanisms]] and [[Memory Networks]]."
}
Adds new section to the end of the research-notes file.
{
"identifier": "memory://documents/ai-overview.md",
"operation": "find_replace",
"content": "[[Artificial Intelligence]] systems",
"findText": "AI systems",
"checksum": "a1b2c3d4e5f6",
"expectedCount": 12
}
Replaces “AI systems” with properly linked concept, validating exactly 12 replacements occur.
{
"identifier": "project-status",
"operation": "replace_section",
"content": "Project completed successfully. Key insights include [[Agile Methodology]] benefits and [[Continuous Integration]] improvements.",
"sectionName": "Current Status"
}
Replaces the entire “Current Status” section with updated information.
Cause: File was modified between ReadMemory and EditMemory calls Solution: Re-read the file with ReadMemory to get current checksum, then retry edit
Cause: Edit content doesn’t include any [[WikiLink]] concepts Solution: Add relevant [[Concept Names]] to connect content to knowledge graph
Cause: find_replace or replace_section would eliminate all graph connections Solution: Ensure replacement content includes appropriate [[concepts]]
Cause: expectedCount validation failed in find_replace operation Solution: Check if file was modified or adjust expectedCount parameter
Cause: Invalid identifier or file doesn’t exist Solution: Use SearchMemories to find correct identifier or verify file exists
Cause: sectionName doesn’t match exact markdown header text Solution: Check exact section header text including capitalization and punctuation