0.03
The project is in a healthy, maintained state
ActiveGenie is an enabler for creating reliable GenAI features, offering powerful, model-agnostic tools across any provider. It allows you to settle subjective comparisons with a `ActibeGenie::Comparator` module that stages a political debate, get accurate scores from an AI jury using `ActiveGenie::Scorer`, and rank large datasets using `ActiveGenie::Ranker`'s tournament-style system. This reliability is built on three core pillars: - Custom Benchmarking: Testing for consistency with every new version and model update. - Reasoning Prompting: Utilizing human reasoning techniques (like debate and jury review) to control a model's reasoning. - Overfitting Prompts: Highly specialized, and potentially model-specific, prompt for each module's purpose.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

~> 2.0
 Project Readme

ActiveGenie 🧞‍♂️

The Lodash for GenAI: Consistent + Model-Agnostic

Gem Version Ruby

ActiveGenie is a toolkit for building GenAI features in Ruby. Its modules are model-agnostic and work across providers. ActiveGenie::Comparator settles subjective comparisons by staging a structured debate between the two inputs. ActiveGenie::Scorer grades content with a jury of domain experts. ActiveGenie::Ranker orders large datasets with a tournament system.

Results stay consistent for three reasons:

  • Custom benchmarking: every version and model update is tested for consistency.
  • Reasoning prompting: prompts borrow human reasoning techniques, like debate and jury review, to shape how the model thinks.
  • Overfitted prompts: each module uses a specialized prompt built for one purpose.

Requirements

  • Ruby >= 3.4.0
  • An API key for OpenAI, Anthropic, DeepSeek, or Google

Installation

gem 'active_genie'
bundle install

Export a key for any supported provider:

export OPENAI_API_KEY="sk-..."

See the installation guide for Rails setup and explicit configuration.

Quick start

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 first

Documentation

Full documentation is at activegenie.ai:

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the Apache License 2.0. See the LICENSE file for details.