npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ragpipe/plugin-supabase

v0.5.0

Published

Supabase pgvector vector store plugin for ragpipe

Readme

@ragpipe/plugin-supabase

Supabase vector store plugin for ragpipe, powered by @supabase/supabase-js.

Install

pnpm add ragpipe @ragpipe/plugin-supabase

Usage

import { defineConfig } from "ragpipe";
import { supabaseVectorStore } from "@ragpipe/plugin-supabase";

export default defineConfig({
  // ... embedding, generation
  vectorStore: supabaseVectorStore({
    supabaseUrl: process.env.SUPABASE_URL ?? "",
    supabaseKey: process.env.SUPABASE_SERVICE_ROLE_KEY ?? "",
    tableName: "documents",   // default
    queryName: "match_documents", // default RPC function name
  }),
});

API

supabaseVectorStore(options)

Returns a VectorStorePlugin backed by Supabase using the official JS SDK.

| Option | Type | Default | Description | |---|---|---|---| | supabaseUrl | string | — | Supabase project URL (required) | | supabaseKey | string | — | Service role key (required) | | tableName | string | "documents" | Table to store documents | | queryName | string | "match_documents" | PostgreSQL function for vector search |

Methods

| Method | Description | |---|---| | search(vector, topK) | Calls supabase.rpc() for cosine similarity search | | upsert(source, content, vector) | Inserts via supabase.from().upsert() with dedup on source,content | | clear() | Deletes all rows from the documents table | | disconnect() | No-op (Supabase JS client manages connections automatically) |

Database Setup

Run the following in your Supabase SQL editor:

-- 1. Enable pgvector
CREATE EXTENSION IF NOT EXISTS vector;

-- 2. Create the documents table
CREATE TABLE documents (
  id BIGSERIAL PRIMARY KEY,
  source TEXT NOT NULL,
  content TEXT NOT NULL,
  vector VECTOR(3072),
  UNIQUE(source, content)
);

-- 3. Create the similarity search function
CREATE OR REPLACE FUNCTION match_documents(
  query_embedding VECTOR(3072),
  match_count INT DEFAULT 5
)
RETURNS TABLE (
  source TEXT,
  content TEXT,
  similarity FLOAT
)
LANGUAGE plpgsql
AS $$
BEGIN
  RETURN QUERY
  SELECT
    d.source,
    d.content,
    1 - (d.vector <=> query_embedding) AS similarity
  FROM documents d
  ORDER BY d.vector <=> query_embedding
  LIMIT match_count;
END;
$$;

-- 4. Create an index for faster search
CREATE INDEX ON documents
  USING ivfflat (vector vector_cosine_ops)
  WITH (lists = 100);

Adjust VECTOR(3072) to match your embedding model's dimensions.

License

MIT