surfacepipelineanalyze
Pipelinepipeline · returns table

ANALYZE

Analyze query results with LLM based on a prompt

Table-in, table-out — composes downstream of SELECTs.

pipelinellmpipeline-composabletext

Syntax

THEN ANALYZE {{ prompt }}
THEN ANALYZE({{ prompt }})

Arguments

nametypedescription
promptVARCHAR
_tableTABLE

About

PIPELINE cascade for analyzing query results with LLM. Used with THEN ANALYZE syntax for post-query analysis: SELECT * FROM sales THEN ANALYZE 'what are the trends?' Receives the query results as a table and the user's prompt, returns a table with analysis results suitable for SQL clients.

Examples

Returns structured analysis rows with the expected schema

SELECT
  *
FROM
  (
    VALUES
      ('A', 100),
      ('B', 50)
  ) AS t (category, sales) THEN
ANALYZE ('Which category has higher sales?') THEN PYTHON (
  'result = pd.DataFrame({"ok":[set(["finding","category","detail"]).issubset(df.columns)]})'
)

Nearby rabbit holes

same domain
Climb back to The Looking Glass