Get started ​
Use the Prisma adapter when Prisma owns the PostgreSQL schema and client lifecycle.
sh
pnpm add @anvia/core @anvia/memory-prisma @prisma/clientPreview and write the memory models, then migrate and generate the client:
sh
npx @anvia/memory-prisma init
npx @anvia/memory-prisma init --write
npx prisma migrate dev --name add_anvia_memory
npx prisma generatets
import { createPrismaMemoryStore } from '@anvia/memory-prisma'
const memory = createPrismaMemoryStore(prisma)The conventional factory expects agentMemorySession, agentMemoryMessage, agentMemoryError, and $transaction on the generated client. Use PrismaMemoryStore.fromDelegates(...) when models are exposed under different names.