+
VectorFin
Preview

Connect Snowflake to VectorFin (Preview)

A first stab (preview) at querying VectorFin in Snowflake: mount the shared Iceberg tables via the Polaris REST catalog (the catalog vends short-lived, prefix-scoped GCS credentials, so no EXTERNAL VOLUME and no support grant), then run native VECTOR_COSINE_SIMILARITY over the embeddings.

5 min
Setup time
768
Embedding dims
~500
S&P 500 (beta)
Weekly
Updates

Prerequisites

📋VectorFin Pro plan
🔑Polaris catalog credentials from VectorFin
☁️Snowflake account

Connection Guide

1

Provision a Polaris credential

In the VectorFin dashboard → Data Access → Provision. Copy the catalog URI, warehouse, client_id, and the client_secret (shown ONCE).

sql
-- You'll need these in the Snowflake DDL below:
-- Catalog URI:  https://catalog.vectorfinancials.com/api/catalog
-- Warehouse:    vectorfin
-- Client ID:    <from dashboard>
-- Client Secret: <from dashboard — shown once>
2

Register the Polaris CATALOG INTEGRATION

Point Snowflake at the Polaris REST catalog with your client credentials. The catalog vends short-lived (~15 min) prefix-scoped GCS OAuth2 tokens for each table read, so Snowflake never needs its own GCS access: no EXTERNAL VOLUME, no support grant.

sql
CREATE OR REPLACE CATALOG INTEGRATION vectorfin_polaris
  CATALOG_SOURCE = POLARIS
  TABLE_FORMAT = ICEBERG
  REST_CONFIG = (
    CATALOG_URI = 'https://catalog.vectorfinancials.com/api/catalog'
    WAREHOUSE = 'vectorfin'
  )
  REST_AUTHENTICATION = (
    TYPE = OAUTH
    OAUTH_CLIENT_ID = '<your_polaris_client_id>'
    OAUTH_CLIENT_SECRET = '<your_polaris_client_secret>'
    OAUTH_ALLOWED_SCOPES = ('PRINCIPAL_ROLE:ALL')
  )
  ENABLED = TRUE;
3

Mount tables and query

Each ICEBERG TABLE points at one VectorFin table, with no EXTERNAL_VOLUME clause, since the catalog vends the GCS credentials. CATALOG_NAMESPACE is the Polaris namespace path; the bootstrap creates a top-level vectorfin namespace. The flat signals table lives in that root namespace (vectorfin.signals), while embeddings live in the vectorfin.embeddings subnamespace.

sql
CREATE OR REPLACE ICEBERG TABLE signals
  CATALOG = 'vectorfin_polaris'
  CATALOG_NAMESPACE = 'vectorfin'
  CATALOG_TABLE_NAME = 'signals';

CREATE OR REPLACE ICEBERG TABLE transcripts
  CATALOG = 'vectorfin_polaris'
  CATALOG_NAMESPACE = 'vectorfin.embeddings'
  CATALOG_TABLE_NAME = 'transcripts';

-- Distressed names in a bear regime, last 90 days
SELECT ticker, date, score, altman_zone, regime
FROM signals
WHERE ticker = 'AAPL'
  AND date >= DATEADD(day, -90, CURRENT_DATE())
ORDER BY date DESC;
4

Vector search over embeddings (native Snowflake VECTOR)

Snowflake's VECTOR type and VECTOR_COSINE_SIMILARITY are core SQL, GA since 2024. No Cortex license or special edition, and external embeddings like ours work as-is at no embedding cost. The Iceberg list<float> embedding column surfaces as a Snowflake ARRAY, so cast it to VECTOR(FLOAT, 768) at query time. Supply your query vector as a bracket-array literal, embedded out-of-band with the SAME model we use (gemini-embedding-2-preview, task_type="retrieval_query", 768 dims), since Snowflake AI_EMBED can't produce Gemini vectors and VECTOR bind variables are unsupported. Max VECTOR dimension is 4096, so our 768-dim sits well within range.

sql
-- Top-10 earnings-call chunks most similar to a query vector (whole corpus).
-- The literal below is the query embedding: embed your query text out-of-band
-- with gemini-embedding-2-preview, task_type="retrieval_query",
-- output_dimensionality=768, then paste its 768 floats. Snowflake's AI_EMBED
-- can't produce Gemini vectors and VECTOR bind variables aren't supported.
-- CAVEAT: same model (gemini-embedding-2-preview), task_type="retrieval_query"
-- (NOT retrieval_document — docs are stored that way), 768 dims — or cosine is
-- silently wrong. No ticker filter = cross-corpus; add ticker/fiscal_period to
-- slice. The row-to-row variant below skips embedding entirely.
SELECT ticker, fiscal_period, chunk_idx,
       VECTOR_COSINE_SIMILARITY(
         embedding::VECTOR(FLOAT, 768),
         [0.0123, -0.0456, 0.0789 /* ...768 floats from retrieval_query... */]::VECTOR(FLOAT, 768)
       ) AS similarity
FROM transcripts
WHERE ARRAY_SIZE(embedding) = 768          -- guard ragged/NULL vectors
ORDER BY similarity DESC
LIMIT 10;

-- Row-to-row (zero-embedding): "find chunks most similar to AAPL 2024-Q4 chunk 0"
WITH q AS (
  SELECT embedding::VECTOR(FLOAT, 768) AS qv
  FROM transcripts
  WHERE ticker = 'AAPL' AND fiscal_period = '2024-Q4' AND chunk_idx = 0
)
SELECT t.ticker, t.fiscal_period, t.chunk_idx,
       VECTOR_COSINE_SIMILARITY(t.embedding::VECTOR(FLOAT, 768), q.qv) AS similarity
FROM transcripts t, q
WHERE ARRAY_SIZE(t.embedding) = 768
ORDER BY similarity DESC
LIMIT 10;

Available Tables

VectorFin data tables: bitemporal (effective_ts + knowledge_ts), append-only, weekly updates.

vectorfin.embeddings.transcriptsEarnings call chunk embeddings (768-dim)
sql
CATALOG_NAMESPACE = 'vectorfin.embeddings', CATALOG_TABLE_NAME = 'transcripts'
vectorfin.embeddings.filingsSEC filing section embeddings (preview)
sql
CATALOG_NAMESPACE = 'vectorfin.embeddings', CATALOG_TABLE_NAME = 'filings'
vectorfin.signalsFlat composite quant signals, one typed column per sub-signal (no JSON blob): ticker, date, score, piotroski_f_score + 9 piotroski_* booleans, altman_z_score, altman_zone, altman_x1..x5, beneish_m_score, beneish_flag, sloan_ratio, sloan_quality, regime, regime_confidence, effective_ts, knowledge_ts
sql
CATALOG_NAMESPACE = 'vectorfin', CATALOG_TABLE_NAME = 'signals'

Start querying in 5 minutes

Sign up for VectorFin and get immediate API access.