surfaceextractionextract_llm
Extractionscalar · returns varchar

EXTRACT_LLM

LLM-backed extraction (escape hatch for EXTRACTS)

Per-row — runs once for each row.

extractionllmllm-escape-hatchtext

Syntax

{{ text }} EXTRACTS_LLM '{{ what }}'
semantic_extract_llm({{ text }}, '{{ what }}')

Arguments

nametypedescription
textVARCHAR
whatVARCHAR

About

LLM-backed escape hatch for semantic extraction. Use when EXTRACTS (GLiNER) can't handle the task — typically: - The answer isn't a single span in the text (needs synthesis) - The label is abstract or requires world-knowledge inference - The text has heavy noise that confuses GLiNER's span scoring - You need the LLM to *interpret* rather than *locate* For routine entity extraction, prefer EXTRACTS — it's much faster and directly returns the span verbatim.

Examples

LLM escape hatch: price extracted

SELECT
  semantic_extract_llm ('The price is $49.99 per unit', 'price')

LLM escape hatch: email extracted

SELECT
  semantic_extract_llm ('Contact John Smith at john@company.com', 'email')

Nearby rabbit holes

same domain
Climb back to The Looking Glass