Branching
Isolate changes, propose updates, and merge them back with git-style version control.
Every write to an Omnigraph repository happens on a branch. Branches let agents and humans propose changes in isolation, inspect the result, and merge back when the change is ready. Nothing touches main until you say so.
Why branching matters for agents
Agent systems that write to shared state need a way to contain mistakes. A branch gives each agent — or each step of a pipeline — its own workspace:
- Isolation — An agent can load data, run mutations, and validate results without affecting the canonical branch.
- Inspection — You can diff a branch against
mainto see exactly what changed before committing. - Rollback — If a branch is wrong, discard it. The rest of the graph is untouched.
- Concurrency — Multiple agents can work on separate branches at the same time without coordination overhead.
How it works
Branches in Omnigraph are lightweight. Creating a branch does not copy any data. Instead, each branch is a pointer to a snapshot — a version of the graph at a specific point in time. When a write lands on a branch, only the affected tables are forked using lazy copy-on-write. Unmodified tables continue to share storage with the parent branch.
This means creating a branch is near-instant regardless of graph size, and storage grows only in proportion to what actually changed.
Key concepts
| Concept | Description |
|---|---|
| Branch | A named pointer to a snapshot. Writes target a branch, reads can target any branch or snapshot. |
| Snapshot | An immutable, version-numbered state of the graph. Every write produces a new snapshot. |
| Commit | The act of applying a write to a branch, advancing it to a new snapshot. |
| Merge base | The most recent snapshot shared by two branches — used to compute a three-way merge. |
| Run | An isolated transactional branch created for a specific agent task. |
Typical workflow
A branch-based workflow follows four steps:
1. Create
omnigraph branch create --uri ./repo.omni --from main feature-x2. Load or mutate
Write data to the branch. The rest of the graph is unaffected.
omnigraph load ./repo.omni --data updates.jsonl --branch feature-x3. Inspect
Read from the branch to verify the result, or diff it against main:
omnigraph read ./repo.omni \
--query checks.gq \
--name validate \
--branch feature-x4. Merge
When the branch looks correct, merge it back:
omnigraph branch merge --uri ./repo.omni feature-x --into mainConcurrency model
Omnigraph uses snapshot isolation for reads and optimistic concurrency for writes.
- Reads always see a consistent snapshot. A read on
mainwill never see a half-applied write from another branch. - Writes on different branches proceed independently. When two branches modify the same data and one merges first, the second merge will detect conflicts using three-way comparison against the merge base.
This model avoids locks entirely. Agents do not need to coordinate with each other during their work — conflicts are detected and surfaced only at merge time.