agentskit.js
Memory

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.

Explore nearby

✎ Edit this page on GitHubΒ·Found a problem? Open an issue β†’Β·How to contribute β†’

On this page