Skip to content

[BUG] Fails to update note ("already exists") #107

@ryanstraight

Description

@ryanstraight

Bug Description (From Claude)

The write_note function is failing to update existing notes in the Basic Memory system, producing errors both when attempting to write without a specified folder and when attempting to update files that already exist.

Steps To Reproduce

  1. Check current date/time using the get_time function (unrelated, part of custom instructions to get the time so Claude can accurately understand relative times like, "Look at yesterday's note," etc.)
  2. Retrieve an existing note using read_note with its permalink (e.g., "periodic-notes-daily-2025-04-18")
  3. Attempt to update the note using write_note with the same title
  4. Observe error indicating the file already exists

Expected Behavior

The write_note function should be able to update existing notes, either by overwriting them entirely or by merging changes with the existing content. This would allow for programmatic updates to daily notes and other frequently modified documents.

Actual Behavior

Two distinct errors were observed:

  1. When attempting to write without specifying folder:
Error executing tool write_note: 1 validation error for write_noteArguments
folder
  Field required [type=missing, input_value={'title': '2025-04-18', '...llows [[2025-04-17]]\n'}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/missing
  1. When attempting to write with folder specified:
Error executing tool write_note: file for entity Periodic Notes/Daily/2025-04-17 already exists: Periodic Notes\Daily\2025-04-17.md

Environment

  • OS: Windows 11 Insider
  • Python version: 3.13.2
  • Basic Memory version: 0.12.2
  • Installation method: uv 0.6.10
  • Claude Desktop version: 0.9.2

Additional Context

  • This issue affects core functionality for assistants designed to update daily notes or maintain knowledge repositories
  • The error seems to indicate that the write_note function is designed to create new files only, not update existing ones
  • The folder parameter appears to be required even when the permalink is specified, which creates redundancy
  • There may be a need for an update_note function or a parameter for write_note that allows overwriting existing files

Possible Solution

Three potential solutions:

  1. Modify the write_note function to accept an overwrite boolean parameter that, when set to true, allows updating existing files
  2. Create a dedicated update_note function specifically for modifying existing notes
  3. Implement a "merge" capability that would allow selective updating of note sections while preserving other content

As a temporary workaround, users could:

  • Read the existing note with read_note
  • Create a new note with a slightly modified title or in a different folder
  • Manually copy the content back to the original location

This issue significantly impacts the usability of Basic Memory for maintaining living documents like daily notes, where regular updates are essential.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions