Vector embeddings in ClickHouse with Ollama and OpenAI
Mark Needham
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
aiEmbedat 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
L2Distanceto 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
aiEmbedto OpenAI, match embedding dimensions to the dataset, and search for "the best footballer ever"
Recent videos
View all Videos
Open House
Open House 2026: Day 1 Keynote
The latest ClickHouse announcements, featuring real-world use cases from Shopify, Zoox, Visa, and Cisco.

Open House
Fireside Chat: The state of data and AI with Bret Taylor (Sierra) and Aaron Katz (ClickHouse)
Aaron Katz (CEO, ClickHouse) and Bret Taylor (Co-Founder Sierra, Chairman of the Board, OpenAI) have an open conversation on the state of AI.

Open House, ClickHouse
How to build a great database (Alexey Milovidov)
The principles behind building a great database, and the new frontiers shaping the field.

Open House
Fireside Chat: Ecosystem and technology trends (Vercel, dbt Labs, CoreWeave)
Aaron Katz (CEO, ClickHouse), Guillermo Rauch (CEO, Vercel), Tristan Handy (CEO, dbt Labs), and Lukas Biewald (SVP of AI, CoreWeave) discuss how AI is changing the data landscape.