shipwithjev

Catalog / Tools & apps

0043GitHub

jevalyn

A Rails-native decision layer: typed answers inside control flow.

Raymond Hughes’s gem wraps the TypeSafe API the way a Rails app expects. A calibrated decision becomes an ordinary branch in the code.

Ray-Hughes/jevalynREADME ↗
**Fast, cheap, structured decisions baked into your Rails app's control flow.**

[](https://rubygems.org/gems/jevalyn)
[](https://rubygems.org/gems/jevalyn)
[](https://github.com/Ray-Hughes/jevalyn/actions/workflows/ci.yml)
[](https://www.ruby-lang.org)
[](https://rubyonrails.org)
[](https://docs.typesafe.ai)
[](LICENSE.txt)

[Install](#install) · [Decisions](#decisions) · [Guardrails](#guardrails) · [Router](#router) · [Testing](#testing)

</div>

---

```ruby
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.75
end

result = SupportTriage.evaluate(ticket.body)

result.department   # => :technical
result.certain?     # => true
```

**Jevalyn is the decision layer for your Rails app**, built on
[Jev](https://docs.typesafe.ai). That is a routing decision made by a model, inside a
Rails request, in about as long as a database query. Not a prompt, not a parsed JSON
blob, not a retry loop around something that might return prose this time.

## What this is, and what it is not

Jevalyn wraps [TypeSafe's Jev](https://docs.typesafe.ai), a **System One** model. You
give it a `state` and a set of typed questions; it gives back typed, calibrated
answers. There are exactly three kinds of question:

| Type | Ask it | Get back |
| --- | --- | --- |
| `noul` | a yes/no question | the probability the answer is yes, `0.0`–`1.0` |
| `choice` | pick one of up to 255 options you define | the winner, the full distribution, a confidence |
| `score` | rate against 2–10 ordered levels you define | a weighted score, the d

Also filed under Tools & apps

  1. 0573

    Support chat: agent offered a human escalation path

    A frustrated customer hits a bot loop twice; the judge checks whether a human handoff was offered.

    everyai-com · Tools & apps

  2. 0572

    Subscription cancel: effective date is explicit

    An agent cancels a subscription; the judge checks the exact date the cancellation takes effect.

    everyai-com · Tools & apps

  3. 0571

    Sales quote: numbers match the official price list

    An agent quotes $29/seat against a price list; the judge checks the quote matches exactly.

    everyai-com · Tools & apps

  4. 0570

    Refund chat: agent stated the amount before issuing it

    A support agent issues a $42.50 refund; the judge checks the exact amount was stated before the refund was confirmed.

    everyai-com · Tools & apps