TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Supabase Vecs – vector client for Postgres

10 pointsby oliverricealmost 2 years ago

2 comments

kiwicopplealmost 2 years ago
for those who jump straight to the comments (like me), this is a python for managing unstructured vectors&#x2F;embeddings in Postgres using pgvector. It works with any Postgres&#x2F;pgvector database<p>The core of the API is this:<p><pre><code> import vecs DB_CONNECTION = &quot;postgresql:&#x2F;&#x2F;&lt;user&gt;:&lt;password&gt;@&lt;host&gt;:&lt;port&gt;&#x2F;&lt;db_name&gt;&quot; # create vector store client vx = vecs.create_client(DB_CONNECTION) # create a collection of vectors with 3 dimensions docs = vx.create_collection(name=&quot;docs&quot;, dimension=3) # Add embeddings docs.upsert(vectors=[(&quot;vec0&quot;, [0.1, 0.2, 0.3], {&quot;year&quot;: 1973})]) # Query embeddings docs.query(query_vector=[0.10,0.21,0.29], limit=1) </code></pre> This stores all the data in a new `vecs` schema in your database. It took me a while to grasp the nature of structured (eg, manage tables&#x2F;data with migrations) with unstructured&#x2F;nosql, but the use cases for vectors are very often geared towards data scientists&#x2F;engineers. There is some more info about the interop between these approaches here: <a href="https:&#x2F;&#x2F;supabase.com&#x2F;docs&#x2F;guides&#x2F;ai&#x2F;structured-unstructured">https:&#x2F;&#x2F;supabase.com&#x2F;docs&#x2F;guides&#x2F;ai&#x2F;structured-unstructured</a>
oliverricealmost 2 years ago
hi, author here &amp; happy to answer any questions<p>Really looking forward to the next steps with vecs and would love to hear any thoughts about the `future ideas`.<p>Mainly, what kind of interface would you like to see for adapters&#x2F;transforms so collections can feel like you&#x27;re inserting text&#x2F;images&#x2F;video&#x2F;whatever rather than passing vectors around?