Open source · Apache 2.0

Build custom BI apps with your coding agent, on a governed semantic foundation.

Your data team defines metrics once, in code, and reviews every change. Every app your agent builds queries those metrics, and every number traces back to its definition and the SQL that ran.

$curl -fsSL https://raw.githubusercontent.com/holistics/anfra/main/install.sh | bash

Anfra Cloud adds logins, permissions and sharing. Join the waitlist

Funnel analysis
Funnel analysis app built with Anfra

The funnel analysis demo, built by a coding agent with Anfra. Try it live

Inspect
Converted65 customers
Query
Funnel, 5 steps, 1-year window
Filter
Order status: completed, shipped
Metric definitions
View
SQL run on your warehouse
View

BI tools give you numbers you can trust. Coding agents give you freedom. Until now, you had to pick one.

A BI tool keeps numbers consistent because your data team models every metric, but you can only build what its charts, filters and layouts allow. A coding agent can build any app you describe, but when it queries raw tables, it decides what each metric means and writes new SQL for every app.

With Anfra, the agent still builds any app you ask for, and every number goes through metrics your data team defines.

Trust: numbers mean what your team means

+ coding agent+ governed
semantic layer
BI toolsCoding agent on raw tablesCoding agent + Anfra

Freedom: build any app, ask any question

What goes wrong when an agent queries raw tables

Calculations can be wrong

An agent writing SQL against raw tables can average a rate that should be recomputed, or join a table that double-counts a fee. The chart still renders, so nobody notices.

Apps disagree with each other

Each new app defines revenue a little differently. After a few months, two apps show two different totals and nobody knows which one is right.

Nobody can check the logic

When the logic lives inside each app’s code, a reviewer can’t easily see which definition a number used or reuse it in the next app.

The agent builds the page. The semantic layer computes the numbers.

Apps built with Anfra don’t contain SQL. They ask for metrics by name, and Anfra turns each request into a query on your semantic layer.

Anfra SDK
A JavaScript library your app uses to request data and wire up filters, drill-downs and period comparisons. It asks for data by dataset and metric names, not SQL.
Anfra Server
Turns each interaction into a query on your semantic layer, runs it on your warehouse and returns the results. It also serves MCP so coding agents can read your models.
Semantic layer
Your models, datasets and metrics, defined as code. Anfra ships with AMQL, the semantic layer behind Holistics, which runs in production at hundreds of companies.
How Anfra works: your app uses the Anfra SDK, which sends requests to Anfra Server. The server queries your semantic layer, which runs SQL on your warehouse.

One metric, from definition to chart

A revenue page with two charts: revenue by region and a monthly trend. Clicking a region filters the trend.

1. Define a metric once

Metrics live in the semantic layer as code, written in AMQL.

AMQL
Dataset sales {
  metric revenue {
    definition: @aql sum(orders.amount) ;;
  }
}

3. Anfra writes the SQL

When a user clicks “APAC”, Anfra filters the trend query and runs this on your warehouse. The page never wrote it, and revenue means the same thing in every app.

SQL
SELECT date_trunc('month', orders.created_at) AS month,
       SUM(orders.amount) AS revenue
FROM orders
JOIN users ON orders.user_id = users.id
WHERE users.region = 'APAC'
GROUP BY 1

4. Inspect any number

Open Inspect on a chart to see the query and metric definitions behind it.

2. Your agent writes the page

The page declares two queries and a mapping that says a click on one filters the other.

JavaScript
const byRegion = app.createQuery('byRegion', {
  dataset: 'sales',
  aql: `explore {
    dimensions { region: users.region }
    measures { revenue: revenue }
  }`,
})
const trend = app.createQuery('trend', {
  dataset: 'sales',
  aql: `explore {
    dimensions { month: date_trunc(orders.created_at, 'month') }
    measures { revenue: revenue }
  }`,
})

app.mapCrossFilter(byRegion, trend)
Read the Semantic UI guide

Build your first app in about ten minutes.

Anfra runs locally as a single binary. You don’t need a cloud account to start.

Read the quickstart
01

Install Anfra and the agent skill

Anfra is a single binary for Linux and macOS. anfra setup installs the build-anfra-app skill for your coding agent.

anfra setup
02

Create a project and connect a warehouse

Add your connection to .anfra/data_sources.yml. Anfra supports Snowflake, BigQuery, Databricks, Redshift, PostgreSQL, ClickHouse, DuckDB and more.

anfra init custom-bi
03

Ask your agent for an app

In Claude Code or Cursor, start the prompt with /build-anfra-app. If you have no models yet, the agent proposes datasets and metrics as code for you to review.

/build-anfra-app Build a revenue overview with a region filter
04

Run it and inspect the numbers

anfra serve runs your apps locally. Open Inspect on any number to see the query and metric behind it.

anfra serve

Your data team decides what “revenue” means.

Writing metric definitions into a prompt doesn’t make an agent follow them. In Anfra, metrics are code that compiles to SQL, so every app that uses revenue gets the same calculation.

  • Your agent drafts models and metrics, and your team reviews them like any other code change
  • Apps query metrics through the SDK and don’t edit the model
  • Inspect shows the query and metric definitions behind each number

Shared metric

Used by every app that queries the sales dataset

in your repo

metric

Revenue

Sum of order amounts.

metric revenue {

definition: @aql sum(orders.amount) ;;

}

Open source and Anfra Cloud

Anfra Cloud is our hosted product, built on the same open-source engine. A project you build with open-source Anfra runs unchanged on Anfra Cloud. Moving it takes one publish step.

Open source

Available now

Build and run apps on your own infrastructure, for yourself or a team that doesn’t need per-user permissions. Free under the Apache License 2.0.

  • Semantic layer, metrics and the AMQL engine
  • JS SDK with controls, interactions and Inspect
  • MCP server and agent skills
  • Runs on your own infrastructure

Anfra Cloud

Waitlist

Share apps across your company with logins, permissions and audit logs, without running the server yourself.

  • Everything in open source, hosted for you
  • Users, SSO and roles
  • Row-level and viewer-level permissions
  • Hosted apps with sharing links
  • Audit logs, usage monitoring and version history

A paid self-hosted edition with the same features is planned.

Frequently asked questions

More answers are in the README and the docs.

Install Anfra and build your first app.

curl -fsSL https://raw.githubusercontent.com/holistics/anfra/main/install.sh | bash

Linux and macOS.