Overview¶
Automi is a lightweight, structured-concurrency streaming toolkit for Go 1.27 built on generic methods and iter.Seq2[T, error].
You build a pipeline by chaining typed methods on a Stream[T] value, then execute it by passing a context.Context to a terminal call such as Into, Collect, ParEach, or All.
What Automi Solves¶
Hand-written Go streaming loops mix business transforms with tricky concurrency plumbing. Bounded worker pools, ordered output windows, idle-timer batch flushing, overflow eviction, and panic recovery all leak into application code.
Automi isolates those concurrency mechanics behind immutable Stream[T] values and zero third-party dependencies:
- Compile-time type safety: Type transitions (
Stream[[]string]→Stream[Record]→Stream[[]Record]) are verified at compile time with no reflection oranycasts. - Zero-goroutine sync fusion: Pure and synchronous transforms (
Filter,Map,TryMap,FlatMap,Take,Drop,Tap,Through) compose directly overiter.Seq2[T, error]. - Bounded async boundaries:
ParMap,ParEach, timedBatch,Buffer,Debounce,Merge,Zip, andFanOutmanage bounded channels under a childcontext.Contextand await complete goroutine teardown. - Composable per-item steps:
Step[In, Out]wraps fallible functions with.Retry,.CircuitBreaker,.OnError,.Then, andChain, independent of serial or concurrent execution.
Scope and Integration Philosophy¶
Automi is a composable streaming toolkit, not a standalone broker client or distributed cluster framework. The root module imports only the Go standard library.
To read from or write to external systems—such as Kafka, NATS JetStream, gRPC streams, or database/sql—adapt your existing Go client through FromFunc, Source[T], Sink[T], or SinkFunc[T]. Automi handles backpressure, batching, concurrency bounds, and cancellation around that seam.
See Custom Sources & Sinks for adapter patterns.
Next Steps¶
- Check compiler requirements in Installation.
- Build a working pipeline in the Quickstart.
- Understand lazy fusion and goroutine bounds in the Execution Model.
- Browse every stage in the Components Index.
- Study end-to-end programs in the Examples Gallery.