<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Kacper Łukawski on Medium]]></title>
        <description><![CDATA[Stories by Kacper Łukawski on Medium]]></description>
        <link>https://medium.com/@lukawskikacper?source=rss-45c5de5a80b6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*vfqMuaVqq8P0TXHsErWJCw.jpeg</url>
            <title>Stories by Kacper Łukawski on Medium</title>
            <link>https://medium.com/@lukawskikacper?source=rss-45c5de5a80b6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 05:19:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@lukawskikacper/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Fine-grained Semantic Search: Making ColBERT and ColPali Production-Ready]]></title>
            <link>https://medium.com/qdrant/fine-grained-semantic-search-making-colbert-and-colpali-production-ready-6a16ef45cf09?source=rss-45c5de5a80b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a16ef45cf09</guid>
            <category><![CDATA[retrieval-augmented-gen]]></category>
            <category><![CDATA[search]]></category>
            <category><![CDATA[colpali]]></category>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[vector-database]]></category>
            <dc:creator><![CDATA[Kacper Łukawski]]></dc:creator>
            <pubDate>Fri, 12 Dec 2025 15:00:53 GMT</pubDate>
            <atom:updated>2025-12-12T15:00:53.959Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rqnc9ioZBwZ4FmcJyx2pvA.png" /></figure><p>ColBERT and ColPali are both families of models based on different principles than regular dense embeddings. Instead of representing each document and query as a single vector, both create a sequence of the individual representations of the tokens, which represent the semantic content of each piece of text or image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KuG5XY3ZE_gaQoysZKmX0Q.png" /><figcaption>ColBERT/ColPali models assign a separate representation vector to each of the input tokens</figcaption></figure><p>This effectively represents each input as a sequence of smaller vectors, allowing for more nuanced matching where individual concepts can be matched independently. ColBERT does that for text, while ColPali handles both images and text, allowing us to query a collection of scanned paper documents or PDFs using textual queries without passing them through a typical OCR, layout detection, and format reconstruction pipeline.</p><blockquote><strong>There’s just one problem:</strong> the MaxSim scoring function that powers these models is fundamentally incompatible with approximate nearest neighbor search. We’ll examine why multi-vector retrieval breaks HNSW indexing and explore the breakthrough that’s making large-scale late interaction model search practical.</blockquote><h4>MaxSim similarity in multi-vector retrieval</h4><p>Using multiple vectors per document and query impacts the way we calculate the similarity between them. Instead of calculating a single distance, we calculate a distance between every pair of query and document tokens, and then sum up the maximum similarities for each of the query tokens to get a final similarity score.</p><figure><img alt="MaxSim(Q, D) = Σ max(cosine_sim(q_i, d_j) for all d_j in D) for each q_i in Q" src="https://cdn-images-1.medium.com/max/472/0*aTyU3qn13DcNksEt.png" /><figcaption>Q is the set of query token vectors, and D is the set of document token vectors</figcaption></figure><p>The similarity of the pairs of tokens is still calculated using the base metric, such as cosine, depending on the model used. These models are often referred to as “late interaction” models, as we measure the interactions between query and document tokens at the very end of the process.</p><p>Assume we have the following query and document:</p><pre>query = &quot;climate change summit&quot;<br>document = &quot;World leaders discuss climate summit. &quot; \<br>           &quot;Oil prices fluctuate globally.&quot;</pre><p>The MaxSim operator will iterate over the query tokens and find the most similar document tokens:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zR6XKGNYC_mSWDtTz5bovw.png" /><figcaption>MaxSim token selection for “climate change summit” query and “World leaders discuss climate summit. Oil prices fluctuate globally” document calculated for “colbert-ir/colbertv2.0”</figcaption></figure><p>The final similarity score for that pair of query and document is <strong>22.11</strong>.</p><h3>Vector search engines and multi-vector retrieval</h3><p>For the past couple of years, we’ve relied on Approximate Nearest Neighbors (ANN) methods to make the vector search process more effective. Vector search engines, like <a href="https://qdrant.tech/">Qdrant</a>, emerged as an essential component for RAG, as they provided a scalable semantic search layer, playing an essential role in bringing private knowledge to LLMs. Most of them use <a href="https://en.wikipedia.org/wiki/Hierarchical_navigable_small_world">HNSW</a>, a multi-layer graph in which document vectors are represented as nodes, and the edges are defined based on the highest similarity. Each of the vectors is connected via an edge to its m closest neighbours based on the chosen distance metric.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BsKwRmsMwHblVhph.png" /><figcaption>Source: <a href="https://qdrant.tech/course/essentials/day-2/what-is-hnsw/">https://qdrant.tech/course/essentials/day-2/what-is-hnsw/</a></figcaption></figure><p>Using HNSW for single-vector embeddings is straightforward. No matter if you use dot product, Euclidean, or cosine distance, the distance between document A and B is equal to the distance between B and A. That rule breaks when we start applying MaxSim.</p><blockquote>While we could theoretically compute document-to-document similarities for graph construction, the fundamental issue is that MaxSim is query-dependent: the relevance of document A to document B changes based on which query tokens we’re matching. A document’s nearest neighbours aren’t fixed — they depend on the query context.</blockquote><p>Additionally, MaxSim is asymmetric by definition. It assumes the first <br>parameter is a query and sums the maximum similarities for all query tokens, meaning each query token contributes to the final score. When comparing two documents directly, MaxSim(A, B) ≠ MaxSim(B, A), particularly when documents have different token counts.</p><p>If we now swap the query and the document from the previous example, the final similarity score is <strong>13.9352</strong>, as we iterate over more tokens, yet each of them contributes with a relatively small similarity score.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uheFqbTsxVZutx2mHdxvBQ.png" /><figcaption>The process of calculating MaxSim with the query used as a document and vice versa. The final score differs from the previously calculated one, as we iterate over a different set of tokens.</figcaption></figure><p>Moreover, Document A might be a close neighbour to Document B for one query but distant for another, making it impossible to build a static proximity graph. Consider a document with two distinct sections: a query matching the first section would find this document highly relevant. At the same time, a query matching the second section would also find it relevant, yet these two queries might share no semantic similarity with each other. This query-dependent relevance prevents any fixed notion of which documents are “neighbors.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ugxFcl4xyv6-i-ug-d3_aA.png" /><figcaption>Two queries are similar to the same document, even though they are not semantically similar to each other.</figcaption></figure><p>That leads to the necessity of computing MaxSim against every document at query time, making HNSW search practically useless for multi-vector retrieval without significant modifications or approximations. Practically, late interaction models are often recommended as the second-stage reranking mechanism, where faster retrievers, such as dense or sparse vector-based ones, provide the list of potential candidates.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*atHB3Y3r2wDwkhgZVR_fGQ.png" /><figcaption>Reranking runs only on the candidates retrieved by faster methods, so it doesn’t have to calculate the query similarity to all the documents in the vector index</figcaption></figure><h4>Alternative types of indices for efficient multi-vector search</h4><p>Although there are some promising algorithms for efficient multi-vector search, other than HNSW, such as <a href="https://arxiv.org/abs/2205.09707">PLAID</a>, running them in production is still a challenge. The existing implementations have a relatively high operational cost compared to a single vector ANN. They are also not well-suited to handle frequent updates and deletions, which are not uncommon in a production system, let alone various search modes or typical enterprise-grade features.</p><blockquote>HNSW-based search has matured sufficiently, and most users would rather use multi-vector search for reranking only, relying on other techniques to improve initial retrieval quality. Consequently, the overall precision of the two-stage pipeline is high enough.</blockquote><h3>Making late interaction models effective</h3><p>While traditional HNSW cannot efficiently handle multi-vector retrieval, recent research offers a promising solution. There has been a surge of interest in the<a href="https://research.google/blog/muvera-making-multi-vector-retrieval-as-fast-as-single-vector-search/"> MUVERA algorithm</a>, developed by Google Research. It aims to approximate multi-vector representations with high-dimensional single-vector embeddings.</p><blockquote>According to the benchmarks, it performs best when used in a hybrid approach: MUVERA-compressed vectors for initial HNSW-based retrieval, followed by the original late interaction model for reranking the top candidates.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IGUHM-9zR5uwI-78DwLktQ.png" /><figcaption>MUVERA transforms both documents and queries into Fixed Dimensional Encodings, which might be compared with a typical distance function, such as cosine</figcaption></figure><p>The method itself is based on SimHash, which converts varying-length sequences of vectors into fixed-length representations by clustering, and Random Projection, which is used for dimensionality reduction. The technique itself is complex and broken down into stages in the<a href="https://qdrant.tech/articles/muvera-embeddings/"> MUVERA: Making Multivectors More Performant article</a>, if you are interested in more detail.</p><h4>MUVERA in practice</h4><p>Since the method is highly random, it is essential to rely on a single implementation to make sure document and query vectors are compatible with each other.<a href="https://qdrant.github.io/fastembed/"> FastEmbed</a> provides a model-agnostic implementation of MUVERA that can be used with any multi-vector representations (ColBERT, ColPali, custom implementations), as long as the token embedding dimensionality is known.</p><pre>from fastembed.postprocess.muvera import Muvera<br><br>muvera = Muvera(<br>    # Individual token embedding dimensionality of<br>    # the late interaction model used<br>    dim=128,<br>    # Number of SimHash hyperplanes, 2^6 = 64 clusters<br>    k_sim=6,<br>    # Output dimensionality after the Random Projection<br>    dim_proj=16,<br>    # Number of repetitions for robustness<br>    r_reps=20,<br>    # Random seed for reproducibility<br>    random_seed=42,<br>)</pre><p><em>The configuration above will produce 20480-dimensional vectors, which <br>is relatively high compared to regular dense embeddings (typically <br>384–8096 dimensions). However, this higher dimensionality is necessary <br>to preserve the information from multiple token vectors while enabling <br>efficient HNSW search.</em></p><p><a href="https://qdrant.tech/articles/muvera-embeddings/#how-muvera-embeddings-are-created">MUVERA processing differs slightly for documents and queries</a>. Therefore, FastEmbed provides two methods, .process_query and .process_document, for queries and documents, respectively. Each of them expects a 2-dimensional numpy array, being a sequence of token embeddings of a single input (one query or one document), as produced by the late interaction model.</p><pre># For queries:<br>query_embedding = muvera.process_query(query_vectors)<br><br># For documents:<br>doc_embedding = muvera.process_document(doc_vectors)</pre><p>While MUVERA enables HNSW indexing, it introduces approximation — trading some of the precision of complete MaxSim computation for dramatically improved search speed. Still, it remains one of the most promising methods for productionizing multi-vector retrieval, which may be particularly useful when we want to enable search over digitised documents, without running a costly and erroneous content parsing pipeline.</p><p><em>If you enjoyed this article, comment below and follow me on </em><a href="https://www.linkedin.com/in/kacperlukawski/"><em>LinkedIn</em></a><em> or </em><a href="https://x.com/LukawskiKacper"><em>X</em></a><em> for more posts about vector search and information retrieval.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a16ef45cf09" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qdrant/fine-grained-semantic-search-making-colbert-and-colpali-production-ready-6a16ef45cf09">Fine-grained Semantic Search: Making ColBERT and ColPali Production-Ready</a> was originally published in <a href="https://medium.com/qdrant">Qdrant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MUVERA: Making Multivectors More Performant]]></title>
            <link>https://medium.com/qdrant/muvera-embeddings-2ca8b117c4d2?source=rss-45c5de5a80b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ca8b117c4d2</guid>
            <category><![CDATA[optimization]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[clustering]]></category>
            <category><![CDATA[vector-search]]></category>
            <category><![CDATA[search-engines]]></category>
            <dc:creator><![CDATA[Kacper Łukawski]]></dc:creator>
            <pubDate>Tue, 09 Sep 2025 14:18:46 GMT</pubDate>
            <atom:updated>2025-09-09T14:39:43.770Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*snm3OBiGwnejTMh-3lbhOw.png" /></figure><h3>What are MUVERA Embeddings?</h3><p>Multi-vector representations are superior to single-vector embeddings in many benchmarks. It might be tempting to use them right away, but there is a catch: they are slower to search. Traditional vector search structures like <a href="https://qdrant.tech/documentation/concepts/indexing/#vector-index">HNSW</a> are optimized for retrieving the nearest neighbors of a single query vector using simple metrics such as cosine similarity. These indexes are not suitable for multi-vector retrieval strategies, such as MaxSim, where a query and document are each represented by multiple vectors and the final score is computed as the maximum similarity over all cross-pairings. MaxSim is inherently asymmetric and non-metric, so HNSW could potentially help us find the closest document token to a given query token, but that does not mean the whole document is the best hit for the query.</p><p><a href="https://research.google/blog/muvera-making-multi-vector-retrieval-as-fast-as-single-vector-search/">MUVERA embeddings</a>, introduced by Google Research, aim to solve this problem. The idea is to create a single vector that approximates the multi-vector representation. This single vector can be used for fast initial retrieval using traditional vector search methods, and then the multi-vector representation can be used for reranking the top results. This approach combines the speed of single-vector search with the accuracy of multi-vector retrieval. Reranking with multi-vector representations is much faster when applied to a small set of candidates rather than the entire dataset.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LjHHCj4Tyfw3_WFS.png" /></figure><p><a href="https://qdrant.tech/articles/muvera-embeddings/#muvera-in-fastembed">FastEmbed 0.7.2 introduces support for MUVERA embeddings</a>, and this article explains the concept in detail.</p><h3>How MUVERA Embeddings are created</h3><p><strong>MUVERA</strong> (<strong>Mu</strong>lti-<strong>Ve</strong>ctor <strong>R</strong>etrieval <strong>A</strong>lgorithm) transforms variable-length sequences of vectors into fixed-dimensional representations. Since the number of vectors in the input varies between documents and queries, and might be even different between different documents, we need a universal way to represent them in a fixed-size format. Clustering the vector space of the tokens and projecting the individual multi-vector representations to a lower-dimensional space using the created clustering helps achieve this. The authors of the MUVERA paper suggest using the Locality-Sensitive Hashing (LSH) technique called SimHash.</p><h3>Glossary of parameters</h3><p>There are a few parameters that control the MUVERA embedding creation process, so in order to avoid confusion, here is a quick definition of them:</p><ul><li>dim: Dimensionality of a single token vector in the original multi-vector representation, depends on the model used</li><li>k_sim: Number of random hyperplanes used in SimHash, which determines the number of clusters as 2^k_sim</li><li>dim_proj: Dimensionality of the projected vectors after random projection</li><li>r_reps: Number of independent repetitions of the SimHash projection and random projection process</li></ul><h3>SimHash projection for clustering</h3><p>SimHash is one of the LSH techniques that uses random hyperplanes to hash input vectors into binary codes. In the first step, this method chooses k_sim random hyperplanes (normal vectors) from a standard normal distribution. These hyperplanes divide the vector space into 2^k_sim regions, because each vector can be on either side of each hyperplane. Here is how such a space division could look like for k_sim=3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oj--VgUBAPr5GERJ.png" /></figure><p>Each token vector is now assigned to one of these regions based on which side of each hyperplane it falls on. This is done by computing the dot product of the input vector with each hyperplane normal vector, and taking the sign of each result. Since each of our regions can be represented as a binary string of length k_sim (where each bit indicates which side of a hyperplane the vector is on), we can interpret this binary string as an integer to get a cluster ID.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8fVxVwdBuLTz0zZ0.png" /></figure><h3>Fixed Dimensional Encoding (FDE) creation</h3><p>Once all input vectors are assigned to clusters, we can aggregate the vectors belonging to each of the clusters. This process is slightly different for documents and queries. In both cases, we’ll end up with a fixed-dimensional vector with the same number of dimensions, but the way we compute these vectors differs.</p><h4>Document clustering</h4><p>Once we have assigned all the document token vectors to clusters, we compute the cluster centroids by averaging all vectors in each cluster. This gives us a representative vector for each cluster. If a cluster ends up being empty (i.e., no vectors were assigned to it), we fill it using vector from the nearest non-empty cluster. The distance between clusters is determined by the Hamming distance between their cluster IDs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*m3zvgCoPnwS__KFb.png" /></figure><p>As a result we get 2^k_sim vectors, each of them being dim-dimensional.</p><h4>Query clustering</h4><p>Query processing is slightly different. Instead of computing the average vector for each cluster, we compute the sum of all vectors in each cluster. This means that the resulting vectors will have larger magnitudes for clusters with more assigned vectors. The idea is that it preserves the natural distribution of query terms, which can be beneficial for retrieval. Unlike with documents, we do not fill empty clusters for queries. Queries are typically shorter than documents, so it’s more likely that some clusters will be empty. Filling them could introduce noise and distort the representation, as each term would contribute to the dot product multiple times.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*BfFEGX9BsqKWMB9T.png" /></figure><p>Again, we end up with 2^k_sim vectors of size dim. Because we do not fill empty clusters, some of these vectors might be zero vectors.</p><h3>Dimensionality reduction through Random Projection</h3><p>The paper reports results from experiments with k_sim values of 4 and 5. Practically, this means 16 or 32 clusters, respectively. If the original token vectors have a dimensionality of 128, the resulting FDE would have a dimensionality of 16 * 128 = 2048 or 32 * 128 = 4096. However, a single SimHash projection with just 4 or 5 hyperplanes might not capture enough information about the input vectors. To improve the quality of the FDEs, the authors suggest repeating the process multiple times with independent SimHash projections and concatenating the results. Practically, with r_reps=20 repetitions, we would end up with FDEs of size 20 * 16 * 128 = 40960 or 20 * 32 * 128 = 81920, which is quite large and could slow down single-vector search significantly. For that reason, the authors suggest applying random projection to reduce the dimensionality of each FDE. This involves multiplying each cluster vector by a random matrix with entries from {-1, +1} and applying a scaling factor of 1/√(dim_proj). This matrix has a shape of (dim, dim_proj), where dim_proj is the desired dimensionality of the projected vectors. The resulting FDE will then have a size of r_reps * 2^k_sim * dim_proj.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uMgP-ewAIe6lWJJb.png" /></figure><p>The results from all repetitions are then concatenated to form the final FDE. This repetition helps to create a more robust representation that better approximates the original multi-vector embedding.</p><h3>Final random projection</h3><p>The original paper suggests applying an additional random projection to the final FDE to further reduce its dimensionality. It is an optional step that can be used if the resulting FDE is still too large. This final projection uses another random matrix with entries from {-1, +1} to project the FDE to a desired lower dimensionality.</p><h3>Practical considerations</h3><p>MUVERA embeddings seem to be a promising approach to make multi-vector retrieval more efficient. The paper <strong>recommends using it as an initial retrieval step followed by reranking with the original multi-vector representation</strong>. This approach requires storing both the MUVERA embeddings and the original multi-vector representations, which increases storage requirements.</p><p>Please note that the MUVERA embeddings might be way larger than the single dense vectors produced by traditional embedding models you might be used to. For example, using k_sim=6 (64 clusters), dim_proj=32, and r_reps=20 with 128-dimensional token vectors results in FDEs of size 20 * 64 * 32 = 40960. This is significantly larger than typical single-vector embeddings, which are around a few thousand dimensions at most. The increased size of MUVERA embeddings can impact storage and retrieval efficiency, so it’s important to consider these factors when deciding to use them.</p><h3>Impact on search performance</h3><p>To evaluate the effectiveness of MUVERA embeddings, we benchmarked three different approaches on the BeIR nfcorpus dataset using the ColBERTv2 model. The MUVERA configuration used the following parameters: k_sim=5, dim_proj=16, and r_reps=20:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*a8LBl2dRnjADclSyijt9zg.png" /></figure><p>The results show that MUVERA-only search trades some accuracy for speed, achieving about 70% of the full multi-vector performance. However, using MUVERA for initial retrieval followed by multi-vector reranking recovers nearly all the original performance while maintaining the efficiency benefits for the initial search phase.</p><p>It’s becoming especially interesting when you consider the search latency improvements. In our benchmarks, we observed significant speed gains:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*Q0Hfd-YvPcL2njgOqpsM3g.png" /></figure><p>MUVERA-only search is approximately 8x faster than full multi-vector search, while the hybrid approach with reranking still achieves about 7x speed improvement while maintaining nearly identical search quality.</p><h3>MUVERA in FastEmbed</h3><p><a href="https://qdrant.tech/documentation/fastembed/">FastEmbed</a> provides late interaction text (ColBERT) and multimodal (ColPali) embeddings. Version 0.7.2 has introduced support for MUVERA embeddings which is compatible with any multi-vector representation, and available as a post-processing step.</p><p>Due to probabilistic nature of the SimHash and random projection techniques, the MUVERA embeddings created in different libraries won’t be compatible.</p><pre>import numpy as np<br>from fastembed import LateInteractionTextEmbedding<br>from fastembed.postprocess import Muvera<br><br># Create a multi-vector model (ColBERT in this case) and then wrap it with MUVERA<br>model = LateInteractionTextEmbedding(model_name=&quot;colbert-ir/colbertv2.0&quot;)<br>muvera = Muvera.from_multivector_model(<br>    model=model,<br>    k_sim=6,<br>    dim_proj=32,<br>    r_reps=20<br>)<br># Create embeddings of the sample text and then process them with MUVERA<br>embeddings = np.array(list(model.embed([&quot;sample text&quot;])))<br>fde = muvera.process_document(embeddings[0])</pre><h3>Try it out today</h3><p>If you’re already using multi-vector retrieval, upgrading to FastEmbed 0.7.2+ will unlock MUVERA’s 7x speed improvements while maintaining nearly identical search quality. And if you’ve always wanted to experiment with multi-vector retrieval but were held back by performance concerns or complexity, now is the perfect time to start. MUVERA removes those traditional barriers, making advanced retrieval techniques accessible and practical for production use. Simply upgrade your FastEmbed installation with pip install --upgrade fastembed and start benefiting from the power of multi-vector search without the traditional speed penalties.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ca8b117c4d2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qdrant/muvera-embeddings-2ca8b117c4d2">MUVERA: Making Multivectors More Performant</a> was originally published in <a href="https://medium.com/qdrant">Qdrant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Qdrant 0.11.4 and 0.11.5 with new features!]]></title>
            <link>https://medium.com/qdrant/qdrant-0-11-4-and-0-11-5-with-new-features-a169ec678995?source=rss-45c5de5a80b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a169ec678995</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[vector-database]]></category>
            <category><![CDATA[similarity-search]]></category>
            <category><![CDATA[search]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Kacper Łukawski]]></dc:creator>
            <pubDate>Thu, 08 Dec 2022 17:05:28 GMT</pubDate>
            <atom:updated>2022-12-08T17:05:28.028Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M7j-POLqg0gn68i04X_X9g.jpeg" /></figure><p>Qdrant has released two consecutive versions — 0.11.4 and 0.11.5 — in the recent two weeks. They have brought some exciting new features to the platform.</p><h3>What’s new in 0.11.4</h3><p>In version 0.11.4, we added <strong>mmap support for HNSW graph storage</strong>. This means that users no longer need to keep the HNSW index in RAM, making it particularly useful for collections with many small vectors. Additionally, the gRPC protocol was updated to enable <strong>compression</strong>, which is useful for transferring large payloads over slow networks. There have been also some other improvements and bug fixes which you can check in the <a href="https://github.com/qdrant/qdrant/releases/tag/v0.11.4">changelog</a>.</p><h3>Novelties brought in 0.11.5</h3><p>Version 0.11.5 introduced a new API for payload manipulation, allowing users to <strong>overwrite all existing payload fields in a single step</strong>. This is a significant improvement over the previous <em>set_payload</em> method, which could only replace mentioned fields. Another useful addition to this release is the <strong>ability to set and delete payload fields by a filter</strong>. This allows users to specify a subset of points to update using filtering conditions, which can be useful if you are using a secondary key in the payload.</p><p>As usual, a new minor version brings some improvements and bug fixes as well, with all the details described in the <a href="https://github.com/qdrant/qdrant/releases/tag/v0.11.5">changelog</a>.</p><h3>Summary</h3><p>Overall, these two consecutive releases have brought some valuable new features to the Qdrant vector database. What do you expect to be included in the next release of Qdrant? Join our <a href="https://qdrant.to/discord">Discord community</a> and let us know!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a169ec678995" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qdrant/qdrant-0-11-4-and-0-11-5-with-new-features-a169ec678995">Qdrant 0.11.4 and 0.11.5 with new features!</a> was originally published in <a href="https://medium.com/qdrant">Qdrant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Qdrant introduces full-text filters and indexes]]></title>
            <link>https://medium.com/qdrant/qdrant-introduces-full-text-filters-and-indexes-9a032fcb5fa?source=rss-45c5de5a80b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/9a032fcb5fa</guid>
            <category><![CDATA[information-retrieval]]></category>
            <category><![CDATA[search]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Kacper Łukawski]]></dc:creator>
            <pubDate>Wed, 16 Nov 2022 12:40:15 GMT</pubDate>
            <atom:updated>2022-11-16T12:40:15.021Z</atom:updated>
            <content:encoded><![CDATA[<h3>Full-text filter and index are already available!</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*0PTzMsOnwkeB2jxBME5fug.png" /><figcaption>Qdrant v0.10 introduced full-text filters and indexes to enable more search capabilities for those working with textual data.</figcaption></figure><p>Qdrant is designed as an efficient vector database, allowing for a quick search of the nearest neighbours. But, you may find yourself in need of applying some extra filtering on top of the semantic search. Up to version 0.10, Qdrant was offering support for keywords only. Since 0.10, there is a possibility to apply full-text constraints as well. There is a new type of filter that you can use to do that, also combined with every other filter type.</p><h4>Using full-text filters without the payload index</h4><p>Full-text filters without the index created on a field will return only those entries which contain all the terms included in the query. That is effectively a substring match on all the individual terms but <strong>not a substring on a whole query</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ek61_uVTYN89duqTmQQztQ.png" /><figcaption>An example of how to search for “long_sleeves” in a “detail_desc” payload field.</figcaption></figure><h4>Full-text search behaviour on an indexed payload field</h4><p>There are more options if you create a full-text index on a field you will filter by.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pOhX4eZnqpgOxak6PPZypQ.png" /><figcaption>Creating a full-text index on a selected field using Qdrant HTTP API</figcaption></figure><p>First and foremost, you can choose the tokenizer. It defines how Qdrant should split the text into tokens. There are three options available:</p><ul><li><strong>word</strong> — spaces, punctuation marks and special characters define the token boundaries</li><li><strong>whitespace</strong> — token boundaries defined by whitespace characters</li><li><strong>prefix</strong> — token boundaries are the same as for the “word” tokenizer, but in addition to that, there are prefixes created for every single token. As a result, “Qdrant” will be indexed as “Q”, “Qd”, “Qdr”, “Qdra”, “Qdran”, and “Qdrant”.</li></ul><p>There are also some additional parameters you can provide, such as</p><ul><li><strong>min_token_len</strong> — minimal length of the token</li><li><strong>max_token_len</strong> — maximal length of the token</li><li><strong>lowercase</strong> — if set to <em>true</em>, then the index will be case-insensitive, as Qdrant will convert all the texts to lowercase</li></ul><h3>Using text filters in practice</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pBtD2tzqTJQqLBI61R8czg.png" /><figcaption>Each item might be described by some neural vector embeddings, but also some additional attributes, including text, we’d like to query on. With Qdrant 0.10, it’s already possible.</figcaption></figure><p>The main difference between using full-text filters on the indexed vs non-indexed field is the performance of such query. In a simple benchmark, performed on the <a href="https://www.kaggle.com/competitions/h-and-m-personalized-fashion-recommendations">H&amp;M dataset</a> (with over 105k examples), the average query time looks as follows (n=1000):</p><pre>╔════════╦═══════════════╦════════════════════╗<br>║        ║ <strong>Without index</strong> ║ <strong>With payload index</strong> ║<br>╠════════╬═══════════════╬════════════════════╣<br>║ <strong>Scroll</strong> ║ 0.00346 s     ║ 0.00114 s          ║<br>║ <strong>Search</strong> ║ 0.03648 s     ║ 0.00158 s          ║<br>╚════════╩═══════════════╩════════════════════╝</pre><p>It is evident that creating a filter on a field that we’ll query often, may lead us to substantial performance gains without much effort.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9a032fcb5fa" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qdrant/qdrant-introduces-full-text-filters-and-indexes-9a032fcb5fa">Qdrant introduces full-text filters and indexes</a> was originally published in <a href="https://medium.com/qdrant">Qdrant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a semantic search system with txtai and Qdrant]]></title>
            <link>https://medium.com/analytics-vidhya/building-a-semantic-search-system-with-txtai-and-qdrant-525f4e70571c?source=rss-45c5de5a80b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/525f4e70571c</guid>
            <category><![CDATA[search]]></category>
            <category><![CDATA[semantic-search]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Kacper Łukawski]]></dc:creator>
            <pubDate>Tue, 11 Oct 2022 12:47:07 GMT</pubDate>
            <atom:updated>2022-10-11T12:47:07.719Z</atom:updated>
            <content:encoded><![CDATA[<p>Building a semantic search based application requires putting up several pieces together. Assuming you have some data, you still have to choose a model that converts it into embeddings. And there is a wide variety of pretrained models available, but building your own service around the selected model takes quite a lot of time. And this is where <a href="https://neuml.github.io/txtai/">txtai</a> may save you lots of time, as it reduces the boilerplate you would need to write if you wanted to implement everything on your own.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2bg3_wcySjODlianqwAhCA.png" /><figcaption>Semantic search with txtai and Qdrant</figcaption></figure><p>According to the official docs, <a href="https://neuml.github.io/txtai/">txtai</a> is, among others, a “<em>large-scale similarity search with multiple index backends</em>”. However, all the <strong>built-in txtai ANN backends are libraries, not production-grade tools</strong>, and search might simply become a bottleneck if you’ll ever want to scale things up. If you treat semantic search seriously, you’ll better start with a proper reliable database designed to perform the search efficiently, like <a href="https://qdrant.tech/">Qdrant</a>. You would never use an in-memory engine and build a service around it for relational data, instead of keeping it in a relational database, so why would you do that for vectors? A vector database is key if you want to make a system reliable and have the ability to scale it up in the future.</p><p>Fortunately, txtai 5.0 allows integrating a custom backend. We created a simple wrapper library so you can avoid doing that yourself. It is available as a separate package which you can install using pip.</p><figure><img alt="pip install qdrant-txtai" src="https://cdn-images-1.medium.com/max/1024/1*ynozED0HI8GmpQK5WjvJpQ.png" /><figcaption>Installing qdrant-txtai with pip</figcaption></figure><p>If you already use txtai, then the transition to Qdrant is seamless and requires setting the backend property of your configuration:</p><figure><img alt="backend: qdrant_txtai.ann.qdrant.Qdrant" src="https://cdn-images-1.medium.com/max/1024/1*LPoYNzStuDtaGDSiFHqLWA.png" /><figcaption>YAML configuration for using Qdrant backend in txtai</figcaption></figure><p>There is also a programmatically way of doing that. In this mode, your application configuration will look like this:</p><figure><img alt="“backend”: “qdrant_txtai.ann.qdrant.Qdrant”" src="https://cdn-images-1.medium.com/max/1024/1*W-rBWjlEpsR4JWvII2slmw.png" /><figcaption>Pythonic way of setting up Qdrant backend</figcaption></figure><h3>End-to-end semantic search system</h3><p>Let’s take a more real-world example. There are a lot of Data Science libraries available on the market and it would be extremely tough to know all of them perfectly. Thus, selecting your stack might be opinionated if you always select the tools you know well. It would be great to have an alternative way, a system that will show you what else might be also well-suited for a specific use case.</p><h4>Running the vector database</h4><p>First of all, we need the Qdrant instance to be running. In the simplest case, you can run it locally with Docker, as follows:</p><figure><img alt="docker run -p 6333:6333 -p:6334:6334 qdrant/qdrant:v0.10.2" src="https://cdn-images-1.medium.com/max/1024/1*XnPBWWoWmFjPrgkdLIXgGg.png" /><figcaption>Running Qdrant with Docker</figcaption></figure><h4>Writing the semantic search application with txtai</h4><p>Right now we are finally able to set up the semantic search application with txtai. We’re going to do that programmatically with Python. Our application will be pretty straightforward and we’re not going to fine-tune any existing model, but just use one of the pre-trained ones directly, namely <a href="https://huggingface.co/sentence-transformers/all-MiniLM-L6-v2">all-MiniLM-L6-v2</a>. It is a configurable property in txtai. We’re also going to use Qdrant as an embedding backend and cosine distance function to calculate the distance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c-gw8zVbZmNwE1TL4ykesg.png" /><figcaption>Setting up all-MiniLM-L6-v2 and Qdrant in txtai</figcaption></figure><p>First of all, we need to feed the database with some vectors. It can be done by calling a .index method of the created <em>Embeddings</em> instance. It accepts triplets, with the first value being the identifier of a particular entry, the second the document and the third representing the tags associated with that entry.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n_KJ6Ww8w3zVTvU-5SjfHA.png" /><figcaption>Indexing the dataset in txtai</figcaption></figure><p>In the background, all the texts are going to be vectorized with the selected model and put into Qdrant so we can query them later on.</p><h3>Querying the system</h3><p>With just a few lines of code, we’ve created a semantic search system. It has just a few entries but already allows us to look for a library that might be well-suited for our use case. Let’s assume we want to train a random forest model. What to use? The choice is way simpler with our search system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ITvnouFsEWxl8ROBXGKjw.png" /><figcaption>Performing a search with embeddings and txtai</figcaption></figure><p>We’ve selected the top 3 entries, and it seems the winner is obviously the document with <em>id = 2</em> as its score is over two times higher than the second result. And scikit-learn is obviously the best choice among all the options available in our database.</p><h3>Summary</h3><p>We’ve just created a simple search system. Thanks to txtai, Qdrant and pretrained language models it was simple and already powerful enough to support even some more complex cases. The cool thing about the semantic search is that <strong>none of the words used in a query has to be used in any document in our dataset</strong>, as the model is already capable of capturing synonyms. This is a huge advantage over conventional search algorithms like BM25.</p><p>If you want to start using both txtai and Qdrant, the library is available on Github: <a href="https://github.com/qdrant/qdrant-txtai">https://github.com/qdrant/qdrant-txtai</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=525f4e70571c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/building-a-semantic-search-system-with-txtai-and-qdrant-525f4e70571c">Building a semantic search system with txtai and Qdrant</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Storing multiple vectors per object in Qdrant]]></title>
            <link>https://medium.com/qdrant/storing-multiple-vectors-per-object-in-qdrant-c1da8b1ad727?source=rss-45c5de5a80b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1da8b1ad727</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[search]]></category>
            <category><![CDATA[similarity-search]]></category>
            <dc:creator><![CDATA[Kacper Łukawski]]></dc:creator>
            <pubDate>Wed, 05 Oct 2022 12:51:28 GMT</pubDate>
            <atom:updated>2022-10-05T12:52:01.629Z</atom:updated>
            <content:encoded><![CDATA[<p>In a real case scenario, a single object might be described in several different ways. If you run an e-commerce business, then your items will typically have a name, longer textual description and also a bunch of photos. While cooking, you may care about the list of ingredients, and description of the taste but also the recipe and the way your meal is going to look. Up till now, if you wanted to enable semantic search with multiple vectors per object, Qdrant would require you to create separate collections for each vector type, even though they could share some other attributes in a payload. However, since Qdrant 0.10 you are able to store all those vectors together in the same collection and share a single copy of the payload!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*ygZEi7duQTBNuEyFKAqFKw.jpeg" /><figcaption>An image generated by Stable Diffusion with a “multiple descriptions written on sticky notes sticked to a pizza” prompt.</figcaption></figure><p>Running the new version of Qdrant is as simple as it always was. By running the following command, you are able to set up a single instance that will also expose the HTTP API:</p><blockquote>docker run -p 6333:6333 qdrant/qdrant:v0.10.1</blockquote><h3>Creating a collection</h3><p>Adding new functionalities typically requires making some changes to the interfaces, so no surprise we had to do it to enable the multiple vectors support. Currently, if you want to create a collection, you need to define the configuration of all the vectors you want to store for each object. Each vector type has its own name and the distance function used to measure how far the points are.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/07fd74179d634188fc6613b62d3e132f/href">https://medium.com/media/07fd74179d634188fc6613b62d3e132f/href</a></iframe><p>In case you want to keep a single vector per collection, you can still do it without putting a name though.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0a3b1d7c8638038a9f9e91395f35bf21/href">https://medium.com/media/0a3b1d7c8638038a9f9e91395f35bf21/href</a></iframe><p>All the search-related operations have slightly changed their interfaces as well, so you can choose which vector to use in a specific request. However, it might be easier to see all the changes by following an end-to-end Qdrant usage on a real-world example.</p><h3>Building service with multiple embeddings</h3><p>Quite a common approach to building search engines is to combine semantic textual capabilities with image search as well. For that purpose, we need a dataset containing both images and their textual descriptions. There are several datasets available with <a href="https://huggingface.co/datasets/ChristophSchuhmann/MS_COCO_2017_URL_TEXT">MS_COCO_2017_URL_TEXT</a> being probably the simplest available. And because it’s available on HuggingFace, we can easily use it with their <a href="https://huggingface.co/docs/datasets/index">datasets</a> library.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0908dba0623f456cc3d8899e92a7a4c0/href">https://medium.com/media/0908dba0623f456cc3d8899e92a7a4c0/href</a></iframe><p>Right now, we have a dataset with a structure containing the image URL and its textual description in English. For simplicity, we can convert it to the DataFrame, as this structure might be quite convenient for future processing.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/338979c885ed9eaa0dc15a7d03c043cc/href">https://medium.com/media/338979c885ed9eaa0dc15a7d03c043cc/href</a></iframe><p>The dataset consists of two columns: <em>TEXT</em> and <em>URL</em>. Thus, each data sample is described by two separate pieces of information and each of them has to be encoded with a different model.</p><h3>Processing the data with pretrained models</h3><p>Thanks to <a href="https://github.com/koaning/embetter">embetter</a>, we can reuse some existing pretrained models and use a convenient scikit-learn API, including pipelines. This library also provides some utilities to load the images, but only supports the local filesystem, so we need to create our own class that will download the file, given its URL.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/fe36640fe24861b050c823f36782e324/href">https://medium.com/media/fe36640fe24861b050c823f36782e324/href</a></iframe><p>Now we’re ready to define the pipelines to process our images and texts using <em>all-MiniLM-L6-v2</em> and <em>vit_base_patch16_224</em> models respectively. First of all, let’s start with Qdrant configuration.</p><h3>Creating Qdrant collection</h3><p>We’re going to put two vectors per object (one for image and another one for text), so we need to create a collection with a configuration allowing us to do so.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/575f70d403bb85eba620f9110cfcd551/href">https://medium.com/media/575f70d403bb85eba620f9110cfcd551/href</a></iframe><h3>Defining the pipelines</h3><p>And since we have all the puzzles already in place, we can start the processing to convert raw data into the embeddings we need. The pretrained models come in handy.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/07cd519ef733dd919238cb8093d0cb2e/href">https://medium.com/media/07cd519ef733dd919238cb8093d0cb2e/href</a></iframe><p>Thanks to the scikit-learn API, we can simply call each pipeline on the created DataFrame and put created vectors into Qdrant to enable fast vector search. For convenience, we’re going to put the vectors as other columns in our DataFrame.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/37eca6bf787ab7b645ac5d9ddcc76800/href">https://medium.com/media/37eca6bf787ab7b645ac5d9ddcc76800/href</a></iframe><p>The created vectors might be easily put into Qdrant. For the sake of simplicity, we’re going to skip it, but if you are interested in details, please check out the <a href="https://gist.github.com/kacperlukawski/961aaa7946f55110abfcd37fbe869b8f">Jupyter notebook</a> going step by step.</p><h3>Searching with multiple vectors</h3><p>If you decided to describe each object with several neural embeddings, then at each search operation you need to provide the vector name along with the embedding, so the engine knows which one to use. The interface of the search operation is pretty straightforward and requires an instance of NamedVector.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/45fd28f38dc3c70bfae16c32f5d73e6e/href">https://medium.com/media/45fd28f38dc3c70bfae16c32f5d73e6e/href</a></iframe><p>If we, on the other hand, decided to search using the image embedding, then we just provide the vector name we have chosen while creating the collection, so instead of “text”, we would provide “image”, as this is how we configured it at the very beginning.</p><h3>The results: image vs text search</h3><p>Since we have two different vectors describing each object, we can perform the search query using any of those. That shouldn’t be surprising then, that the results are different depending on the chosen embedding method. The images below present the results returned by Qdrant for the image/text on the left-hand side.</p><h4>Image search</h4><p>If we query the system using image embedding, then it returns the following results:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5nqLmJZNjkVDrJhj" /><figcaption>Image search results</figcaption></figure><h4>Text search</h4><p>However, if we use textual description embedding, then the results are slightly different:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3SdgCtsWb99XtExL" /><figcaption>Text search results</figcaption></figure><p>It is not surprising that a method used for creating neural encoding plays an important role in the search process and its quality. If your data points might be described using several vectors, then the latest release of Qdrant gives you an opportunity to store them together and reuse the payloads, instead of creating several collections and querying them separately.</p><p>If you’d like to check out some other examples, please check out our <a href="https://gist.github.com/kacperlukawski/961aaa7946f55110abfcd37fbe869b8f">full notebook</a> presenting the search results and the whole pipeline implementation.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1da8b1ad727" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qdrant/storing-multiple-vectors-per-object-in-qdrant-c1da8b1ad727">Storing multiple vectors per object in Qdrant</a> was originally published in <a href="https://medium.com/qdrant">Qdrant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Batch vector search with Qdrant]]></title>
            <link>https://medium.com/qdrant/batch-vector-search-with-qdrant-8c4d598179d5?source=rss-45c5de5a80b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/8c4d598179d5</guid>
            <category><![CDATA[vector]]></category>
            <category><![CDATA[information-retrieval]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Kacper Łukawski]]></dc:creator>
            <pubDate>Mon, 26 Sep 2022 14:22:30 GMT</pubDate>
            <atom:updated>2022-09-29T09:54:30.098Z</atom:updated>
            <content:encoded><![CDATA[<p>The latest release of Qdrant 0.10.0 has introduced a lot of functionalities that simplify some common tasks. Those new possibilities come with some slightly modified interfaces of the client library. One of the recently introduced features is the possibility to query the collection with multiple vectors at once — a batch search mechanism.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*6xc6Tw9rOpjwv-mIcj5-VQ.png" /><figcaption>An image generated by Stable Diffusion with a query “several haystacks laying next to each other”</figcaption></figure><p>There are a lot of scenarios in which you may need to perform multiple non-related tasks at the same time. Previously, you only could send several requests to Qdrant API on your own. But multiple parallel requests may cause significant network overhead and slow down the process, especially in case of poor connection speed.</p><p>Now, thanks to the new batch search, you don’t need to worry about that. Qdrant will handle multiple search requests in just one API call and will perform those requests in the most optimal way.</p><h3>An example of using the batch search</h3><p>We’ve used the official Python client to show how the batch search might be integrated with your application. Since there have been some changes in the interfaces of Qdrant 0.10.0, we’ll go step by step.</p><h3>Creating the collection</h3><p>The first step is to create a collection with a specified configuration — at least vector size and the distance function used to measure the similarity between vectors.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/095b34fa8571e96ad7b9cf3707dafadb/href">https://medium.com/media/095b34fa8571e96ad7b9cf3707dafadb/href</a></iframe><h3>Loading the vectors</h3><p>With the collection created, we can put some vectors into it. We’re going to have just a few examples.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/68ee54e4035746ec961e9c193f37d43f/href">https://medium.com/media/68ee54e4035746ec961e9c193f37d43f/href</a></iframe><h3>Batch search in a single request</h3><p>Now we’re ready to start looking for similar vectors, as our collection has some entries. Let’s say we want to find the distance between the selected vector and the most similar database entry and at the same time find the two most similar objects for a different vector query. Up till 0.9, we would need to call the API twice. Now, we can send both requests together:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca62fa0524638f8842c836a09501ac89/href">https://medium.com/media/ca62fa0524638f8842c836a09501ac89/href</a></iframe><p>Each instance of the SearchRequest class may provide its own search parameters, including vector query but also some additional filters. The response will be a list of individual results for each request. In case any of the requests is malformed, there will be an exception thrown, so either all of them pass or none of them.</p><p>And that’s it! You no longer have to handle the multiple requests on your own. Qdrant will do it under the hood.</p><h3>Benchmark</h3><p>The batch search is fairly easy to be integrated into your application, but if you prefer to see some numbers before deciding to switch, then it’s worth comparing four different options:</p><ol><li>Querying the database sequentially.</li><li>Using many threads/processes with individual requests.</li><li>Utilizing the batch search of Qdrant in a single request.</li><li>Combining parallel processing and batch search.</li></ol><p>In order to do that, we’ll create a richer collection of points, with vectors from the <em>glove-25-angular</em> dataset, quite a common choice for ANN comparison. If you’re interested in seeing some more details of how we benchmarked Qdrant, let’s take a <a href="https://gist.github.com/kacperlukawski/2d12faa49e06a5080f4c35ebcb89a2a3">look at the Gist</a>.</p><h3>The results</h3><p>We launched the benchmark 5 times on 10000 test vectors and averaged the results. Presented numbers are the mean values of all the attempts:</p><ol><li>Sequential search: 225.9 seconds</li><li>Batch search: 208.0 seconds</li><li>Multiprocessing search (8 processes): 194.2 seconds</li><li>Multiprocessing batch search (8 processes, batch size 10): 148.9 seconds</li></ol><p>The results you may achieve on a specific setup may vary depending on the hardware, however, at the first glance, it seems that batch searching may save you quite a lot of time.</p><p>Additional improvements could be achieved in the case of distributed deployment, as Qdrant won’t need to make extensive inter-cluster requests. Moreover, if your requests share the same filtering condition, the query optimizer would be able to reuse it among batch requests.</p><h3>Summary</h3><p>Batch search allows packing different queries into a single API call and retrieving the results in a single response. If you ever struggled with sending several consecutive queries into Qdrant, then you can easily switch to the new batch search method and simplify your application code. As shown in the benchmarks, that may almost effortlessly speed up your interactions with Qdrant even by over 30%, even not considering the spare network overhead and possible reuse of filters!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8c4d598179d5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qdrant/batch-vector-search-with-qdrant-8c4d598179d5">Batch vector search with Qdrant</a> was originally published in <a href="https://medium.com/qdrant">Qdrant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Qdrant supports ARM architecture!]]></title>
            <link>https://medium.com/qdrant/qdrant-supports-arm-architecture-363e92aa5026?source=rss-45c5de5a80b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/363e92aa5026</guid>
            <category><![CDATA[embedding]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[vector-search-engine]]></category>
            <category><![CDATA[vector-search]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Kacper Łukawski]]></dc:creator>
            <pubDate>Wed, 21 Sep 2022 10:59:06 GMT</pubDate>
            <atom:updated>2022-09-29T09:50:01.188Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*qjPCFG6EMi10yu1mL2dSWg.png" /></figure><p>The processor architecture is a thing that the end-user typically does not care much about, as long as all the applications they use run smoothly. If you use a PC then chances are you have an x86-based device, while your smartphone rather runs on an ARM processor. In 2020 Apple introduced their ARM-based M1 chip which is used in modern Mac devices, including notebooks. The main differences between those two architectures are the set of supported instructions and energy consumption. ARM’s processors have a way better energy efficiency and are cheaper than their x86 counterparts. That’s why they became available as an affordable alternative in the hosting providers, including the cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*SeAglC6JiH2qKNoShqBF1Q.png" /><figcaption>An image generated by Stable Diffusion with a query “two computer processors fightning against each other”</figcaption></figure><p>In order to make an application available for ARM users, it has to be compiled for that platform. Otherwise, it has to be emulated by the device, which gives an additional overhead and reduces its performance. We decided to provide the <a href="https://hub.docker.com/r/qdrant/qdrant/">Docker images</a> targeted especially at ARM users. Of course, using a limited set of processor instructions may impact the performance of your vector search, and that’s why we decided to test both architectures using a similar setup.</p><h4>Test environments</h4><p>AWS offers ARM-based EC2 instances that are 20% cheaper than the x86 corresponding alternatives with a similar configuration. That estimate has been done for the eu-central-1 region (Frankfurt) and R6g/R6i instance families. For the purposes of this comparison, we used an r6i.large instance (Intel Xeon) and compared it to r6g.large one (AWS Graviton2). Both setups have 2 vCPUs and 16 GB of memory available and these were the smallest comparable instances available.</p><h3>The results</h3><p>For the purposes of this test, we created some random vectors which were compared with cosine distance.</p><h4>Vector search</h4><p>During our experiments, we performed 1000 search operations for both ARM64 and x86-based setups. We didn’t measure the network overhead, only the time measurements returned by the engine in the API response. The chart below shows the distribution of that time, separately for each architecture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/947/1*zVUef4ri6ZtQjZBsoCQJ_w.png" /><figcaption>The latency distribution of search requests: arm vs x86</figcaption></figure><p>It seems that ARM64 might be an interesting alternative if you are on a budget. It is 10% slower on average, and 20% slower on the median, but the performance is more consistent. It seems like it won’t be randomly 2 times slower than the average, unlike x86. That makes ARM64 a cost-effective way of setting up vector search with Qdrant, keeping in mind it’s 20% cheaper on AWS. You do get less for less, but surprisingly more than expected.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=363e92aa5026" width="1" height="1" alt=""><hr><p><a href="https://medium.com/qdrant/qdrant-supports-arm-architecture-363e92aa5026">Qdrant supports ARM architecture!</a> was originally published in <a href="https://medium.com/qdrant">Qdrant</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[I used FAISS, so you don’t have to]]></title>
            <link>https://lukawskikacper.medium.com/i-used-faiss-so-you-dont-have-to-ebfd9b3fd7e8?source=rss-45c5de5a80b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebfd9b3fd7e8</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Kacper Łukawski]]></dc:creator>
            <pubDate>Thu, 07 Jul 2022 19:07:35 GMT</pubDate>
            <atom:updated>2022-07-07T20:28:41.070Z</atom:updated>
            <content:encoded><![CDATA[<p>The introduction of Approximate Neural Neighbours methods started the renaissance of k-NN-like approaches. We’re all in desperate need of scalable yet simply interpretable methods, and similarity-based ones were great candidates but offered poor performance back in the day. When Facebook presented FAISS, and Spotify open-sourced their own tool, Annoy, using similarity, but combined with neural embeddings this time, became a topic again. And both libraries allowed many companies to start performing their neural search more efficiently, which has to be emphasized, but they also gave them another headache.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZPvdAMMh3y1HaZBJ3n3XzA.png" /><figcaption>Typical workflow of computing embeddings. A model takes converts input into a high-dimensional vector.</figcaption></figure><h3>What makes FAISS different</h3><p>FAISS, which stands for Facebook AI Similarity Search, is a library written in C++ with a Python interface, which provides some data structures and methods to make the vector search efficient. Vector search really differs from the traditional search, as it can’t be based on inverted indexes anymore, and has to consider the distance between the data points, not the values of the single dimensions only. Those vectors are typically generated by deep learning models, and there are plenty of pretrained ones available off the shelf.</p><p>As a C++ library, FAISS is a great tool for performing your experiments quickly. If you have a dataset, you can generate embeddings out of your data points with a pretrained model, or fine-tune an existing one, to then create a FAISS index and finally perform the search for similar examples. And that will be blazing fast if you compare it to brute force k-NN. Unfortunately, the index is available only in the process that created it, so the integration with some external services requires some additional effort and a custom interface to create. All the vectors will also be put into the RAM of that single machine, so in case of bigger amounts of data and/or high dimensionality of the embeddings, you’ll need an enormous amount of memory available, or accept using the virtual memory and slowing it all down. There are of course some optimizations available, like product quantization (PQ), but at the end of the day, FAISS is just another heavy data structure you need to maintain somehow.</p><h3>What makes FAISS, in turn, similar</h3><p>Do not get me wrong — I love quick prototyping tools, and I use them heavily. But I have never even thought about running a Jupyter notebook with some pandas operation chains and called it a production system. All those libraries share some similar traits with FAISS. Each of them has been created to support experiments. They are quick and easy to set up, do not require DevOps experience to launch, and maintenance is unnecessary. But they all do not scale well. And that’s a matter of choice, not their drawback. When I get new data and just want to try out what’s in there, I don’t want to design a normalised database structure, put my dataset inside it, and then write lots of JavaScript code to visualize and realize it’s garbage. Well, I could, but that would be a waste of time and I can probably come to the conclusion it is garbage a few months sooner if I just loaded it with pandas, using my lovely Jupyter Notebook instance, and visualized it with the great help of matplotlib or seaborn.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fJQBMEUoHlkgyvw0-6HEtw.png" /><figcaption>There are many great tools designed for experiments. FAISS is one of them.</figcaption></figure><p>I’m pretty sure, that if I, from the very beginning, used an SQL database and created some b-tree or hash indexes on the columns, which I knew I’d be using often, I could have an optimized Data Science workflow, designed for a specific case. But that would be premature optimization. However, if we claim or even just pretend to do the “Science” work, that involves many failures on our way and floundering in the dark. Fast prototyping is crucial, even if our code executes way slower than it could. Going into production is not the responsibility of the Data Scientist, or at least it shouldn’t be. There are some other people who can move the experiments into a running system, and none of them will ever use pandas working with huge CSVs as a preferred data manipulation tool. And that’s also true for FAISS. “<em>Make it work. Make it right. Make it fast.</em>” — this is a famous statement, but DS experiments rarely go even up to the second phase.</p><p>There are many stories of using FAISS in production, but they always emphasize the importance of managing the servers, containers or pods. There is a lot of management going on, and that might be an overkill that distracts you from bringing the business value. You also need to create an abstraction layer, so the other services can communicate with your vector search engine. In a world dominated by cloud and serverless hype, systems like that seem a bit outdated.</p><h3>Is vector search all we need?</h3><p>NLP and Computer Vision tasks can sometimes depend solely on single pieces of text or images. But in many cases, we have some metadata or just equally important other attributes of our data points, which cannot be encoded in the embeddings directly. Just imagine a visual search system looking for a particular item by the photo you provide, preferably available in a place you live or at least nearby. I know there might be an excellent sushi takeaway in Tokio, but chances are I won’t order it for lunch if I live in Europe.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cOE7SRIzR2nztE0W1fRM5Q.png" /><figcaption>Embeddings cannot capture some of the important context data.</figcaption></figure><p>We cannot rely on vector search only if we have some other criteria to fulfil. And anyone working with ANN can tell it already. The good old search world we wanted to avoid has chased us cruelly. Unfortunately, FAISS on its own doesn’t support that mode of search. What we can do instead is to use a secondary search system, like Elasticsearch, to check which of the vector search results match the conditions. Sometimes even a good old relational friend may work well, but still — we need two systems to support the search, and probably another service to combine those results.</p><h3>Do we have any alternative?</h3><p>Taking things seriously, we need to start thinking about neural search as a first-class citizen in our systems. We have established great tools for keyword-based matching, or traditional attribute-based filtering, and there has been a lot going on in the area of vector similarity recently. The fast experimental way that FAISS provides is great for POCs, but if we want to scale things up, we need a system that will act as a vector database, capable of being launched on a whole bunch of machines, with redundancy and fault tolerance already built-in.</p><p>There are some differences between the existing vector search engines. Some of them, like Pinecone or Google’s Vertex AI, are available as SaaS first and only, but the majority are open source, so anyone can start simply with no hidden costs. And if you at some point decide you need to scale, then going into the cloud or on-premise cluster should be also possible, without any need to build your own system around it. And last, but not least — the best solutions will allow you to store not only the vectors, but also some different attributes you also want to filter by, or just simply retrieve with your neighbours.</p><p>Open Source projects really stand out in the world of ANN. The well-known <a href="https://lucene.apache.org/">Lucene</a>-based tools, like Solr or Elasticsearch, also started implementing the indexes for dense vectors, but rather as an addition to their core functionalities, which are rather a keyword or inverted index-based. And that could work for you in case the neural search is just the icing on the cake, but not that important. However, if you take semantic search seriously and think of it as a major functionality, you have to consider using a tool which is designed specifically for that. And there are plenty of options, with tools like <a href="https://qdrant.tech/">Qdrant</a> that will allow you to run the neural search easily, with the support of additional filtering mechanisms done in a scalable way, while keeping a user-friendly interface.</p><p><strong>References</strong></p><p><a href="https://speakerdeck.com/kumon/cvpr-2020-tutorial-a-large-scale-visual-search-system-in-the-c2c-marketplace-app-mercari?slide=21">https://speakerdeck.com/kumon/cvpr-2020-tutorial-a-large-scale-visual-search-system-in-the-c2c-marketplace-app-mercari?slide=21</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebfd9b3fd7e8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to implement a visual search in no time]]></title>
            <link>https://medium.com/analytics-vidhya/how-to-implement-a-visual-search-at-no-time-5515270d27e3?source=rss-45c5de5a80b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/5515270d27e3</guid>
            <category><![CDATA[neural-networks]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[search]]></category>
            <dc:creator><![CDATA[Kacper Łukawski]]></dc:creator>
            <pubDate>Wed, 11 May 2022 19:31:48 GMT</pubDate>
            <atom:updated>2022-05-12T08:33:29.636Z</atom:updated>
            <content:encoded><![CDATA[<p>I’ve been using a Google Lens app for a while now and have to admit it helped me more times than I expected. Whenever I had to remind myself how often I should water my plants but didn’t remember their names, or when I wanted to check the price of an item, I would find my smartphone, take a photo, and have the answer in a few seconds. This is really a great general-use tool but struggles if we have some additional criteria to apply or are interested in a specific domain.</p><p>The topic of the quality decline of Google search results has been broadly discussed. There is a great Twitter thread describing some domains where the results are typically irrelevant.</p><h3>Michael Seibel on Twitter: &quot;A recent small medical issue has highlighted how much someone needs to disrupt Google Search. Google is no longer producing high quality search results in a significant number of important categories. / Twitter&quot;</h3><p>A recent small medical issue has highlighted how much someone needs to disrupt Google Search. Google is no longer producing high quality search results in a significant number of important categories.</p><p>I’m not sure if SEO for images is a topic yet, but Google used to produce better results for textual queries before everybody started “optimizing” their content. Even if the algorithm behind the image search is not yet affected, it has another drawback. What if I don’t want to search in general, but want to find an interesting product in the stock of a particular shop? And additionally, I know the item should have a similar shape, but some other attributes should be different than the ones present in the image? I may want to buy a particular car model, but not necessarily the colour seen in a photograph.</p><figure><img alt="An old school car painted in pink" src="https://cdn-images-1.medium.com/max/1024/0*ig77-qwuZI03_HEK" /><figcaption>Photo by <a href="https://unsplash.com/es/@robinoode?utm_source=medium&amp;utm_medium=referral">Robin Ooode</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Leveraging image search capabilities with the traditional <a href="https://www.dynamicyield.com/glossary/faceted-search/">faceted search</a> seems to be a great idea in many domains. It turns out to be not that hard to create your own powerful search engine.</p><h3>Custom visual search engine</h3><p><a href="https://www.kaggle.com/competitions/h-and-m-personalized-fashion-recommendations">H&amp;M Personalized Fashion Recommendations</a> competition on Kaggle has come to an end. It was a challenge about predicting the items which H&amp;M’s customers were going to buy. The participants were given lots of tabular, textual and image data and were free to choose the approach. For us, the most important will be the photos of real products, along with the metadata like colour, product type, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*rIVRcpT-W6kyevUFhVpAGg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*meSSYCHnH0lq5e6iP6NAlA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*Ts-WOyVn6CfbFVT31hBmng.jpeg" /><figcaption>Some examples from the H&amp;M dataset. Overall more than 100k examples have been provided.</figcaption></figure><p>Those images, together with product attributes, make a powerful dataset to create a visual search system.</p><h3>Process design</h3><h4>Embeddings / vectorization</h4><p>Given an image, we need to encode it to a vector of fixed size. This representation, typically called embedding, is usually generated by some deep neural networks. In the case of H&amp;M images, I decided to use a <a href="https://pytorch.org/vision/main/models/generated/torchvision.models.resnet18.html">pre-trained ResNet18</a>, without the last layer that performs classification into 1000 classes. The layer before has 512 neurons and directly gives us an embedding in a 512-dimensional space.</p><p>As the original ResNet network had been trained on 3-channels of 244x244 pixel images, our database required some conversion but that’s done automatically by <a href="https://github.com/christiansafka/img2vec">img2vec</a>, a library reducing a boilerplate required to create image embeddings. There are just a few lines required in order to have the vectorization done:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ede4c4be1a27615b7e95f87746fb9a70/href">https://medium.com/media/ede4c4be1a27615b7e95f87746fb9a70/href</a></iframe><p>This process has been done for all the images, so at the end of it, we had over 100k embeddings and some other attributes of each article.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c1daf04c5ed8c096a4e22b8ea9c560f9/href">https://medium.com/media/c1daf04c5ed8c096a4e22b8ea9c560f9/href</a></iframe><p>It’s worth noting, that I didn’t finetune the ResNet18 model and just used the original results. So literally didn’t spend any time on neural network training.</p><h4>Vector lookup</h4><p>We could now compare new examples with the ones that we have in our database and choose the most similar ones, using a selected <a href="https://en.wikipedia.org/wiki/Distance">distance function</a>. The naive approach would be to perform a <a href="https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm">k-NN algorithm</a>, however, that would require performing a comparison with all the other vectors at each search, and won’t be efficient if we had hundreds of thousands or even millions of entries. It’s somehow similar to a full table scan in SQL databases. As long as the number of rows is low, we don’t need to worry. However, if we want to keep the performance on a reasonable level, then we need to approach both problems differently. For SQL databases we typically create indices, so we can access some specific subsets of the tables. For vectors, the only reasonable answer is <strong>Approximate Neural Search</strong>.</p><p>Nowadays, you can perform ANN without going much into detail, as there are some vector libraries and databases available. Since I wanted to apply some faceted filters on top of the results, <a href="https://qdrant.tech/"><strong>Qdrant</strong></a> was a great choice here. It utilizes <a href="https://arxiv.org/abs/1603.09320">HNSW</a> with some tweaks to allow those additional filtering capabilities. They are especially useful if we look for a piece of clothes with a cut we like, but with a different colour or fabric.</p><p>Qdrant exposes REST and gRPC interfaces, so is fairly easy to integrate, and if you’re using Python, then there is already a <a href="https://github.com/qdrant/qdrant_client">qdrant-client</a> library that makes things even easier.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/90487b5db40755562547f8a4a12d1f0d/href">https://medium.com/media/90487b5db40755562547f8a4a12d1f0d/href</a></iframe><h3>Live demo</h3><p>Since CLI tools are rarely used by people looking for new clothes, we enclosed everything with <a href="https://streamlit.io/">Streamlit</a>, and ended up with a simple UI. We’ve published a demo allowing you to search for visually similar products based on provided image or the one from a predefined list:</p><p><a href="https://h-and-m.qdrant.tech/">https://h-and-m.qdrant.tech/</a></p><p>Looking for a jacket, but prefer a metallic one? That’s now pretty simple.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/542/1*i11qFfVqXFx4s1xtlC03HA.gif" /><figcaption>Searching by image with additional filter applied</figcaption></figure><p>If you are interested in some more technical details, the source code is open and available on Github: <a href="https://github.com/qdrant/demo-hnm">https://github.com/qdrant/demo-hnm</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5515270d27e3" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/how-to-implement-a-visual-search-at-no-time-5515270d27e3">How to implement a visual search in no time</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>