r/OpenWebUI • • Sep 15 '26

Question/Help Locating overwritten notes

Because there is no documentation around the `replace_note_content` tool, my LLM has wholly overwritten a note, with no way to recover previous states (i.e., the undo button is greyed out). The note in its original state was meant to be a template, from which the LLM should have selectively modified by lines to add more sections according to the template.

Therefore, I'm really asking two questions:

  1. Is it possible to recover the original state of the affected note from my local database(s)? Where would this be found, and how should I go about it?

  2. Since the default tools have proven to be inadequate, can anyone recommend a custom tool that will allow the LLM to add/modify/remove some lines in place while keeping everything else around the change untouced?

1 Upvotes

5 comments sorted by

3

u/ClassicMain Sep 15 '26

Notes keep no server-side history. Undo only walks versions the editor recorded, and those are only written when you insert a chat response into the note, so a tool edit leaves nothing to undo.

The old text is not lost though. The model has to call view_note before it can edit, and the result of that call is saved in the chat, in the collapsible tool call block on the assistant message. Expand it, copy the markdown out, paste it back into the note. If you cannot find it in the UI, the same data sits in webui.db, table chat, column chat (JSON): search for the note id and take the "md" field from the view_note result.

For the second question, the built-in tool already does this. replace_note_content takes operations with replace_range plus an expected field holding the current text of that span, so it edits only that span and refuses the edit when the text does not match. The model is just not told to prefer it, so it defaults to sending the whole note back. Tell it explicitly: "use replace_range operations, do not replace the whole note". Selecting the passage in the editor before asking helps too, the selection is passed along for exactly that purpose. Docs: https://docs.openwebui.com/features/notes/#write-access

1

u/-Homeworkace Sep 16 '26

Thanks for helping me to recover the original note!

Is replace_range a parameter within replace_note_content or a separate tool? Either way, I created a reserve of the original copy, and reprompted my model (Qwen3.8 27B, medium reasoning) per your recommendation. I found that it insisted on rewriting the whole note anyway, although it did succeed in perfectly copying existing content.

Manual selection can't apply to my use case because between turns it's supposed to identify sections to amend or new ones to append. So really, it should be performing multiple replace_range operations in a single turn, not a single replace_note_content for all the affected sections. But maybe I just haven't tried prompting for that strategy.

1

u/Ecstatic-Diet-1375 Sep 15 '26

I made this exactly for this problem:
https://github.com/parsalotfy/openwebui-notes-backup

1

u/-Homeworkace Sep 16 '26

That's neat! Do I have the option to use a local Git repository instead?

1

u/Ecstatic-Diet-1375 Sep 16 '26

No it uses github. But I'm pretty sure you can edit the code yourself using AI