Prisma
Use Prisma as the storage adapter for memory, runs, and streams.
Install
npm install @better-agent/prisma @prisma/client prismaGenerate schema
Add the Better Agent models to your Prisma schema.
npx @better-agent/prisma generate --provider postgresqlSupported providers: postgresql, mysql, and sqlite.
Use --only when you only want some storage areas.
npx @better-agent/prisma generate --provider postgresql --only memory,runs,streamsMigrate
Run Prisma migration and client generation after updating the schema.
npx prisma migrate dev
npx prisma generateSetup
Pass your Prisma client to prismaStorage.
import { betterAgent } from "@better-agent/core";
import { prismaStorage } from "@better-agent/prisma";
import { PrismaClient } from "@prisma/client";
const prisma = new PrismaClient();
export const app = betterAgent({
storage: prismaStorage({
client: prisma,
}),
agents: [supportAgent],
});Options
| Option | Description |
|---|---|
client | Existing Prisma client instance. |
Notes
The generator updates your Prisma schema. Prisma still owns migrations, database connection settings, and client generation.
See Storage for what Better Agent stores.
Powered by Farming Labs ORM.