Hive – LangGraph for Swift, but built on BSP supersteps

(github.com)

1 points | by ckarani 10 hours ago ago

1 comments

  • ckarani 10 hours ago ago

    Foundation Models are on-device in iOS 26. The inference story is real. The workflow story isn't — there's no native Swift runtime for reliable agent graphs. I built one.

    The insight: borrow Bulk Synchronous Parallel execution from distributed systems. Nodes run concurrently, writes are held until the frontier completes, then committed atomically. The next step sees a clean snapshot. Same inputs → byte-identical event streams, every time. Deterministic by construction, not by convention.

    That discipline is unforgiving. Every sort in the codebase uses utf8.lexicographicallyPrecedes — never Swift's locale-aware String.<. One wrong comparator and replay breaks across machines. The graph version is a SHA-256 hash of the full topology. Checkpoints hard-reject hash mismatches. You cannot accidentally resume against a modified graph. Swift 6 strict concurrency is a design constraint, not an afterthought. Node closures run in a static func that physically can't capture the actor — the compiler enforces isolation, not a comment in the README.

    Interrupt/resume, fan-out/join, and a SwiftUI-style workflow DSL are all first-class primitives.

    https://github.com/christopherkarani/Hive