surfaceclassificationtopics_llm
Classificationdimension · returns varchar

TOPICS_LLM

LLM-only topic extraction + assignment (escape hatch for TOPICS)

Per-row classifier — stable across GROUP BY.

classificationllmllm-escape-hatchscales-largetext

Syntax

TOPICS_LLM({{ text }})
TOPICS_LLM({{ text }}, {{ num_topics }})
TOPICS_LLM({{ text }}, {{ num_topics }}, '{{ focus }}')

Arguments

nametypedescription
textVARCHAR
num_topicsINTEGER
focusVARCHAR

About

LLM-only topic extraction and assignment. The LLM sees every text in the collection in a single prompt and both extracts topics AND assigns each text — so it's context-window-bound. For scalable topic extraction (100K+ rows), use TOPICS — it uses embedding-based clustering so the LLM only ever sees num_topics representative texts, never the full collection.

Examples

LLM escape hatch extracts topics

SELECT
  topics_llm ('Machine learning and neural networks')

Nearby rabbit holes

same domain
Climb back to The Looking Glass