surfacesummarizationthemes_llm
Summarizationaggregate · returns json

THEMES_LLM

LLM-only topic extraction (escape hatch for THEMES)

Per-group — reads the whole group in one call.

summarizationllmllm-escape-hatchjson

Syntax

TOPICS_LLM({{ texts }})
TOPICS_LLM({{ texts }}, {{ num_topics }})
THEMES_LLM({{ texts }})
THEMES_LLM({{ texts }}, {{ num_topics }})

Arguments

nametypedescription
textsJSON
num_topicsINTEGER

About

LLM-only topic extraction — bypasses the embedding-centrality representative selection used by THEMES and shoves every text into the LLM prompt directly. This is context-window-bound: for small collections (hundreds of texts) it's fine; for larger collections it will either truncate or fail depending on the LLM's limits. The canonical THEMES operator handles both shapes transparently — use THEMES_LLM only when you specifically need the LLM to see every text (e.g., for completeness auditing).

Examples

LLM escape hatch extracts AI/healthcare themes

WITH
  test_data AS (
    SELECT
      *
    FROM
      (
        VALUES
          ('Machine learning is transforming healthcare'),
          ('AI models can detect cancer early'),
          ('Deep learning improves medical imaging'),
          ('Neural networks assist in diagnosis'),
          ('Healthcare AI reduces costs')
      ) AS t (article)
  )
SELECT
  THEMES_LLM (article, 3)
FROM
  test_data

Nearby rabbit holes

same domain
Climb back to The Looking Glass