Vector embeddings in ClickHouse with Ollama and OpenAI

ClickHouse
190 views July 17, 2026

ClickHouse's new `aiEmbed` function generates embeddings directly in SQL — no external pipeline needed. In this video, Mark Needham shows how to use it with both a local Ollama model and OpenAI. https://clickhouse.com/blog/clickhouse-release-26-06#aiembed 🔸 Point `aiEmbed` at a local Ollama model (Qwen3 Embedding) via a named collection with an OpenAI-compatible endpoint 🔸 Auto-generate embeddings on insert using a `DEFAULT aiEmbed(text)` column, backed by an HNSW vector similarity index 🔸 Run approximate nearest neighbor search with `L2Distance` to find phrases closest to a lookup embedding 🔸 Query a 1M-row Hugging Face dbpedia dataset pre-embedded with OpenAI's `text-embedding-3-large` 🔸 Switch `aiEmbed` to OpenAI, match embedding dimensions to the dataset, and search for "the best footballer ever"

Keyboard shortcuts

On. Switch them off if they collide with your assistive tools; ? still opens this sheet.

Go to

Press g then the letter.

  • gh Latest
  • gs Sources
  • gm Media
  • gv Videos
  • gp Podcasts
  • gc Calendar
  • gd Decoder
  • gz Dataviz
  • ga Datasets
  • gb Blog
  • gk Markets
  • gj Careers
  • gn Prompt Notebook

On this page

  • / Focus search, where there is one
  • t Back to top
  • ? This list
  • Esc Close