@absolutejs/rag-postgres
v0.0.7
Published
PostgreSQL (pgvector) vector-store adapter for @absolutejs/rag
Downloads
412
Maintainers
Readme
@absolutejs/rag-postgres
PostgreSQL vector-store adapter for @absolutejs/rag,
with pgvector as the first vector implementation. Native vector search, server-side
filtering, and inspectable schema/migration plans.
Install
bun add @absolutejs/rag @absolutejs/rag-postgres postgresUsage
import { createPostgresRAG } from '@absolutejs/rag-postgres';
import { ragPlugin } from '@absolutejs/rag';
const rag = createPostgresRAG({
connectionString: process.env.DATABASE_URL,
vector: {
provider: 'pgvector',
dimensions: 1536,
distanceMetric: 'cosine',
autoCreateExtension: true,
autoCreateSchema: true,
autoCreateTables: true,
autoCreateIndex: true,
index: { type: 'hnsw', efSearch: 100, efConstruction: 64, m: 16 }
},
schema: { schemaName: 'absolute_rag', chunkTableName: 'chunks' }
});
app.use(ragPlugin({ path: '/rag', collection: rag.collection }));Schema and migrations
Inspect the generated SQL or apply migrations explicitly:
const schemaPlan = rag.getSchemaPlan();
const migrationPlan = rag.getMigrationPlan();
await rag.applyMigrations();License
CC BY-NC 4.0
