dbt Semantic Layer alternative

The dbt Semantic Layer alternative with verified rules and recursion

SynaLemma is a semantic layer for AI agents: open-ended rules compiled to SQL, verified before they run, with recursion and assertions on the data.

At a glance

SynaLemma vs dbt Semantic Layer at a glance

SynaLemma vs dbt Semantic Layer at a glance
CriterionSynaLemmadbt Semantic Layer
Definitions written in Synalog, a logic language with a compilerYAML on top of dbt models (MetricFlow)
What you can define Any rule, built on other rulesFive metric types; no custom aggregations
Joins As far as the question needsAt most two hops
Hierarchies and multi-hop chains Native recursion, verified to terminateNo recursion
What checks the definitions A symbolic verifier proves every rule well-formed, safe and terminatingConfiguration checks, and the generated SQL must run
Checks on the data Assertions in logic on any rule, with counterexamplesdbt data tests on models: keys, nulls, references
What an agent can run Only the verified layer; a read-only account is enoughMetric queries, plus text-to-SQL and execute_sql, which does not block writes
Deployment Your infrastructure, with the model you chooseThe Semantic Layer APIs need a paid dbt platform plan

Why teams look for a dbt Semantic Layer alternative

  • Five metric types. MetricFlow has no custom aggregations (metrics overview, FAQ).

  • Two-hop joins. MetricFlow joins at most three tables (join logic).

  • No recursion. Hierarchies and multi-hop chains cannot be modelled.

  • Configuration checks. Validation checks the configuration and that the SQL runs (validations).

  • Write-capable SQL for agents. The MCP server's execute_sql does not block write statements (MCP tools).

SynaLemma vs dbt Semantic Layer: key differences

1. Any rule, built on other rules

No fixed catalogue of metric types. Rules use other rules, with aggregation, negation and time.

2. Joins and recursion without limits

Joins go as far as the question needs. Recursive rules follow chains of any depth, verified to terminate.

3. Formal verification and assertions

Every rule is proved well-formed, safe and terminating. Assertions in first-order logic apply to any rule and return counterexamples.

4. One read-only path for agents

The analyst reaches your data only through the verified layer. A read-only database account is enough.

5. Sovereign by construction, not by contract

SynaLemma runs on-premises: data, rules and model stay on your infrastructure. The engine compiles the SQL, so a small open model is enough.

Example: a recursive query with assertions

A bill of materials at any depth, with two assertions. MetricFlow stops at two hops. The data contains a cycle; the engine reports it before any answer is returned.

parts.l
# The bill of materials, read from the database.
Component(assembly:, part:, quantity:) :- bom(assembly:, part:, quantity:);

# A part is inside an assembly directly, or inside one of its parts.
@Recursive(Contains, 20);
@Assert(Contains,
      transitive: "∀ a b c, Contains a b → Contains b c → Contains a c",
      no_cycle:   "∀ a, ¬ Contains a a");
Contains(assembly:, part:) distinct :- Component(assembly:, part:);
Contains(assembly:, part:) distinct :-
  Contains(assembly:, part: sub),
  Component(assembly: sub, part:);
$ synalog parts.l verify
✓ Contains.transitive holds ✗ Contains.no_cycle is violated: ∀ a, ¬ Contains a a 2 counterexamples: +---------+ | a | +---------+ | "wheel" | | "hub" | +---------+ 2 rows
FAQ

dbt Semantic Layer alternative: FAQ

What is the best dbt Semantic Layer alternative for AI agents?

SynaLemma. It has no fixed metric types or two-hop limit, verifies every rule, checks the data with assertions and gives agents a read-only path.

Can MetricFlow join more than two hops?

No. dbt's documentation sets a limit of two hops. In Synalog, rules join as far as the question needs.

Do I need dbt to use SynaLemma?

No. SynaLemma connects to your database directly and reads the tables your dbt models already build.

Can SynaLemma run with a local model?

Yes. A small open model on your own hardware is enough, because the engine compiles the SQL.

See it on your data

Bring a question your current stack can't answer.

In 30 minutes, we show SynaLemma answering it, with the rule behind the number and the checks it passed.