Metrics Book

Cut your BI costs. Let your agent do the analysis.

Open-source BI on one server. Your agent builds it, runs it and answers from metrics your team agreed on.

acme_metrics · this monthday 30
Questions your agents asked
90,000
Your server
$70
A cloud warehouse
$853 to $2,609

1 TB of data, 3,000 questions a day. List prices read 27 October 2026.

Your data · dltorderssourcemarketingsourcestocksourceModels · dbt, in DuckDBstgorder linesintline amountsfctorder linesfctad spendMetrics Book · anfraone servermetrictotal_net_sales_excl_vatmetricreturning_customer_ratemetricnumber_of_ordersData apps and agents Claude Code Net sales by channel? get_metric query flash report retention report ClaudeCodexCursor Data apps and agents reportsbuilt on your metricsagentsask in plain words Metrics Book metricsone definition eachengineanfra Models transformdbt, testedstoreDuckDB Your data loaddlt, on a schedulefromdatabases, APIs, files
Your data · dltorderssourcemarketingsourcestocksourceModels · dbt, in DuckDBstgorder linesintline amountsfctorder linesfctad spendMetrics Book · anfraone servermetrictotal_net_sales_excl_vatmetricreturning_customer_ratemetricnumber_of_ordersData apps and agents Claude Code Net sales by channel? get_metric query flash report retention report ClaudeCodexCursor
Data apps and agents
reports: built on your metrics. agents: ask in plain words.
Metrics Book
metrics: one definition each. engine: anfra.
Models
transform: dbt, tested. store: DuckDB.
Your data
load: dlt, on a schedule. from: databases, APIs, files.

Cloud BI is easy but expensive. Open source is cheap but hard to run.

  • A cloud warehouse and a BI tool run it for you, and bill every query and every seat.
  • An agent on a cloud warehouse lets your agent build and ask, and bills every question it asks.
  • An open-source stack, by hand, costs one server, and takes a skilled person to build and keep running.

Metrics Book gives you the open-source price, and your agent does the running.

A chart of four ways to get BI, by who runs it and how the bill grows. A cloud warehouse and a BI tool, and an agent on a cloud warehouse, bill every question. An open-source stack by hand needs a skilled person. Metrics Book is run by your agent, at one server's price. The bill: billed per questionstays flat as questions growWho runs it: a personyour agentCloud warehouse and BI toolRun for you, billed per query and seatAgent on a cloud warehouseFast to build, every question billedOpen source, by handOne server, one skilled personMetrics BookYour agent runs it, on one server

No surprise bill at the end of the month

A cloud warehouse bills every question, so one stuck agent lands on next month's invoice. Your server is sized for your busiest hour, and its price is fixed. Set your own data and questions below.

1 TB
3,000

Your server, a Hetzner AX41, costs $70 a month. BigQuery and Snowflake cost $853 to $2,609, 12 to 37 times as much.

The bill across a month for your own server, BigQuery and Snowflake, for the data and questions you set above. The sentence above the chart and the table below give the totals. $0$800$1.6k$2.4k$3.2kday 1day 10day 20day 30Your server$70BigQuery$853Snowflake$2,609
Your server
$70
BigQuery
$853
Snowflake
$2,609
30

Your serverHetzner AX41

6 cores · 64 GB RAM · 512 GB NVMe

Listed at € 59.00 per month, excl. VAT; + € 0.00 one-time setup fee, excl. VAT

Needs 5 cores, 26 GB RAM and 413 GB disk: 3 DuckDB threads to answer each question in about 2 seconds, and 187 GB of DuckDB files.

What each bill pays for, a month
Your serverBigQuerySnowflake
Computequeries and dbtincludedin the server's price$824133 TiB scanned a month$2,574Small warehouse, awake 11.0 hours a day (660 credits a month)
Storageyour dataincludedon the server's NVMe$18931 GiB stored$251 TB stored
Serverthe stack$66AX41: 6 cores (AMD Ryzen 5 3600), 64 GB RAM, 2 x 512 GB NVMe mirrored$10Hetzner Cloud CX33 for the rest of the stack$10Hetzner Cloud CX33 for the rest of the stack
Backupsoff the server$4Storage Box BX11, 1 TB, for backupsincludedin the vendor's priceincludedin the vendor's price
Total$70$853$2,609
List prices read 27 October 2026, EU regions, before VAT. Each amount links to the vendor's price page. The server is sized from DuckDB's speed measured on TPC-H and the rules on the cost page; Snowflake is billed for the hours it stays awake. BigQuery bills a loop up to its default quota of 200 TiB a day.

See how the costs were worked out

What goes wrong when an agent runs your BI

  1. It reads the wrong number

    Net sales means something different in every dashboard. The agent can't tell which is right.

    Here: each metric is one file that says what it counts, what it is not, and its caveats. The agent reads it before it asks.

  2. It sees what you can't

    With a shared warehouse key, an agent can read every table, whoever is asking.

    Here: every request runs as the person asking. Cerbos decides it, and the audit log keeps it.

  3. It changes last quarter's numbers

    An agent with write access edits a metric, and a month you closed moves.

    Here: definitions change only in git, through a pull request a person reviews. A closed month moves only when the pull request says it will.

Your agent does the analysis, from numbers you trust

Ask in plain words and get an answer you can act on. "Net sales" means one thing in every chat.

  1. It finds the metric

    Your agent searches the book by meaning, so "revenue" finds net sales.

  2. It reads the definition

    What it counts, what it is not, and the caveats your team wrote down.

  3. It asks as you

    The query runs with your access, and the audit log keeps it.

YouWhat were net sales last month, by sales channel?

