DEDUPED Hot AI repos, turned into use cases Get the Monday 5

How to add vector search to an AI app in Postgres with Supabase

Store embeddings next to your data and search them with the AI and vector toolkit.

Who it is forDeveloper building an AI feature, such as document search or a question-answering tool, who wants the vectors in the same database as the app data.

The problemRunning a separate vector database adds another service to manage and another place where data can drift out of sync.

The outcomeEmbeddings stored in the same Postgres database as your app tables, queried alongside normal data.

What you need first

  • A Supabase account at https://supabase.com/dashboard, or a self-hosted install following the self-host guide
  • A basic understanding of Postgres tables and rows
  • A client library for your app language, such as supabase-js for JavaScript or TypeScript, listed in the README client table

Steps

  1. Create a hosted Supabase project or set up a local or self-hosted instance.
  2. Create a table with a column for your text and a column for its embedding using the AI + Vector/Embeddings Toolkit guide.
  3. Generate embeddings for your text with the model of your choice and write them into the embedding column.
  4. Run a similarity query against the embedding column from your app through the auto-generated API or a database function.
  5. Check the results on a few known questions before exposing the search to users.

Prompt for your agent

Using the supabase/supabase README and its AI + Vector/Embeddings Toolkit docs link, create a Postgres table for <document collection> with an embedding column and a similarity search function. Output the SQL and a sample query. Verify that the search returns the expected document for three test questions.

Caveat. The README names the AI and vector toolkit but does not describe its specific functions, so confirm the exact extension and query syntax in the linked docs.

Share: X LinkedIn Hacker News Email Copy link

Disclaimer

Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked "Seen in the wild", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email [email protected] and we will look at it promptly. Full disclaimer page