The Memory Drive is each user’s agent memory, stored as a private git repo in the open Agent Memory Repo format. These routes are served by the Allternit API data-plane node under /api/v1, next to the Memory API and hosted brains. They use the normal signed-in session. For the user-facing guide see Memory Drive. The drive is the source of truth. The kernel’s memory_facts rows are an index rebuilt from it after every commit, so /memory/v2/recall keeps working unchanged.

Errors

Choosing a drive

Every route takes an optional drive, as a query parameter for GET or a body field for POST/PUT. The default is personal. Access is checked on every request, so removing someone from a workspace removes their access at once, including their git tokens for that drive.

GET /memory/drive/mounts

Every drive you can open.
revision is null for a drive that hasn’t been created yet; opening it creates it.

Files and history

GET /memory/drive/info

Creates your personal drive on first call.
clone_url never contains a credential. usage is { bytes, files, max_bytes, max_files }. pending_writes counts writes whose commit failed and will be retried.

Writing

POST /memory/drive/write

Applies a batch as one commit, only if the drive is still at expected_revision.
Returns { revision, changed }. MEMORY.md’s ## Index is regenerated from the topic files on every write. twin/ is managed by Allternit and can’t be written.

POST /memory/drive/remember

Saves one memory without building an entry yourself.
The server sets the id and date and picks the topic file from memory_type (facts.md, preferences.md, events.md, procedures.md, people-and-things.md, relationships.md, tasks.md) unless you pass path. With session the source is that session’s link; without it, a manual save from Settings. Returns { revision, fact_id, path, entry_id } for the personal drive.

POST /memory/drive/import

Moves memories saved before the drive existed into it.
  • {} (dry run) returns the plan and changes nothing: { dry_run: true, plan: { total, converted, skipped, topic_files, already_imported, rows } }.
  • { "apply": true, "expected_revision": "…" } writes one Import existing memory commit. Running it again changes nothing.
Old rows stay visible for 30 days after the import and are then hidden. They are never deleted.

POST /memory/drive/import-text

Imports memories from another assistant. Body { text, from: "chatgpt" | "claude" | "other", apply? }. text is plain lines, bullets, a numbered list, or JSON (an array of strings, or objects with content, memory or text), up to 500 items and 512 KB.
  • Dry run: { dry_run: true, plan: { from, path, entries: [text], skipped: [{ text, reason }] } }.
  • apply: true: one commit to imports/<from>.md, returns { dry_run: false, revision, imported }.

POST /memory/drive/purge

Permanently removes entries from the drive and its whole history. Body { drive?, expected_revision, entry_ids: [id], confirm: "delete forever" } (1 to 200 ids; for lines without an id, use the derived entry-<sha256> id). Returns { revision, purged }. Commit messages, authors and dates are kept; stored revisions (index, import, Dreams) are remapped; Dream reports that quoted a purged memory are replaced with a note. Purged ids and text are refused from then on, on writes and pushes. Clones made before the purge keep their copy.

POST /memory/drive/reindex, GET /memory/drive/health

Rebuild the index from the drive now, and report { revision, indexed_revision, index_dirty, imported_at, pending_writes }.

Clone tokens

A token opens exactly one drive. A read token can clone and fetch; a write token can also push. Use it as the git password, never in the URL:
Every push is checked before the branch moves: only main, fast-forward only, at most 200 commits, every file a markdown file in the standard format, no possible credentials, and no changes to twin/. A refused push prints Memory Drive refused this push: and the reason. After an accepted push the index is rebuilt.

Nightly Dream

status is running, applied, no_changes, failed or undone. summary counts merged, resolved, lessons, pruned, proposals and skipped. See how Dreaming works.

Questions board

For team, project and swarm drives. Questions and answers live in questions.md. status is open, answered (at least one answer) or resolved. Bots reach the same board through the MCP tools memory_questions, memory_ask and memory_answer (with drive), using their owner’s membership. Concurrent askers and answerers never overwrite each other: each change is retried on the latest version.