mirror of
https://github.com/basicmachines-co/basic-memory
synced 2026-06-21 13:47:35 +00:00
634486107b
Signed-off-by: phernandez <paul@basicmachines.co> Co-authored-by: Claude <noreply@anthropic.com>
42 lines
1.9 KiB
Markdown
42 lines
1.9 KiB
Markdown
Looking at write_note, I can see it's a complete content replacement tool. An edit_note() tool would be really valuable for incremental changes. Here's my thinking:
|
|
|
|
Use Cases for edit_note():
|
|
|
|
- Append new sections to existing notes (most common)
|
|
- Update specific information without rewriting everything
|
|
- Add observations/relations to existing content
|
|
- Fix typos or update facts
|
|
- Prepend updates like meeting notes with timestamps
|
|
|
|
Proposed Design:
|
|
|
|
@mcp.tool()
|
|
async def edit_note(
|
|
identifier: str, # title, permalink, or memory:// URL
|
|
operation: str, # "append", "prepend", "replace_section", "find_replace"
|
|
content: str, # content to add/replace
|
|
section: str = None, # for replace_section - header name like "## Notes"
|
|
find_text: str = None, # for find_replace
|
|
) -> str:
|
|
|
|
Operations:
|
|
|
|
1. append - Add content to end (most useful)
|
|
edit_note("project-planning", "append", "\n## New Requirements\n- Feature X\n- Feature Y")
|
|
2. prepend - Add content to beginning
|
|
edit_note("meeting-notes", "prepend", "## 2025-05-25 Update\n- Progress on feature...")
|
|
3. replace_section - Replace content under specific header
|
|
edit_note("specs/api", "replace_section", "New API design...", section="## Implementation")
|
|
4. find_replace - Simple text replacement
|
|
edit_note("config", "find_replace", "v0.13.0", find_text="v0.12.0")
|
|
|
|
Implementation Flow:
|
|
|
|
1. Use read_note() internally to get current content
|
|
2. Apply the specified operation
|
|
3. Use existing PUT /knowledge/entities/{permalink} endpoint
|
|
4. Return similar summary as write_note()
|
|
|
|
This would be perfect for AI assistants making targeted updates without having to regenerate entire documents. The append operation alone would handle 80% of use cases.
|
|
|
|
Want me to implement this? I'd start with just append and prepend for v0.13.0 to keep it simple. |