Skip to content

v8.0.0

Choose a tag to compare

@sysid sysid released this 07 Nov 16:37
· 95 commits to main since this release

Undo for agent memories

Agents write memories unattended, and until now an overwrite or delete could not be taken back. bkmr now keeps every old state of a _mem_ bookmark.

Command Purpose
bkmr history [ID] Show saved states, newest first. Without an ID it also finds deleted memories
bkmr restore <HISTORY_ID> Bring a state back under the memory's own ID, also if it was deleted
bkmr delete --force <ID> Remove a bookmark, its vector and its history for good, including traces of its text in the database files

History is always on and stays out of search. Only _mem_ bookmarks are recorded, so deleting anything else, such as an _env_ value, still removes it.

Upgrading

The first run migrates your database automatically, after writing a backup next to it (<name>_backup_YYYYMMDD.db). The migration rebuilds the bookmarks table and the full-text index, so allow free disk space of about twice the database size: one copy for the backup, one for the rebuild. Bookmarks, IDs and embeddings are kept, and nothing needs to be embedded again.

Going back is possible: 7.10.1 still reads and writes a migrated database, and history keeps being recorded.

Migration backups are ordinary copies of your data Delete old backups if that matters.

Breaking changes

  • A number in a full-text search no longer matches a bookmark's ID. Use bkmr show <ID>. This only ever worked for some bookmarks.
  • hsearch --mode rejects unknown values. A typo used to run in hybrid mode without a warning.
  • update with several flags is now all or nothing. A bad flag used to leave the earlier flags applied.
  • Bookmark IDs are never reused. Previously the highest ID became free again after a delete.

Fixes

  • Searching for the number of a deleted bookmark could fail with database disk image is malformed, including in queries such as 215 OR docker. The database was not damaged. The migration rebuilds the index, which fixes this.
  • Migration backups now include changes still in the write-ahead log, which a plain file copy could miss.
  • When an embedding fails during update, the bookmark is left unchanged.

Other changes

  • A declined delete --force exits 130. A declined plain delete still exits 0.
  • delete --force exits 1 if another process is reading the database, because deleted text can still be on disk. Close that process and run it again.
  • A memory imported from a file that still exists cannot be restored in place, because the file decides its content. Change the file instead.
  • hsearch --help now explains the search modes in plain language.

Full Changelog: v7.10.2...v8.0.0