The Lodash for GenAI: Real Value + Consistent + Model-Agnostic
The Lodash for GenAI: Real Value + Consistent + Model-Agnostic
The Lodash for GenAI: Consistent + Model-Agnostic ActiveGenie is a toolkit for building GenAI features in Ruby. Its modules are model-agnostic and work across providers.
ActiveGenie::Comparatorsettles subjective comparisons by staging a structured debate between the two inputs.ActiveGenie::Scorergrades content with a jury of domain experts.ActiveGenie::Rankerorders large datasets with a tournament system.
Results stay consistent for three reasons:
gem 'active_genie'bundle installExport a key for any supported provider:
export OPENAI_API_KEY="sk-..."See the installation guide for Rails setup and explicit configuration.
require 'active_genie'
text = "Nike Air Max 90 - Size 42 - $199.99"
schema = {
brand: { type: 'string', enum: %w[Nike Adidas Puma] },
price: { type: 'number', minimum: 0 },
size: { type: 'number', minimum: 35, maximum: 46 }
}
result = ActiveGenie::Extractor.call(text, schema)
result.data
# => { brand: "Nike", price: 199.99, size: 42 }
result.reasoning
# => "Brand name appears at the start of the listing, price in USD at the end."Every module returns an ActiveGenie::Result with data, reasoning, and metadata.
ActiveGenie::Scorer.call(text, criteria).data # => 91
ActiveGenie::Comparator.call(a, b, criteria).data # => the winning input
ActiveGenie::Lister.call(theme).data # => ["Price", "Battery life", ...]
ActiveGenie::Ranker.call(items, criteria).data # => items, best firstFull documentation is at activegenie.ai:
git checkout -b feature/amazing-feature)git commit -m 'Add amazing feature')git push origin feature/amazing-feature)This project is licensed under the Apache License 2.0. See the LICENSE file for details.
No open issues yet, or sync has not completed.