stiggy runs fleets of AI agents on NATS. Every decision, handoff and human answer is written to a durable event log, so a fleet survives crashes, scales out across machines, and can be replayed, forked and rewound.
go install github.com/henomis/stiggy/cmd/stiggy@latest
Ants don't hold meetings. Each one leaves a trace in the ground, and the next one reads it. The colony's plan lives in the environment, not in any single ant.
stiggy works the same way. Agents never call each other through fragile in-memory state: a step finishes, its output and its routing choice land in the execution's event log on JetStream, and the next step picks them up from there. Kill a worker halfway through and another one carries on from the last trace.
Write it as YAML and run it with the stiggy binary, or build it in Go. Both produce the same model, checked before anything runs.
namespace: newsroom
models:
fast: {provider: ollama, model: llama3.2-eco}
agents:
researcher: {model: fast, role: Researcher, goal: "Find accurate, recent facts."}
writer: {model: fast, role: Writer, goal: "Write short, clear articles."}
crews:
article:
tasks:
- {id: research, agent: researcher, description: "Research {{.input.topic}}."}
- {id: write, agent: writer, description: Write a 200-word article from the research.}
app, _ := stiggy.New(nc,
stiggy.WithNamespace("newsroom"),
stiggy.WithModel("fast", openai.New("ollama",
openai.WithBaseURL(openai.OllamaBaseURL), openai.WithModel("llama3.2-eco"))),
stiggy.WithAgent("researcher", spec.Agent{Model: "fast", Role: "Researcher"}),
stiggy.WithAgent("writer", spec.Agent{Model: "fast", Role: "Writer"}),
stiggy.WithCrew("article", spec.Crew{Tasks: []spec.Task{
{ID: "research", Agent: "researcher", Description: "Research {{.input.topic}}."},
{ID: "write", Agent: "writer", Description: "Write a 200-word article from the research."},
}}),
)
go app.Run(ctx)
<-app.Ready()
id, _ := app.Client().Start(ctx, "article", map[string]any{"topic": "NATS"})
st, _ := app.Client().Wait(ctx, id)
$ nats-server -js &
$ stiggy validate fleet.yaml # every problem, with its line
$ stiggy compile fleet.yaml # the flows it becomes
$ stiggy run fleet.yaml & # serve it
$ stiggy start -ns newsroom article -input '{"topic": "NATS"}' -wait
stiggy validate reports every problem at once, each with its file line.Each shape is a few lines of YAML that expand into an ordinary durable flow. Run stiggy compile to see exactly what it becomes.
Tasks in order, with parallel async tasks, a guardrail agent that sends work back, or a manager that assigns it.
One agent routes to a worker at a time and gets the report back, until it answers without routing.
Every agent may hand off to any other. The first agent that answers without handing off ends it.
A writer drafts, an evaluator passes it or returns feedback, for up to a set number of rounds.
Debaters argue in parallel for several rounds, each seeing the transcript so far. A judge decides.
A planner lists steps, an executor runs them in parallel, an optional synthesizer combines the results.
Need something else? Write the flow yourself: choices, fan-out and join, maps, subflows, waits, retries and budgets are all there, with agents as steps.
An execution is its event log. Read the state right after any event, branch a new execution from it with different input, or rerun from one step after fixing a prompt. Routing choices and human answers are in the log too, so a fork sees exactly its own history.
Select an event to see the command.
stiggy get <exec> -seq 12
The state as it was right after event 12.
Each process runs the same fleet file and picks its part. Add worker processes when the queue grows; stop one and its jobs are redelivered.
stiggy run -role engine -http :8080 fleet.yaml # drives executions, timers, schedules
stiggy run -role workers -http :8080 fleet.yaml # runs agents; scale it out
stiggy run -role workers -only researcher,writer fleet.yaml # dedicated hosts for some agents
stiggy design opens a canvas in your browser. Connect blocks for agents, routers, loops, conditions, parallel branches, human approval and agent teams, and every save writes a fleet file checked by the same compiler as stiggy validate.
Open source under Apache 2.0. Needs Go and a NATS server with JetStream.