Snowflake World Tour hits your city

See how leading teams deploy agents at scale. Find a stop near you. Register free.

What is Snowflake Cortex?

Snowflake Cortex brings AI directly to the Snowflake platform. Instead of sending data to external LLM providers or managing GPU infrastructure, Cortex runs models inside Snowflake's secure compute environment.

Your application connects to both Postgres (for data) and Snowflake Cortex (for AI) — Cortex handles the heavy AI workloads while Postgres remains your operational database.

How It Works with Postgres

Your application maintains two connections:

  1. Postgres — Where your data lives. Query it directly with standard SQL.
  2. Snowflake Cortex — Where AI runs. Call Cortex functions via a Snowpark session.

The data stays in Postgres. You call Cortex remotely for AI capabilities — generating text, producing embeddings, or translating content — and use the results in your application or write them back to Postgres.

Cortex AI Functions

FunctionWhat It Does
SNOWFLAKE.CORTEX.COMPLETEGenerate text from a prompt using an LLM (Mistral, Llama, etc.)
AI_EMBEDGenerate vector embeddings for semantic search
AI_EXTRACTExtract structured information from text
AI_CLASSIFYClassify text into user-defined categories
AI_SENTIMENTAnalyze sentiment of text content
AI_SUMMARIZE_AGGSummarize across multiple rows
AI_TRANSLATETranslate text between languages

All Cortex functions are called as SQL expressions through a Snowpark session. Your app sends a query to Snowflake, Cortex processes it, and returns the result — no model hosting required on your end.

Text-to-SQL with Cortex COMPLETE

Use Cortex COMPLETE to build natural-language query interfaces over your Postgres data. The pattern:

  1. Your app sends the user's question plus your Postgres schema context to Cortex COMPLETE.
  2. Cortex generates a SQL query.
  3. Your app executes that SQL against Postgres.
  4. Results come back as a DataFrame you can render as tables or charts.

This gives users a conversational interface to explore data without writing SQL themselves.

Generating Embeddings with Cortex

Use Cortex to generate vector embeddings and store them in Postgres with pgvector — no need to host an embedding model yourself.

The pattern:

  1. Send text content to Cortex AI_EMBED via your Snowpark session.
  2. Cortex returns a vector embedding.
  3. Store the embedding in a vector column in Postgres using pgvector.
  4. Query with pgvector's distance operators for similarity search.

Available Embedding Models

ModelDimensionsBest For
snowflake-arctic-embed-l-v2.01024High accuracy, general purpose
snowflake-arctic-embed-l-v2.0-8k1024Longer documents (8K token context)
snowflake-arctic-embed-m-v1.5768Good balance of speed and accuracy
voyage-multilingual-21024Multilingual content

Once embeddings are stored in Postgres, you can use pgvector for fast similarity search at application speed — combining vector retrieval with standard relational filters in a single query.

Building a RAG Application

Retrieval-Augmented Generation (RAG) grounds LLM responses in your actual data. With Cortex and Postgres together:

  1. Embed your content — Call Cortex AI_EMBED to generate vectors for your documents. Store them in Postgres with pgvector.
  2. Embed the user's query — When a user asks a question, call AI_EMBED on their query to get a vector.
  3. Retrieve relevant context — Search Postgres with pgvector to find the most similar content.
  4. Generate a response — Pass the retrieved context to Cortex COMPLETE to produce a grounded answer.

Everything stays in your application layer — Postgres holds the data and embeddings, Cortex provides the AI capabilities on demand.

For managed semantic search without building your own embedding pipeline, Cortex Search handles chunking, embedding, indexing, and retrieval automatically.

  • Hybrid retrieval — Combines semantic (vector) and lexical (keyword) search.
  • Automatic embedding — No need to generate or manage embeddings yourself.
  • Managed indexing — Keeps indexes up to date as your data changes.

Mirror your Postgres tables to Snowflake with data mirroring, then create a Cortex Search service for instant hybrid search over your operational data.

Conclusion

Snowflake Cortex gives your Postgres applications access to LLMs and embedding models without managing AI infrastructure. Your data stays in Postgres, Cortex handles the AI workloads, and your application orchestrates between them.

Related Resources

Reference for all Snowflake Cortex AI functions including AI_EMBED, AI_COMPLETE, AI_EXTRACT, and more.


Overview of Snowflake Cortex AI capabilities.


Open-source vector similarity search extension for PostgreSQL.


Mirror Postgres data to Snowflake for analytics and AI processing.

Updated 2026-07-08

This content is provided as is, and is not maintained on an ongoing basis. It may be out of date with current Snowflake instances