Docs / Command line export and search
Two commands in the modelbrain_admin tool let you take your memories out as plain files, or search them without opening an assistant. Both arrived in 0.5.1. Both ask the running ModelBrain app, so the app must be open, and neither changes anything.
/Applications/ModelBrain.app/Contents/MacOS/modelbrain_admin
%LOCALAPPDATA%\Programs\ModelBrain\modelbrain_admin.exe
The install script links it as modelbrain, so type modelbrain export and modelbrain recall.
The examples below write modelbrain_admin; use the path or name for your system. Every command accepts --store-dir <dir> if your memories are not in the default location.
.md file per memory, in a folder per partition. Each file starts with a front matter block holding the key, partition, type, tags, creation time, the memories it replaced (supersedes) and its links to other memories, followed by the text.--format jsonl, a single memories.jsonl with one memory per line, useful for scripts.--out must not exist yet, or must be an empty folder. The export is built in a temporary folder next to it and renamed when complete, so a failure never leaves something that looks finished.supersedes field of the memory that replaced it. From version 0.6, add --history and each replaced version is written as its own record with a superseded_by field, and a forgotten one also gets deleted_at. If a replaced version is no longer held, the command counts it, prints a warning and still exits normally.--partition NAME limits it to one.--include-synced.The files hold your memories as plain, unencrypted text. Keep them somewhere you trust.
Prints the best matches with their partition, a relevance number, the key and the start of the text. -k sets how many (1 to 50, default 5), --partition NAME limits the search to one partition, and --json prints the raw results instead. A long memory is cut after 600 characters in the printout; the full text is in the app or in an export.
recall, at least one match was printed.export finished, but some long memories are incomplete (pieces not synced to this computer yet) or were cut short. Those files say so. Run it again after sync finishes.recall ran fine and found nothing.Before release, both commands were run against a live ModelBrain with its real search model on Linux: a search found the right memory, an export wrote the Markdown and JSON Lines files with a 500-sentence memory complete in one file, and a second export onto the same folder was refused. Automated tests cover the rest. They have not been hand-checked on a real store of your size or on Windows, so check an export before you rely on it as a backup.
Yes, from version 0.5.1. The export command writes one Markdown file per memory, in a folder per partition, or a single memories.jsonl file. The app must be running, and the command never changes anything.
Not by default. Only the current version of each memory is written, and a replaced memory is named in the supersedes field of the one that replaced it. From version 0.6, add --history to write each replaced version as its own record with a superseded_by field, plus deleted_at for forgotten ones.
A long memory is stored in pieces. If some pieces synced from another computer have not arrived yet, the file is marked incomplete and the command exits with code 3. Run it again after sync finishes.