Skip to content

CONCEPT Cited by 1 source

Analytical intent embedding

An analytical intent embedding is the vector representation of "the business question a historical SQL query was designed to answer" — as opposed to the raw SQL, the table schema, or the natural-language table description.

(Source: sources/2026-03-06-pinterest-unified-context-intent-embeddings-for-scalable-text-to-sql.)

Shape

A single query produces three complementary intent outputs via SQL-to-text transformation, each embeddable:

  • Summary — the business purpose + domain of the query.
  • Analytical questions — explicit list of "questions this query could help answer" (the load-bearing indirection).
  • Detailed breakdown — plain-English description of transformation logic, filters, column definitions, business purpose.

Embedded separately or concatenated, these sit in the same vector space as incoming user questions for similarity retrieval.

Why intent embeddings are more useful than table-description embeddings

User questions are phrased in the vocabulary of business questions, not in the vocabulary of physical schemas. Embedding table descriptions indexes the wrong surface for semantic match. Intent embeddings index what past queries were for, which is the same vocabulary users naturally speak.

How Pinterest uses them

  • Analytics Agent embeds incoming user questions the same way past queries were embedded, retrieves top-k similar past queries, extracts their validated join keys + filters + aggregation patterns, and builds on them to generate SQL.
  • The embedding index is served on Pinterest's Vector DB service with daily incremental updates.

Seen in

Last updated · 319 distilled / 1,201 read