<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Use Cases on Vchord</title>
    <link>https://vchord.pgsty.com/pgvecto-rs/use-case/</link>
    <description>Recent content in Use Cases on Vchord</description>
    <generator>Hugo</generator>
    <language>en-US</language>
    
    
    
      <lastBuildDate>Mon, 02 Nov 2026 19:35:19 +0800</lastBuildDate>
    
    
      <atom:link href="https://vchord.pgsty.com/pgvecto-rs/use-case/index.xml" rel="self" type="application/rss+xml" />
    
    <item>
        <title>Hybrid Search</title>
        <link>https://vchord.pgsty.com/pgvecto-rs/use-case/hybrid-search/</link>
        <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
        
        <guid>https://vchord.pgsty.com/pgvecto-rs/use-case/hybrid-search/</guid>
        <description>&lt;p&gt;We will show you how to use &lt;code&gt;pgvecto.rs&lt;/code&gt; to implement hybrid search in this section.&lt;/p&gt;&#xA;&lt;h2 id=&#34;vector-search-and-full-text-search&#34;&gt;Vector Search and Full Text Search&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;Postgres provides &lt;a href=&#34;https://www.postgresql.org/docs/current/textsearch-intro.html&#34;&gt;full text search&lt;/a&gt;, based on &lt;a href=&#34;https://www.postgresql.org/docs/current/textsearch-intro.html#TEXTSEARCH-MATCHING&#34;&gt;the match operator &lt;code&gt;@@&lt;/code&gt;&lt;/a&gt;. It returns true if a &lt;code&gt;tsvector&lt;/code&gt; (document) matches a &lt;code&gt;tsquery&lt;/code&gt; (query). It doesn&amp;rsquo;t matter &lt;strong&gt;which data type is written first&lt;/strong&gt;:&lt;/p&gt;&#xA;&lt;div class=&#34;td-code td-code--untitled&#34; id=&#34;td-code-4e457930-fence-0&#34; data-td-code data-td-code-auto-id&#xA;     data-td-language=&#34;sql&#34; data-td-line-count=&#34;9&#34;&gt;&#xA;  &lt;div class=&#34;td-code__viewport&#34; id=&#34;td-code-4e457930-fence-0-viewport&#34; data-td-code-viewport&gt;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-sql&#34; data-lang=&#34;sql&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;a fat cat sat on a mat and ate a fat rat&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tsvector&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@@&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;cat &amp;amp; rat&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tsquery&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;?&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;column&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;?&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;----------&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;t&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;k&#34;&gt;SELECT&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;cat &amp;amp; rat&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tsquery&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;@@&lt;/span&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;s1&#34;&gt;&amp;#39;a fat cat sat on a mat and ate a fat rat&amp;#39;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;::&lt;/span&gt;&lt;span class=&#34;n&#34;&gt;tsvector&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;;&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;o&#34;&gt;?&lt;/span&gt;&lt;span class=&#34;k&#34;&gt;column&lt;/span&gt;&lt;span class=&#34;o&#34;&gt;?&lt;/span&gt;&lt;span class=&#34;w&#34;&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;----------&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;w&#34;&gt; &lt;/span&gt;&lt;span class=&#34;n&#34;&gt;t&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;&#xA;&lt;/div&gt;&#xA;&lt;div class=&#34;td-callout td-callout--tip&#34; role=&#34;note&#34;&gt;&#xA;  &lt;div class=&#34;td-callout__title&#34;&gt;&lt;i class=&#34;td-callout__icon fa-solid fa-lightbulb&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;span class=&#34;td-callout__label&#34;&gt;Tip&lt;/span&gt;&lt;/div&gt;&#xA;  &lt;div class=&#34;td-callout__body&#34;&gt;&#xA;&lt;p&gt;As the above example suggests, a &lt;code&gt;tsquery&lt;/code&gt; is not just raw text, any more than a &lt;code&gt;tsvector&lt;/code&gt; is. A &lt;code&gt;tsquery&lt;/code&gt; contains search terms, which must be already-normalized lexemes, and may combine multiple terms using &lt;a href=&#34;https://www.postgresql.org/docs/current/datatype-textsearch.html#DATATYPE-TSQUERY&#34;&gt;AND, OR, NOT, and FOLLOWED BY operators&lt;/a&gt;. In this example, the &lt;code&gt;tsquery&lt;/code&gt; &lt;code&gt;&#39;cat &amp;amp; rat&#39;&lt;/code&gt; matches the &lt;code&gt;tsvector&lt;/code&gt; &lt;code&gt;&#39;a fat cat sat on a mat and ate a fat rat&#39;&lt;/code&gt; because it contains both the terms &lt;code&gt;&#39;cat&#39;&lt;/code&gt; and &lt;code&gt;&#39;rat&#39;&lt;/code&gt;.&lt;/p&gt;&#xA;  &lt;/div&gt;&#xA;&lt;/div&gt;</description>
      </item>
    <item>
        <title>Adaptive retrieval and shortening embeddings</title>
        <link>https://vchord.pgsty.com/pgvecto-rs/use-case/adaptive-retrieval/</link>
        <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
        
        <guid>https://vchord.pgsty.com/pgvecto-rs/use-case/adaptive-retrieval/</guid>
        <description>&lt;p&gt;OpenAI &lt;a href=&#34;https://openai.com/blog/new-embedding-models-and-api-updates&#34;&gt;latest embedding models&lt;/a&gt; support shortening embeddings, where developers could simply “remove some numbers from the end of a sequence” and still maintain a valid representation for text.&lt;/p&gt;&#xA;&lt;blockquote&gt;&#xA;&lt;p&gt;This enables very flexible usage. For example, when using a vector data store that only supports embeddings up to 1024 dimensions long, developers can now still use our best embedding model text-embedding-3-large and specify a value of 1024 for the dimensions API parameter, which will shorten the embedding down from 3072 dimensions, trading off some accuracy in exchange for the smaller vector size.&lt;/p&gt;&#xA;&lt;/blockquote&gt;</description>
      </item>
    <item>
        <title>Image Search</title>
        <link>https://vchord.pgsty.com/pgvecto-rs/use-case/image-search/</link>
        <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
        
        <guid>https://vchord.pgsty.com/pgvecto-rs/use-case/image-search/</guid>
        <description>&lt;p&gt;Image intelligent search, also known as content-based image retrieval, goes beyond traditional keyword-based search and enables users to search for images based on their &lt;strong&gt;visual content&lt;/strong&gt;. For example, you could search images that &lt;strong&gt;contain&lt;/strong&gt; a red mushroom (image from &lt;a href=&#34;https://immich.app&#34;&gt;immich&lt;/a&gt;):&lt;/p&gt;&#xA;&lt;img class=&#34;td-image&#34; src=&#34;https://immich.app/img/screenshot-light.webp&#34; alt=&#34;image-search&#34; loading=&#34;lazy&#34; decoding=&#34;async&#34;&gt;&lt;p&gt;The feature looks like a magic because it allows you to search for images that you don&amp;rsquo;t have keywords for. The search engine understands the content of the images and videos and can find the ones that are similar to the query.&lt;/p&gt;</description>
      </item>
    <item>
        <title>Multi Tenancy</title>
        <link>https://vchord.pgsty.com/pgvecto-rs/use-case/multi-tenancy/</link>
        <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
        
        <guid>https://vchord.pgsty.com/pgvecto-rs/use-case/multi-tenancy/</guid>
        <description>&lt;p&gt;Multi-tenancy is essential for SaaS applications, allowing a single instance to serve multiple users or groups while ensuring data privacy and security. This blog outlines the design and implementation a simple multi-tenant vector search system with pgvecto.rs.&lt;/p&gt;&#xA;&lt;h2 id=&#34;designing-the-database-schema&#34;&gt;Designing the Database Schema&#xA;&lt;/h2&gt;&#xA;&lt;p&gt;The success of user-based isolation in multi-tenant systems hinges on a well-structured database schema:&lt;/p&gt;&#xA;&lt;h3 id=&#34;users-and-documents&#34;&gt;Users and Documents&#xA;&lt;/h3&gt;&#xA;&lt;p&gt;Each user is identified by a unique user_id, which directly links them to their documents for private access. The documents table contains each user&amp;rsquo;s documents, each with a distinct id, title, and content. Additional metadata can be included in the documents table to improve search functionality. The user_id is linked to the documents instead of chunk embeddings to replicate real-world scenarios more accurately.&lt;/p&gt;</description>
      </item>
    <item>
        <title>Sparse Vector Search</title>
        <link>https://vchord.pgsty.com/pgvecto-rs/use-case/sparse-vector/</link>
        <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
        
        <guid>https://vchord.pgsty.com/pgvecto-rs/use-case/sparse-vector/</guid>
        <description>&lt;p&gt;In the past, hybrid search combined two search methods: traditional keyword-based search and vector-based similarity search. However, sparse vector can act as a substitute for keyword search, unlocking the full potential of the data pipeline with pure vector search.&lt;/p&gt;&#xA;&lt;div class=&#34;td-callout td-callout--tip&#34; role=&#34;note&#34;&gt;&#xA;  &lt;div class=&#34;td-callout__title&#34;&gt;&lt;i class=&#34;td-callout__icon fa-solid fa-lightbulb&#34; aria-hidden=&#34;true&#34;&gt;&lt;/i&gt;&lt;span class=&#34;td-callout__label&#34;&gt;Tip&lt;/span&gt;&lt;/div&gt;&#xA;  &lt;div class=&#34;td-callout__body&#34;&gt;&#xA;&lt;p&gt;For more information about keyword-based hybrid search, please refer to &lt;a href=&#34;https://vchord.pgsty.com/pgvecto-rs/use-case/hybrid-search/&#34;&gt;Hybrid Search&lt;/a&gt;&lt;/p&gt;&#xA;  &lt;/div&gt;&#xA;&lt;/div&gt;&lt;p&gt;This post explores how to use how &lt;a href=&#34;https://huggingface.co/BAAI/bge-m3&#34;&gt;BGE-M3&lt;/a&gt; and &lt;code&gt;pgvecto.rs&lt;/code&gt; to exploit the potential of hybrid search using both sparse and dense vectors.&lt;/p&gt;</description>
      </item>
    <item>
        <title>Generative Question-Answering</title>
        <link>https://vchord.pgsty.com/pgvecto-rs/use-case/question-answering/</link>
        <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
        
        <guid>https://vchord.pgsty.com/pgvecto-rs/use-case/question-answering/</guid>
        <description>&lt;p&gt;Vector search can also be used to provide context to generative models such as OpenAI&amp;rsquo;s GPT series, improving the quality of the outputs.&lt;/p&gt;&#xA;&lt;p&gt;This post will explore the use of &lt;code&gt;pgvecto.rs&lt;/code&gt; in building and retrieving from a vector knowledge base to bolster the performance of generative models in question-answering tasks. A knowledge base serves as &amp;ldquo;long-term memory&amp;rdquo; for generative models, providing them persistent, curated, and accurate information as &lt;strong&gt;context&lt;/strong&gt; to draw from when generating an answer to a question. This results in answers that are more accurate, reduces the possibility of the model producing &amp;ldquo;hallucinations&amp;rdquo; (statements with no basis in reality), and increases user trust in the outputs. This technique is known as Retrieval-Augmented Generation, or RAG: see &lt;a href=&#34;https://ai.meta.com/blog/retrieval-augmented-generation-streamlining-the-creation-of-intelligent-natural-language-processing-models/&#34;&gt;this post&lt;/a&gt; or the &lt;a href=&#34;https://arxiv.org/abs/2005.11401v4&#34;&gt;related paper&lt;/a&gt; for more information.&lt;/p&gt;</description>
      </item>
    
  </channel>
</rss>
