Ephemeral AI Lab's LayerFS Gives Parallel AI Agents Forkable Isolated Filesystems
A Rust-based filesystem gives each AI agent a disposable, zero-copy fork of a shared base, enabling cheap branching, rollback, and parallel rollouts.
Takeaways
- LayerFS gives every agent a zero-copy, disposable filesystem fork over a shared base, written in Rust.
- Uses CAS, content-defined chunking, and copy-on-write so new states cost only what changed, not full workspace size.
- Measured: 16 deterministic edits = 0.225 MiB; prepend 10 bytes to a 32 MiB file = 0.0256 MiB.
- Lifecycle is Layer/Commit then Branch then Workspace, enabling MCTS-style rollouts, rewind, and branch promotion.
- Developer preview v0.1.6, MIT licensed, SQLite-backed, single Store per Client, not crash-durable yet.
- Pairs with sibling projects AgentsGit and Ephemeral Sandbox for full agent infra.
Ephemeral AI Lab has released LayerFS, an open-source storage system that gives AI agents isolated, forkable views of the same filesystem. The Rust project combines ideas from container image layers and Git, storing a shared base alongside the unique changes produced by each agent.
Parallel coding agents need isolation because shared directories create races and conflicting edits. Full workspace copies provide that isolation at the cost of duplicating repositories, dependencies, and environment state for every rollout. LayerFS makes branch storage track unique changes, which suits runtimes that create and discard many candidate solutions.
| Item | Current status |
|---|---|
| Release | v0.1.6 developer preview |
| License | MIT |
| Implementation | Rust 1.85 or later |
| Platforms | macOS and Linux |
| Optional container support | Docker, /dev/fuse, and CAP_SYS_ADMIN |
A filesystem built for branching
LayerFS records filesystem history in a SQLite-backed, content-addressed store. An agent runtime can create an ephemeral workspace for each filesystem-affecting tool call, retain successful output as an immutable commit, and discard failed work.
A LayerStack is an append-only sequence of commits in which every point represents a complete logical filesystem state. Agents can fork from different commits while continuing to reference the same unchanged objects. Branch creation therefore avoids copying the underlying workspace contents.
The main concepts divide responsibility clearly:
Store: holds content-addressed objects and filesystem history.Commit: records an immutable filesystem checkpoint.LayerStack: organizes commits into an append-only history.Branch: receives commits produced from a selected starting state.Workspace: provides the ephemeral filesystem view in which commands run.
Why the deltas stay small
LayerFS combines three storage techniques so each checkpoint exposes a complete filesystem while storing only new data and metadata:
- Content-addressed storage: names immutable objects from their canonical bytes, verifies reads, and reuses identical content across files, stacks, and agents.
- Content-defined chunking: selects chunk boundaries from file content, allowing localized edits to preserve most existing chunks in a large file.
- Copy-on-write publishing: rebuilds the changed file and its directory path while retaining references to unchanged subtrees.
The project’s deterministic benchmark reports the following semantic growth, meaning the unique content added by each workload:
| Benchmark workload | Reported growth |
|---|---|
| Sixteen deterministic edits | 0.2250 MiB |
| Prepend 10 bytes to a 32 MiB file | 0.0256 MiB |
Those results demonstrate deduplication under the project’s test inputs. Actual storage growth will depend on file types, edit patterns, and the number of unique artifacts created by each rollout.
From commit to disposable workspace
A typical LayerFS operation follows a six-step lifecycle:
- Select an existing layer or commit.
- Fork a branch from that state.
- Create an ephemeral workspace for the branch.
- Run a command with
workspace exec. - Publish retained filesystem changes with
commit. - Remove the projection with
end.
Every workspace exec invocation starts a fresh process, so process-local state such as shell variables does not carry into the next invocation. Filesystem changes remain available within the workspace until it ends. The end operation never commits implicitly, which lets runtimes discard speculative work explicitly.
Build the preview locally
The following commands build the pinned v0.1.6 CLI, create a SQLite store, select it as the active context, and initialize an empty stack:
git clone https://github.com/Ephemeral-AI-Lab/layerfs.git
cd layerfs && git checkout v0.1.6
cargo build --release -p layerfs-cli
export LAYERFS_BIN="$PWD/target/release/layerfs"
"$LAYERFS_BIN" db create "$PWD/.layerfs/store.sqlite"
"$LAYERFS_BIN" context use --store "$PWD/.layerfs/store.sqlite"
"$LAYERFS_BIN" layerstack init --name demo --empty
Managed container workspaces add Docker and FUSE requirements. FUSE allows a user-space program to expose a mounted filesystem through the kernel interface. On Linux, access to /dev/fuse and the broad CAP_SYS_ADMIN capability may conflict with restricted container policies.
Where LayerFS plugs in
LayerFS targets workloads that branch repeatedly from shared state:
- Parallel coding agents can test separate fixes against the same repository snapshot.
- Environment experiments can vary configuration files and installed packages while preserving a common base.
- Tree-search systems can fork from any prior node, retain promising results, and discard unsuccessful leaves.
The project focuses on filesystem storage within a broader agent stack. Ephemeral AI Lab’s AgentsGit handles version-control workflows for agent output, while Ephemeral Sandbox provides isolated execution environments.
Preview limits set the boundary
Version 0.1.6 has several constraints that affect deployment and integration:
- Each
Clientoperates against oneStore, with no cross-host synchronization. - Transaction visibility within a running process does not guarantee recovery after a crash or power loss, and workspace backing data is not fsynced.
- Commits can miss changes made through shared memory mappings while the kernel still holds dirty pages.
- Canonical construction uses one worker. Six deduplication and chunking construction cases run 1.50 to 1.65 times slower than in v0.1.5.
- CLI JSON output uses a preview text envelope and has no stable machine-readable contract.
The documented scope covers local evaluation, agent-runtime integration, and performance research. Production storage remains outside the preview’s scope, so important data requires an independent copy.
Filesystem states become search nodes
Search-based agents treat filesystem checkpoints as nodes from which they generate candidate actions. Cheap forks let a scheduler launch multiple candidates from the same parent, preserve selected results, and reclaim discarded work while keeping unchanged content shared.
LayerFS moves those branching semantics into the storage layer instead of rebuilding them through directory copies and container snapshots. Its durability, synchronization, and API limits currently constrain deployment, but the preview provides a concrete model for runtimes that need large numbers of speculative, isolated workspaces.