surfacesimilarityaligns
Similarityscalar · returns double

ALIGNS

How strongly text supports a specific message or stance (0.0-1.0)

Per-row — runs once for each row.

similarityllmtext

Syntax

{{ text }} ALIGNS {{ narrative }}
{{ text }} ALIGNS WITH {{ narrative }}

Arguments

nametypedescription
textVARCHAR
narrativeVARCHAR

About

Measure how strongly a piece of text supports or backs a specific message — not just whether it mentions the topic, but whether it actually reinforces the stance. Useful for checking brand-voice consistency across marketing copy, filtering customer feedback for content that validates (or undermines) a claim, or scoring news articles by how strongly they endorse a position. The result is a number from 0.0 to 1.0: higher means stronger support, values near zero mean the text contradicts the message, and the middle is neutral or off-topic. Reach for MEANS instead when you just want a yes/no match on the topic, IMPLIES when the question is strict logical entailment, or ABOUT when you want topic relevance without a directional stance.

Examples

Infix ALIGNS WITH: filters aligned content

WITH
  t AS (
    SELECT
      'We prioritize safety above all' AS msg
  )
SELECT
  *
FROM
  t
WHERE
  msg ALIGNS
WITH
  'safety first'

Infix ALIGNS: filters aligned content

WITH
  t AS (
    SELECT
      'Our eco-friendly products reduce waste' AS msg
  )
SELECT
  msg
FROM
  t
WHERE
  msg ALIGNS 'sustainability' > 0.5

Function: low score for misaligned narrative

SELECT
  semantic_aligns (
    'Cost-cutting is our priority',
    'quality and safety first'
  )

Alias aligns(): detects thematic alignment

SELECT
  aligns (
    'Innovation drives our strategy',
    'forward-thinking'
  )

Nearby rabbit holes

same domain
Climb back to The Looking Glass