ArcFlow
Company
Managed Services
Markets
  • News
  • LOG IN
  • GET STARTED

OZ brings Visual Intelligence to physical venues, a managed edge layer that lets real-world environments see, understand, and act in real time.

Talk to us

ArcFlow

  • World Models
  • Sensors

Managed Services

  • OZ VI Venue 1
  • Case Studies

Markets

  • Sports
  • Broadcasting
  • Robotics

Company

  • About
  • Technology
  • Careers
  • Contact

Ready to see it live?

Talk to the OZ team about deploying at your venues, from a single pilot match to a full regional rollout.

Schedule a deployment review

Ā© 2026 OZ. All rights reserved.

LinkedIn
ArcFlow Docs
Get Started
  • Get Started
  • Quickstart
  • Installation
  • Project Setup
  • Platforms
  • Bindings
  • Licensing
  • Pricing
Capabilities
  • Vector Search
  • Graph Algorithms
  • Sync
  • MCP Server (AI Agents)
  • Live Queries
  • Programs
  • Temporal
  • Spatial
  • Trusted RAG
  • Behavior Graph
  • Agent-Native
  • Event Sourcing
  • GPU Acceleration
  • Intent Relay
Concepts
  • World Model
  • Graph Model
  • Query Language (GQL)
  • Graph Patterns
  • SQL vs GQL
  • Parameters
  • Query Results
  • Persistence & WAL
  • Error Handling
  • Observations & Evidence
  • Confidence & Provenance
  • Proof Artifacts & Gates
  • Skills
GQL / WorldCypher
  • Overview
  • MATCH
  • WHERE
  • RETURN
  • OPTIONAL MATCH
  • CREATE
  • SET
  • MERGE
  • DELETE
  • REMOVE
  • WITH
  • UNION
  • UNWIND
  • CASE
  • Spatial Queries
  • Temporal Queries
  • Algorithms Reference
  • Triggers
Schema
  • Overview
  • Indexes
  • Constraints
  • Data Types
Functions
  • Built-in Functions
  • Aggregations
  • Procedures
  • Shortest Path
  • EXPLAIN
  • PROFILE
Skills
  • Overview
  • CREATE SKILL
  • PROCESS NODE
  • REPROCESS EDGES
Operations
  • CLI
  • REPL Commands
  • Snapshot & Restore
  • Server Modes & PG Wire
  • Persistence
  • Import & Export
  • Docker
  • Architecture
  • Cloud Architecture
  • Sync Protocol (Deep Dive)
Guides
  • Agent Integration
  • World Model
  • Graph Model Fundamentals
  • Trusted RAG
  • Using Skills
  • Behavior Graphs
  • Swarm & Multi-Agent
  • Migration Guide
  • Filesystem Workspace
  • From SQL to GQL
  • ArcFlow for Coding Agents
  • Data Quality & Pipeline Integrity
  • Code Intelligence
Tutorials
  • Knowledge Graph
  • Entity Linking
  • Vector Search
  • Graph Algorithms
Recipes
  • CRUD
  • Multi-MATCH
  • MERGE (Upsert)
  • Full-Text Search
  • Temporal Queries
  • Batch Projection
  • GraphRAG
Use Cases
  • Agent Tooling
  • Knowledge Management
  • RAG Pipeline
  • Fraud Detection
  • Sports Analytics
  • Grounded Neural Objects
  • Behavior Graphs
  • Autonomous Systems
  • Digital Twins
  • Robotics & Perception
Reference
  • TypeScript API
  • GQL Conformance
  • Compatibility Matrix
  • Glossary
  • Data Types
  • Operators
  • Error Codes
  • Known Issues

Sync Architecture

ArcFlow instances run locally (browser WASM, Node.js, edge device) and optionally sync to a persistent cloud graph via HTTPS. Local operations are instant. Sync is eventual, conflict-resolved, and resumable.

Overview#

Local instance              Cloud / Primary
ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”  HTTPS  ā”Œā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”
│ Browser (WASM)   │────────→│ ArcFlow Cloud    │
│ Node.js process  │←────────│                  │
│ Edge device      │  sync   │ Persistent graph │
│                  │         │ Shared state     │
│ Local WAL        │         │ Multi-client     │
ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜         ā””ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”€ā”˜

All operations happen locally first. Sync pushes WAL deltas to the cloud and pulls remote changes back. Conflicts are resolved algebraically.

Activation#

Browser#

https://oz.com/engine?sync=af_xxxxxxxxxxxx

SDK#

import { open, openInMemory } from 'arcflow'
 
// In-memory with cloud sync
const db = openInMemory({
  sync: 'https://api.oz.com/v1/graphs/my-graph',
  token: 'af_xxxxxxxxxxxx'
})
 
// Persistent with cloud sync
const db = open('./local-graph', {
  sync: 'https://api.oz.com/v1/graphs/my-graph',
  token: 'af_xxxxxxxxxxxx'
})
 
// Self-hosted sync target
const db = openInMemory({
  sync: 'https://my-company.com/arcflow/sync',
  token: process.env.ARCFLOW_TOKEN
})

MCP server#

npx arcflow-mcp --sync https://api.oz.com/v1/graphs/my-graph --token af_xxx

Sync protocol#

Data flow#

1. Local mutation
   ↓
2. Append to WAL (MutationOp with sequence number)
   ↓
3. Batch into sync payload { peer_id, seq_start, seq_end, ops[], fingerprint }
   ↓
4. POST to sync endpoint
   ↓
5. Cloud applies ops with conflict resolution
   ↓
6. Cloud responds with remote changes since client's high-water mark
   ↓
