agentskit.js
Data layerMemory

pgvector

Postgres + pgvector adapter. BYO SQL runner.

import { pgvector } from '@agentskit/memory'
import postgres from 'postgres'

const sql = postgres(process.env.DATABASE_URL!)
const store = pgvector({
  run: async (query, params) => sql.unsafe(query, params as unknown[]),
  table: 'embeddings',
  dim: 1536,
})

Options

OptionTypeDefault
runPgVectorRunnerrequired
tablestringembeddings
dimnumberrequired
metric'cosine' | 'l2' | 'ip'cosine

Why BYO runner

Keeps the adapter client-agnostic — works with postgres.js, pg, Drizzle, Prisma raw, Neon serverless.

✎ Edit this page on GitHub·Found a problem? Open an issue →·How to contribute →

On this page