Beyond keywords: semantic and visual search for fashion

Product search within e-commerce sites, and in particular fashion ones, and more generally in aggregators, social networks, and platforms that need to find products based on user preferences, has always suffered from a fundamental problem: having to interact with databases that are often relational, in which finding similarity between products was neither immediate nor simple, short of developing logic that was hard to maintain over time and even harder to implement.
Thanks to the advent of new Deep Learning technologies, and to what is now recognized as the state of the art in the field, RAG, or Retrieval-Augmented Generation, this problem can be solved. Not only by letting users search for products within an e-commerce site in a more natural way, but also by letting them do so visually.
This is because a RAG works with a database of vectors, often referred to as “embeddings,” which is not technically a synonym, but is used as one in everyday language.
The data is ours
Building a RAG to our own specifications and in our own way is not only a technical choice but also a strategic one.
The data belongs to us and to our partners. The feeds and products that enter Bantoa do not pass through third-party platforms or feed external models: they stay within our infrastructure, under our control. For the brands and retailers that supply us with their catalogs, this is a concrete guarantee: their data does not become somebody else’s asset.
Having control of the data also means being able to process it in the way best suited to our goals. Every product that enters the system carries visual and textual information with it, such as images, titles, descriptions, and categories, which can come directly from the dealer or from our internal categorization, built on the taxonomy we have developed over time. This taxonomy is an asset: it lets us produce vectors that are more precise and more consistent than those we would get from raw, unstructured data.
The result is a system that doesn’t depend on how a supplier decides to describe its products, but that interprets, normalizes, and enriches that data according to our own logic. This is what makes search reliable and scalable over time.
Two types of vectors
To combine these two search modes, we use two particular types of models. These are not LLMs like those that are now part of everyday life, such as GPT-5 or Gemini, but specific models, called encoders, that take visual and textual information and turn it into numerical vectors.
The mechanism we adopted is the following: we create vectors for text, vectors for images, and vectors built from metadata. The first two are dense, while the metadata ones are sparse.
Dense vectors
Dense vectors are well suited to semantic search: they let you search by writing in natural language what you want to find. The query is turned into vectors and compared with those already in the database, establishing a semantic proximity. The same logic applies to images: given an image as input, the system looks for visual similarity within the database.
For this type of vector we used a commercial Google model, which is of course multimodal and performs very well, namely Gemini Embedding 2, which supports up to 3,072 dimensions and represents text and images in the same numerical language, making it possible to search for an image starting from a word, and vice versa (latent space).
Sparse vectors
Dense vectors, however, are not efficient with bare keywords. They work well when interacting with natural-language search, but the moment you specify something precise and direct, a word like “jeans” or “blue,” sparse vectors come into play.
A sparse vector cannot tell apart two sentences that are semantically identical but lexically different. It does, however, have one specific quality: it covers exact matching. It is effective when searching for a specific word and improves the reliability of targeted search on a well-defined term.
For the sparse vectors we went with the well-known BM25, a type of vector that is by now thoroughly battle-tested. More recent and sophisticated approaches exist, but BM25 offers two concrete advantages that made the difference for our use case: no language constraints and very high execution speed.
Hybrid search
This combination of sparse and dense vectors is called hybrid search. The two types are complementary: dense vectors alone might be enough, but they are weak on bare terms and direct keywords. Together, they deliver the most reliable search possible.
In practice, our system can respond both to precise searches, like “white sneakers,” where the sparse vectors do the work, and to vague, descriptive requests, such as a photo uploaded by the user, a visual impression, or a phrase like “something elegant for a summer evening”: here it is the dense vectors that find the right answer.
The system we built can handle a wide range of search intents: from the most precise query, “white running sneakers size 42,” to the upload of a simple image. In both cases, the engine finds genuinely related products, not by keyword match, but by semantic and visual affinity.
This changes the way a user can relate to a product catalog: they are no longer forced to know the right words or to navigate predefined categories, and can search the way they think.
On the technical side, the system is already in production and continues to evolve. Embedding models are improving rapidly, as dimensions grow and multimodal understanding gets sharper, which will lead to better search quality. The direction is toward systems that are ever more capable of interpreting the user’s intent, even when it is partial, ambiguous, or purely visual.
Search, in other words, is becoming conversation.
Sources
Gemini Embedding 2 blog: https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-embedding-2/
Enrico Antonini, Deep learning engineer @Bantoa
More articles dal panorama fashion-tech
Want to become the next case study?
Discover how Bantoa solutions can grow your brand.