7. Client applies remote changes locally
   ↓
8. Fingerprint comparison — both sides should match

Sync batch format#

interface SyncBatch {
  peer_id: string           // Client identifier
  seq_start: number         // First sequence number in batch
  seq_end: number           // Last sequence number in batch
  ops: MutationOp[]              // Mutations (CreateNode, DeleteNode, SetProperty, etc.)
  fingerprint: number       // Graph state hash after applying ops
}

MutationOp types#

type MutationOp =
  | { type: 'CreateNode', id: string, labels: string[], properties: Record<string, string> }
  | { type: 'CreateRelationship', id: string, start: string, end: string, rel_type: string, properties: Record<string, string> }
  | { type: 'UpdateNodeProperties', id: string, properties: Record<string, string> }
  | { type: 'SetNodeProperties', id: string, properties: Record<string, string> }
  | { type: 'RemoveNodeProperty', id: string, key: string }
  | { type: 'DeleteNode', id: string }
  | { type: 'DeleteRelationship', id: string }

Resume protocol#

Each client tracks a high_water_mark — the highest sequence number received from the cloud. On reconnect, the client sends its HWM and receives only the changes since then:

POST /sync
{
  "peer_id": "browser-abc123",
  "high_water_mark": 4207,
  "delta": { ... }         // local changes since last sync
}

Response:
{
  "remote_delta": { ... }, // changes from other clients since HWM
  "new_high_water_mark": 4215,
  "fingerprint": 9823471   // expected state after applying all
}

Conflict resolution#

When two clients mutate the same entity concurrently, ArcFlow resolves conflicts using vector clocks and Z-set algebra.

Vector clock ordering#

Client A: { A: 5, B: 3 }
Client B: { A: 4, B: 6 }

Neither dominates → concurrent → conflict detected

Resolution strategies#

StrategyRuleUse case
Last-writer-winsHigher vector clock winsDefault, simple
Confidence-weightedHigher confidence value winsEvidence/observation data
Z-set mergeAlgebraic: insertions add, retractions subtractCounters, aggregates

Evidence-aware merge#

For nodes with confidence scores, the merge preserves the highest-confidence observation:

Client A writes: { name: 'Alice', confidence: 0.87, observation: 'inferred' }
Client B writes: { name: 'Alice', confidence: 0.95, observation: 'observed' }

Merge result: { name: 'Alice', confidence: 0.95, observation: 'observed' }

The engine's confidence-aware merge algebra picks the highest-confidence, highest-observation-class value across concurrent writes: add(a, b) = (max_confidence, highest_observation).

Fingerprint verification#

After applying all changes, both client and cloud compute a fingerprint (hash of graph state). If they match, sync is consistent. If not, a full snapshot reconciliation is triggered.

Implementation waves#

Wave 1: Push-only sync (cloud backup)#

Local → cloud. No conflict resolution needed. Client pushes WAL deltas, cloud applies them.

const db = openInMemory({ sync: url, token, mode: 'push' })
// All local mutations automatically batched and pushed

Wave 2: Bidirectional sync (multi-client)#

Cloud → local + local → cloud. Vector clock conflict resolution. Resume via high-water marks.

const db = openInMemory({ sync: url, token, mode: 'sync' })
// Mutations sync both ways, conflicts auto-resolved

Wave 3: Replicated live views#

Standing queries (CREATE LIVE VIEW) replicated across clients. A live view defined on one client is automatically maintained on others.

// Client A defines a view
db.mutate("CREATE LIVE VIEW top_scores AS MATCH (n) WHERE n.score > 0.9 RETURN n")
 
// Client B reads the same view (synced, incrementally maintained)
db.query("MATCH (row) FROM VIEW top_scores RETURN row")

Wave 4: Edge sync (offline-first)#

Edge devices (IoT, mobile) that go offline and reconcile when back online. Full conflict log with manual resolution option.

Sync capabilities#

The sync engine provides all the primitives needed for local-first architectures:

CapabilityWhat it gives you
WAL delta transportIncremental mutations only — never re-sends unchanged state
Conflict detectionEntity-level detection with causal ordering across peers
Algebraic mergeInsert/retract/consolidate — converges without coordination
Confidence-aware mergeEvidence weights propagate through conflict resolution
Graph fingerprintingHash verification prevents tampering or partial sync
CDC eventsNodeCreated, PropertyChanged, and relationship events
Mutation log querydb.changesSince(seq) — query mutations since any sequence number
Full state snapshotdb.snapshotJson() — complete graph for initial peer sync
Replication modesPrimary / Replica / Edge — runtime-configurable

HTTP API endpoints (planned)#

POST   /v1/graphs/:id/sync     — push delta, receive remote changes
GET    /v1/graphs/:id/snapshot  — full graph snapshot (for initial sync)
GET    /v1/graphs/:id/changes   — changes since sequence N
POST   /v1/graphs/:id/resolve   — manual conflict resolution
GET    /v1/graphs/:id/status    — sync status, peer count, lag

Security#

  • All sync over HTTPS (TLS 1.3)
  • Bearer token authentication per graph
  • Optional: per-peer write permissions (read-only replicas)
  • Fingerprint verification prevents tampering
  • WAL ops are signed with peer_id for provenance

See Also#

  • Sync — capability overview: WAL delta, conflict resolution, and db.changesSince()
  • Cloud Architecture — edge mesh, WAL segment shipping, and CDC delta sync
  • Architecture — in-process engine architecture and storage model
Try it
Open ā†—āŒ˜ā†µ to run
Loading engine…
← PreviousCloud ArchitectureNext →Agent Integration