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.
Open source · Apache 2.0
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 | bashAnfra Cloud adds logins, permissions and sharing. Join the waitlist

The funnel analysis demo, built by a coding agent with Anfra. Try it live
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
Freedom: build any app, ask any question
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.
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.
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.
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.

A revenue page with two charts: revenue by region and a monthly trend. Clicking a region filters the trend.
Metrics live in the semantic layer as code, written in AMQL.
Dataset sales {
metric revenue {
definition: @aql sum(orders.amount) ;;
}
}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.
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 1Open Inspect on a chart to see the query and metric definitions behind it.
The page declares two queries and a mapping that says a click on one filters the other.
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)Anfra runs locally as a single binary. You don’t need a cloud account to start.
Read the quickstartAnfra is a single binary for Linux and macOS. anfra setup installs the build-anfra-app skill for your coding agent.
anfra setupAdd your connection to .anfra/data_sources.yml. Anfra supports Snowflake, BigQuery, Databricks, Redshift, PostgreSQL, ClickHouse, DuckDB and more.
anfra init custom-biIn 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 filteranfra serve runs your apps locally. Open Inspect on any number to see the query and metric behind it.
anfra serveOpen a demo to try the interactions.

Add, remove and reorder funnel steps. Click a bar to see who converted or dropped off.

Retention heatmap by signup month. Click a cell to filter, or right-click to see the underlying rows.

Operating, investing and financing activities with subtotals, monthly or quarterly.

Add and arrange charts on a canvas. Click a mark to drill into a linked chart.
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.
Shared metric
Used by every app that queries the sales dataset
metric
Revenue
Sum of order amounts.
metric revenue {
definition: @aql sum(orders.amount) ;;
}
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.
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.
Share apps across your company with logins, permissions and audit logs, without running the server yourself.
A paid self-hosted edition with the same features is planned.
curl -fsSL https://raw.githubusercontent.com/holistics/anfra/main/install.sh | bashLinux and macOS.