search "net sales"metric total_net_sales_excl_vat · dataset ecommerce_sales
get_metric total_net_sales_excl_vatcaveat: the latest weeks read high until refunds arrive
query ecommerce_sales by sales_channelallowed for you · 4 rows · written to the audit log

Net sales excl VAT last month, by web, app, marketplace and store, by your team's definition. Refunds are still arriving, so the total may drop a little.

An illustration of what an agent does over the MCP connector.

How a metric is defined

From an empty folder to 115 metrics in about a minute

Start from the e-commerce template, not a blank page. Your agent takes it from there.

your machine
$ uv tool install metrics-book

mb makes projects, adds templates and runs every check. Every command takes --json.

Not released yet. These commands work from 0.1, the first release. See what works today.

The quickstart, step by step

Everything runs on one server

Follow one question through it. Every part is open source and code first, so your agent can change it and you can review it.

One server runs every part of Metrics Book: the api, anfra, DuckDB, the jobs that run dlt and dbt, Postgres, Cerbos and monitoring. Your sources load into it, and your agent asks it questions. Your server · one Docker Compose appordersmarketingstockyour sources jobs dlt, dbt DuckDB the marts anfra metrics monitoring alerts api MCP, REST Postgres audit log Cerbos access your agent Net sales by channel?

How it works, part by part

Every question is checked before it reaches your data

An agent asks as the person using it. A policy in git decides what each person may see, and the audit log keeps every answer and every refusal.

  • No shared key

    Agents sign in over MCP with OAuth, as the person using them. Service accounts sign in with their own key pair. The query engine sits on an internal network only the API reaches.

  • Cerbos decides first

    Every data request is decided before the query engine sees it. If Cerbos cannot answer, the request is refused, never let through.

  • What you may not see looks missing

    A dataset you may not read gets the same refusal as one that does not exist, and the catalog lists only what you can use.

  • Every decision is logged

    Refusals included. The log is append only, and a request whose audit row cannot be written gets no answer.

  • Policies live in git, with tests

    mb check compiles and tests them on every change. No tool, route or screen edits a metric or a policy, and keys are stored only as digests or public keys.

Who asks

Asks for

  1. 1Signs in as themselves. Sam, marketing, roles viewer
  2. 2Cerbos decides.denysensitivity:restricted keeps viewer out
  3. 3The audit log keeps it, before any answer goes out.
  4. 4The answer. No metric by that name is available to you.

audit_event, newest first

idprincipalviadatasetdecision
1person:sammcpecommerce_profitdeny
The default policy, with the e-commerce template's datasets. In this example the project marks profit sensitivity:restricted.

Access is decided per dataset. Rules per row, such as each market seeing only its own orders, are not in 0.1: put those rows in a dataset of their own. The access layer is built and tested; the MCP tools that use it are being built. See what works today.

How security works

Keep BigQuery or Snowflake if you want

The warehouse is one setting. Your pipelines, models, metrics, reports and access stay the same, so you can adopt the rest now and move your data to DuckDB later, or not at all.

# stack.yml
warehouse:
  type: duckdb

The warehouse module writes

dlt destination
duckdb
dbt adapter
dbt-duckdb
anfra data source
DuckDB

Stays the same

  • pipelines/, your dlt sources
  • transform/, your dbt models
  • semantic/, your metrics and reports
  • access/, who may see what
  • the API, MCP and the audit log

Built. The default, on your server.

  • Why it can switch

    dlt, dbt and anfra each work with the same warehouses: BigQuery, Snowflake, Databricks, Redshift, Postgres, ClickHouse and DuckDB among them. Only one module knows which one you use.

  • Nothing in the template ties you to DuckDB

    The template's dbt models use dbt's cross-database macros, such as dbt.date_trunc, and the end-to-end test runs the template on DuckDB and Postgres on every change.

  • What you keep paying

    On BigQuery or Snowflake, their bill stays yours, as the calculator above shows. The rest of the stack still runs on one small server.

0.1 ships DuckDB and Postgres. BigQuery and Snowflake are each one module, built and tested against a real account before they are listed as supported.

How the warehouse choice works

Built on great open source

Metrics Book stands on these projects, and they deserve the credit.

ProjectWhat it does hereLicence
dltby dltHubLoads your sourcesApache-2.0
DuckDBby DuckDB Foundation and DuckDB LabsStores and queries the dataMIT
dbt Coreby dbt LabsTransforms it into modelsApache-2.0
anfraby HolisticsMetrics, SQL and reportsApache-2.0
PostgreSQL and pgvectorby PostgreSQL Global Development GroupThe app database and searchPostgreSQL
sqlglotby Toby MaoColumn lineageMIT
Honoby Yusuke WadaThe APIMIT
Better Authby Bereket EngidaSign-in, for people and agentsMIT
Cerbosby CerbosAccess, per datasetApache-2.0
Astro and Starlightby Astro contributorsThis site and the docsMIT

Why we chose each one

Where to run it

One Docker Compose app on a Linux server with enough memory for your data. How to deploy says which servers give you the most for your money.

TargetWhat runs whereGuide
One VM with Docker ComposeThe default, and the cheapest. Caddy in front for TLS, and the whole security model holds.The guide comes with 0.1.
Dokploy or Coolify on a VMThe same compose app, with the domain and certificate from the platform.The guide comes with 0.1.
RailwayA service per container, with no server to look after. The warehouse is Postgres there.Planned.
KubernetesNo chart yet. A Helm chart when someone needs one.Not built.

Open source, under Apache 2.0

Nothing is held back for a paid edition, because there is none. Your server, your git repository, your data.

Need help with implementation or strategy?

Enum Studio builds and maintains Metrics Book, and helps companies set it up and build on it.

Get help from Enum Studio