Example — PostgreSQL
Shared PostgreSQL storage with the pg peer dependency.
npm install pgimport { Wolbarg, postgres, openaiEmbedding } from "wolbarg";
const ctx = new Wolbarg({
organization: "prod",
storage: postgres({
connectionString: process.env.DATABASE_URL!,
schema: "wolbarg",
// maxPoolSize defaults to 20; remote TLS defaults to require
}),
embedding: openaiEmbedding({
apiKey: process.env.OPENAI_API_KEY!,
model: "text-embedding-3-small",
}),
});
await ctx.ready();