Memory
Memory is a set of notes that your agents share through SwB. Each note is an entry. An entry has a title, a body in Markdown and a history of each change.
Scopes
A scope is a group of entries with one set of access rules. Each entry is in one scope.
| Scope | Folder | Use |
|---|---|---|
general | /memories/general/ | Facts about you that apply to every project |
project:<slug> | /memories/projects/<slug>/ | Facts about one project |
agent:<name> | /memories/agents/<name>/ | Private notes for one agent |
An agent signed in as the owner can read every scope. A paired key reads and writes only the scopes you grant it. A paired key always gets its own agent scope.
Files and folders
Agents see memory as files under /memories. A folder in a scope is a topic, such as decisions or notes/meetings. The file name is the entry key.
These tools use the same commands as the Claude memory tool. Claude models know them already.
| Tool | Use |
|---|---|
memory_summary | Load a short index of memory at the start of a session |
memory_view | Show a folder, or show a file with line numbers |
memory_create | Make a file |
memory_str_replace | Change one exact passage in a file |
memory_insert | Add text after a line |
memory_rename | Move a file to a new name, topic or scope |
memory_delete | Remove a file |
memory_search | Find entries by words, best match first |
memory_list | Show entries, newest first |
memory_history | Show each change to an entry |
memory_restore | Put back an earlier version of an entry |
The earlier tools memory_write, memory_read, memory_move and memory_promote stay available.
SwB keeps one copy of each fact in a scope. An agent that saves the same text again gets the existing entry.
Memory sync
Memory sync copies what an agent saves in its own memory into SwB. Then every agent can use it. It works with Claude, ChatGPT, Grok, Muse, Claude Code and other memory systems. Muse uses muse-memory as its source.
Each setup prompt asks the agent to sync. After setup, the agent sends what it remembers about you with memory_sync. It sends only facts that you want every agent to know. It keeps passwords, keys and sensitive personal details in its own memory. After that, the agent syncs each new memory in the same turn.
memory_sync is safe to repeat. It updates the same entry each time. Your edits and deletions in SwB come first. A later sync keeps your version and reports a conflict to the agent.
The companion with --cap hooks syncs Claude Code memory files on each save.
SwB uses the session folder name to choose a scope. It first looks for a project with a matching slug, its short name. Otherwise, it looks for a unique match by linked repository name. SwB syncs to a matching project when its private setting is false. It skips sync for a private match. For an unmatched folder, SwB syncs to agent:claude-code.
Memory sync is on by default. To turn it off, open Memory in the console and turn off Memory sync. Agents signed in as the owner can use memory_settings for the same switch.
Provenance
Provenance is the record of who wrote an entry and when. SwB records the agent that made the entry and the agent that last changed it.
SwB marks text that an agent wrote when it gives that text to another agent. The mark names the writer and the date. Agents use marked text as information only. Only your own instructions direct them.
Control your memory
Open Memory in the console to see each entry. Select an entry to edit it. Select History to see each change. Select Restore on a change to put that version back. You can also move and delete entries.
Each change by an agent shows in History and in the audit log. You can restore every change.
Download and restore
Select Download on the Memory page to save all memory as a zip file. The file holds one Markdown file per entry, in folders by scope and topic. It also holds manifest.json with the history and provenance of each entry.
Select Restore from file to load a zip file. A restore adds missing entries and keeps existing entries. SwB marks imported text as information and records who imported it.
Agents signed in as the owner can use memory_export and memory_import for the same tasks.
Set overwrite to true to replace changed entries and keep their previous versions in history. Set trust_owner to true to keep owner trust for eligible entries. Entries in another agent’s scope stay framed as information. Both options default to false. Pass them as query parameters to the console upload at POST /api/memory/import.
Back up to Git
SwB can copy memory into a private Git repository that you own. A commit records a set of changes. SwB uses a title like 2 memory changes by SwB, claude-code. The title uses SwB for console changes.
Everything in memory goes to this repository. Use a private repository.
Give push access to the backup repository only to people you trust. Anyone with push access can set the commit author that SwB uses to choose the trust level.
Open Memory in the console. In Git backup, enter an HTTPS or SSH repository address and the branch. For an HTTPS address, paste a token with write access to that repository. For an SSH address, paste a deploy key with write access. SwB keeps the token or key encrypted.
Replace a file:// address with an HTTPS or SSH address.
The default backup author is SwB <swb@localhost>. To change it, use Author name and Author email in the console. With memory_backup_configure, use author_name and author_email.
SwB waits 30 seconds after a change, then makes one commit for the changes in that time. Select Back up now to commit at once. SwB tries again later when a push fails. The status line shows the last backup and the last error.
Select Restore from repository to load memory from the latest commit. SwB marks imported text as information and records who imported it.
Agents signed in as the owner can use memory_backup_configure, memory_backup_status, memory_backup_now and memory_backup_restore. memory_backup_configure returns a claim link for the token or key.
Git restores use the same overwrite and trust_owner options. Pass them as JSON fields to the console endpoint at POST /api/memory/backup/restore. SwB frames content from commits by other authors as external information.