Skip to main content
Every write in AMFS creates a new version of an entry. The previous version is preserved as superseded. This means you never lose history — every change is traceable.

How It Works

When you write to a key that already exists:
  1. The current version is marked as superseded
  2. A new version is created with an incremented version number
  3. The new version becomes the current version
Reading always returns the current (latest) version:

Viewing History

Use list() with include_superseded=True to see all versions:
Or use the CLI:

On-Disk Layout (Filesystem Adapter)

The filesystem adapter stores each version as a separate JSON file:
  • _current.json — the active version
  • _superseded.json — previous versions, kept for history
Writes use atomic rename (os.rename()) with advisory file locking (flock()) to prevent corruption from concurrent writes.

Conflict Handling

When two agents write to the same key concurrently, the conflict_policy determines behavior:
You can also provide a custom conflict resolver:

Why CoW?

  • Auditability — Every change is recorded. You can always trace how knowledge evolved.
  • Safety — No data is lost. Mistakes can be identified by comparing versions.
  • Outcome tracking — Outcomes create new versions with updated confidence scores, preserving the score history.