@idriszade/store-pgvector
v0.1.7
Published
Pipeline-kit Store adapter for vector similarity search via pgvector and Drizzle ORM
Maintainers
Readme
@idriszade/store-pgvector
Store adapter for vector similarity search via pgvector and Drizzle ORM. Ships a pgvectorColumn(dimension) Drizzle custom-type helper and supports cosine, l2, and inner_product distances with hnsw or ivfflat indexes.
Install
pnpm add @idriszade/store-pgvectorPostgres server-side requirement: CREATE EXTENSION IF NOT EXISTS vector;
Usage
import { createPgvectorStore } from '@idriszade/store-pgvector';
import { z } from 'zod';
const store = createPgvectorStore({
connectionString: process.env.PG_CONNECTION!,
dimension: 1536,
distance: 'cosine',
indexType: 'hnsw',
schema: z.object({ text: z.string() }),
});
// store.put(atomWithEmbedding, ctx);
// store.search(queryEmbedding, k, filters, ctx);Reference
Canonical API surface: docs/spec-adapters.md. Core types: docs/spec-api-surface.md.
