surfacepipelineinvestigate
Pipelinepipeline · returns table

INVESTIGATE

Investigative analysis - explores related data to answer questions

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

pipelinellmpipeline-composabletext

Syntax

THEN INVESTIGATE {{ prompt }}
THEN INVESTIGATE({{ prompt }})

Arguments

nametypedescription
promptVARCHAR
_tableTABLE

About

PIPELINE cascade for investigative analysis of query results. Unlike ANALYZE (which summarizes what it's given), INVESTIGATE can: - See the original SQL query that produced the data - Introspect other tables in the database via sql_search - Run follow-up queries via smart_sql_run to chase leads - Provide evidence-backed findings with the queries that support them Used with THEN INVESTIGATE syntax: SELECT * FROM churned_customers THEN INVESTIGATE 'why did they leave?' The agent will explore related data to answer the question, not just describe the input dataset.

Examples

Returns evidence-backed investigation rows with the expected schema

SELECT
  *
FROM
  (
    VALUES
      ('Acme', 100),
      ('Bravo', 50),
      ('Acme', 120)
  ) AS t (customer, amount) THEN INVESTIGATE (
    'Which customer appears to have the strongest sales performance?'
  ) THEN PYTHON (
    'result = pd.DataFrame({"ok":[set(["finding","category","evidence"]).issubset(df.columns)]})'
  )

Nearby rabbit holes

same domain
Climb back to The Looking Glass