# Vehicle Search with SQL and Vector Embeddings

DevFeed: [Vehicle Search with SQL and Vector Embeddings](<https://devfeed.tech/articles/vehicle-search-with-sql-and-vector-embeddings-23822.md>)

Original publisher: [Read original article](<https://cockroachlabs.com/blog/vehicle-search-sql-vector-embeddings>)

Author: Alejandro Infanzon

Published: 2026-01-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Cockroach Labs](<https://devfeed.tech/sources/cockroach-labs.md>)

Topics: [Embeddings](<https://devfeed.tech/topics/embeddings.md>), [vector embeddings in AI](<https://devfeed.tech/topics/vector-embeddings-in-ai.md>), [SQL](<https://devfeed.tech/topics/sql.md>), [ann](<https://devfeed.tech/topics/ann.md>), [sql-database](<https://devfeed.tech/topics/sql-database.md>), [clustering](<https://devfeed.tech/topics/clustering.md>), [Image](<https://devfeed.tech/topics/image.md>), [data-engineering](<https://devfeed.tech/topics/data-engineering.md>), [DuckDuckGo](<https://devfeed.tech/topics/duckduckgo.md>)

Tags: [3d](<https://devfeed.tech/tags/3d.md>), [3d-visualization](<https://devfeed.tech/tags/3d-visualization.md>), [acid](<https://devfeed.tech/tags/acid.md>), [adapter](<https://devfeed.tech/tags/adapter.md>), [ai](<https://devfeed.tech/tags/ai.md>), [analysis](<https://devfeed.tech/tags/analysis.md>), [app](<https://devfeed.tech/tags/app.md>), [apps](<https://devfeed.tech/tags/apps.md>), [architect](<https://devfeed.tech/tags/architect.md>), [arrays](<https://devfeed.tech/tags/arrays.md>), [car](<https://devfeed.tech/tags/car.md>), [data](<https://devfeed.tech/tags/data.md>), [embeddings](<https://devfeed.tech/tags/embeddings.md>), [photo](<https://devfeed.tech/tags/photo.md>), [search](<https://devfeed.tech/tags/search.md>), [sql](<https://devfeed.tech/tags/sql.md>), [unstructured-data](<https://devfeed.tech/tags/unstructured-data.md>), [vector](<https://devfeed.tech/tags/vector.md>), [vector-search](<https://devfeed.tech/tags/vector-search.md>), [vectors](<https://devfeed.tech/tags/vectors.md>)

## AI overview

The Cockroach Cars demo combines image embeddings with relational vehicle data so users can find visually similar cars while filtering by price in one CockroachDB SQL query. A Python app generates image vectors with sentence-transformers' CLIP clip-ViT-B-32 model, then runs K-nearest-neighbor search using CockroachDB's `<->` L2-distance operator; the example returns late-1960s American muscle cars for a muscle-car image. The inventory stores metadata and embeddings together. The article also describes reducing 512-dimensional embeddings to three dimensions with PCA and clustering them with K-means for visualization. The walkthrough presents this as an alternative to separate embedding services or vector databases, but provides a demo rather than comparative performance measurements.

## Source excerpt

"I'll know it when I see it" is the classic car buyer's line, but it's also the one thing old-school search bars totally fail to deliver. Traditional keyword search fails when a customer wants a car that "looks like this photo from Fast and Furious." This is where vector search comes in, transforming unstructured data into mathematical vectors to find semantically similar items.