Contents

feelings / Getting Started

Getting Started

feelings brings the feels construct from the Probably language to Ruby. A decision model reads a value and a description and returns a calibrated probability instead of generated text. feelings turns that probability into things a Ruby program can branch on: booleans, label picks, bounded loops, and semantic match.

Install

Add the gem to your Gemfile:

gem "feelings"

API keys

No configuration is required beyond an API key. Set OPENROUTER_API_KEY or TYPESAFE_API_KEY in your environment. feelings depends on ruby_decision_model, which picks a provider automatically based on whichever key is present, and builds the default judge the first time you ask it something.

To use OpenAI’s gpt-6-luna, Cloudflare’s Clef, Perplexity’s pplx-decider, Databricks or a self-hosted System One server, set RUBY_DECISION_MODEL_PROVIDER to openai, cloudflare, perplexity, databricks or system_one, plus that vendor’s own key. The ruby_decision_model README lists the variables each one reads.

Your first question

require "feelings"

Feelings("that email").like?("genuinely urgent")
# => true or false

Feelings(value) wraps a Ruby object and returns a Feelings::About. Everything else in this gem, like?, like, most_like, pick, and match, is a method on that wrapper.

What a decision model is

A decision model answers a typed question about a value with a calibrated probability rather than a block of text. feelings sends it a description of what you’re asking about and the value in question, and gets back a probability (for a yes/no question) or a probability spread over a set of labels (for a choice among options).

What Feelings(value) returns

Feelings(value) returns a Feelings::About instance. It resolves the value into wire state once, on construction, and memoizes answers per question, so asking the same thing twice on the same wrapper never re-judges. See State for how a value turns into wire state, and Asking Questions for what you can do with the wrapper.

Next: Asking Questions.