Skip to content

Releases: Ray-Hughes/jevalyn

v0.1.0 — first release

Choose a tag to compare

@Ray-Hughes Ray-Hughes released this 21 Sep 02:16

Jevalyn is the decision layer for your Rails app, built on TypeSafe's Jev.

class SupportTriage < Jevalyn::Decision
  question :department, type: :choice,
    instructions: "Which team should handle this?",
    criteria: {
      billing:   "Payments, invoicing, refunds",
      technical: "Bugs, outages, integrations",
      sales:     "Pricing, upgrades, new accounts"
    },
    confidence_threshold: 0.8
end

SupportTriage.evaluate(ticket.body).department   # => :technical

Jev is a System One model: you give it a state and typed questions, it gives back typed,
calibrated answers. A probability, one of your options, a level on your rubric. It does
not generate text, and Jevalyn does not pretend otherwise — what it does is make a
decision cheap and fast enough to sit directly in a Rails request.

What's in it

  • Decision — the question DSL, validated when the class body runs, so a rubric with
    eleven score levels fails on boot rather than as a 422 on a Friday afternoon. All
    questions go out in one request.
  • Per-question confidence floorsconfidence_threshold: on a question, with the
    class-level value as the default. Routing to the wrong team costs more than a
    roughly-right severity, and one number per decision cannot say that.
  • Guardrail — a single-noul gate answering #allow?. Denies rather than failing
    open when the API is unreachable.
  • Router — dispatch on a choice answer with a confidence floor underneath, and a
    build-time check that every option your criteria can return has a route.
  • Testingmock_mode never opens a connection; stubs expand friendly values
    (true, :technical, "major") into responses the real API could have returned. An
    unstubbed evaluation raises rather than answering nil. Cassettes for the handful of
    tests that should hit real answers.
  • Generatorsjevalyn:install, jevalyn:decision, jevalyn:guardrail, plus
    rails jevalyn:ping.

Two things the docs will trip you on

Both cost me a rewrite, and they apply to any Jev client, not just this one:

  • Noul answers carry no confidence. TypeSafe returns confidence on Choice and
    Score only. For a noul the probability is the answer, and 0.5 is the model saying it
    does not know. Jevalyn exposes #confidence as nil and derives #certainty from
    distance off a coin flip, so thresholds work across all three types.
  • A score answer is a weighted Float, not a level label. 2.4 means past major and
    heading for critical. #label gives you the nearest level's name.

Requirements

Ruby 3.1+, Rails 7.0+. MIT. Unofficial and not affiliated with TypeSafe AI.

gem "jevalyn"

167 examples, CI on Ruby 3.1–3.4. Bug reports and rubric-wording arguments both welcome.