Skip to content

reindex

Backfill existing remote memories into Vectorize embeddings.

Updated View as Markdown
For humans

Usage

machine-memory reindex --remote
machine-memory reindex --remote --json-min
machine-memory reindex --remote --quiet

reindex reads all memories for the current repository from D1, generates embeddings through the remote Worker, and upserts them into Vectorize. Run it after remote provisioning, after migrating to a new embedding index, or when vectors need to be repaired. It is scoped to the current Git repository.

New and updated memories synchronize automatically, so reindexing is normally a backfill or recovery operation rather than part of every write.

The command requires --remote; local databases do not have a Vectorize binding.

Reindex requests are paced to avoid bursts. A rate-limited memory is retried up to three times with exponential backoff; other failures are reported without being retried. Re-running the command is safe because Vectorize operations are upserts.

Output

  1. Use --json-min to get a stable machine-readable object:
{
  "repository": "owner/repository",
  "total": 24,
  "upserted": 24,
  "failed": 0,
  "failures": []
}
  1. Use --quiet when no success output is desired. Non-TTY output does not emit terminal control sequences.
Navigation

Type to search…

↑↓ navigate↵ selectEsc close