agentrun
★ 423▲ 13Parcha-ai/agentrun
A workflow DSL for agents with a Jev package for the steps that are decisions rather than generation.
Probabilistic control flow for Ruby and Rails, with predicates that read like ordinary conditionals.
View on GitHub →Hands-on review
chance, pick and rate as Ruby methods, with a stub backend for tests and one API call per decide block. It reads like Ruby, not like an SDK.
Good for
Watch out for
Tested Sep 21, 2026 at 4651c3ea1e2d · Ruby 3.3 in Docker; its 46 tests, and live calls against the real API from an irb-style script
How we reviewed this: we installed the gem from the repository in Docker on Ruby 3.3, ran its test suite, and made live calls against the real API — a probability, the predicates, a pick, a rating, and a batched decide block.
Three primitives, named the way a Ruby developer would name them:
Hunch.chance("this order is fraudulent", given: order) # => 0.74
Hunch.likely?("this order is fraudulent", given: order) # => true
Hunch.pick(:billing, :fraud, :support, given: order,
question: "which team should handle this order?") # => :fraud
Hunch.rate(:low, :medium, :high, given: order,
question: "how risky is this order?") # => #<Rating high>
Those are our results from a live call on a made-up order — a US billing address, a Russian shipping address, a twelve-item basket on a zero-day-old account. The predicates are thresholds over chance: possibly? at 0.25, likely? at 0.5, probably? at 0.75, almost_certainly? at 0.93, definitely? at 0.99. Reading if Hunch.probably?("fraudulent", given: order) in a Rails model is the whole pitch, and it lands.
pick takes bare symbols or described ones (pick(hold: "stop the order", ship: "send it", given: order)), and rate returns a level plus a position on the scale, so you can branch on the level or compare the number.
The part that makes it practical is decide:
r = Hunch.decide(given: mail) do |q|
q.probably? :urgent, "does this convey urgency?"
q.pick :team, billing: "payments and refunds", technical: "bugs", sales: "pricing"
q.rate :mood, :calm, :frustrated, :livid
end
On a refund complaint we wrote, live:
urgent: 0.95 (true)
team: :billing {technical: 0.0, billing: 1.0, sales: 0.0}
mood: :frustrated
Three judgments, one round trip, and the probabilities are there when you want to argue with the answer. That is the correct shape for this model, and several projects in this directory get it wrong by asking one question at a time.
The stub backend is the other reason to like this gem:
Hunch.backend = Hunch::Backends::Stub.new(fraud: 0.95, team: :billing, mood: :calm)
Answers are keyed by the question’s key, missing answers raise unless you pass default:, and every call is recorded in calls for assertions. Raising on a missing answer is the right default: a test that quietly invents a probability is worse than one that fails.
The repository’s own suite is 46 runs and 118 assertions, all passing, and the example/ directory is a small Rails app with the README’s validations, error triage and inbound-mail examples plus their tests.
given: is the state. Whatever you pass — a string, a hash, an ActiveRecord attributes hash, a raw email — is what goes to TypeSafe or OpenRouter. In a Rails model that is easy to be careless with: given: order.attributes includes every column. Send the fields the question needs.
A failed call raises. The README’s Rails examples all carry rescue Hunch::APIError and return nil, which is the honest pattern — a validation that cannot reach the API should not block a signup — but it means the rescue is your job at every call site, and a missed one turns an outage into a 500.
It is early. Created 18 September, nine commits, one author, MIT, published as hunch 0.3.0 on RubyGems, CI green. Nothing here is half-built, but the version number is accurate.
The nicest-feeling library in this batch. It does not ask you to think about requests, questions or schemas: you write the sentence, you get a Ruby value, and when you want several answers about the same object you get them in one call. The stub backend means the tests you already have keep working.
Pass the narrow slice of your record rather than the whole thing, wrap the call sites the way the README’s own examples do, and treat 0.3.0 as the number it is.
For the Rails-specific version of the same idea see Jevalyn; for TypeScript, Advocaat.
See how it compares with other tools in Best Jev tools, tested hands-on.
Review updated Sep 21, 2026. Numbers quoted from the project are its author's own; we don't publish our own measurements of Jev.
Parcha-ai/agentrun
A workflow DSL for agents with a Jev package for the steps that are decisions rather than generation.
osolmaz/switch
TypeScript framework for decision-model harnesses: your program offers a short list of next steps and the model picks one at a time until it can answer, with chess, wikirace and rubric-judge examples run on Jev.
disler/ten-levels-of-jev
Thirty worked uses arranged in ten levels, from one if statement to an agent that reaches for Jev itself, with a video walkthrough.
New Jev releases, pricing changes, and the best new projects, once a week. No spam; unsubscribe anytime.
Powered by Buttondown. See our privacy policy.