0.0
The project is in a healthy, maintained state
A mountable Rails engine and Ruby library that proposes KPIs from application schemas and certifies their SQL before publication.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 7.0, < 8
 Project Readme

KPIAssembler

Screenshot from 2026-09-09 15-51-19

KPIAssembler discovers application schemas, proposes business metrics, and certifies generated SQL before a number is trusted.

The LLM proposes. Deterministic code certifies.

A separate Python implementation lives at kpi-assembler-python.

Install (Rails)

# Gemfile
gem "kpi_assembler", "~> 0.5"
bundle install
bin/rails generate kpi_assembler:install
# config/routes.rb
mount KPIAssembler::Engine => "/kpi-assembler"

Then:

  1. Edit config/initializers/kpi_assembler.rb (database pool, tenant, auth).
  2. Set GEMINI_API_KEY and KPI_LLM_PROVIDER=gemini in the host .env, or use Ollama / KPI_USE_LLM=false.
  3. Restart the app and open /kpi-assembler.

Full walkthrough, env vars, and troubleshooting: Setup guide.

Rails engine details: docs/rails-engine.md. Standalone Rack/CLI/API: docs/integration.md.

What it does

  1. Discover — introspect tables, columns, and foreign keys
  2. Propose — Gemini, Ollama, or schema heuristics draft KPI SQL
  3. Accept — you choose which candidates to certify
  4. Certify — read-only SELECT, join safety, tenant scope, planner, sample run
  5. Publish — certified pack as JSON (and HTML from the CLI)

Rejected candidates never reach certification. Draft means a selected KPI failed a certification check.

Requirements

  • Ruby >= 3.0
  • Rails 7 for the engine
  • Read-only database access (replica or reporting user)

License

MIT