Skip to content
← All templates

AI SDK + Next.js + Prisma

AI chat on Next.js with the Vercel AI SDK v5, chat messages stored in Postgres via Prisma.

TypeScriptAuth & AIPostgres
Get the AI prompt

What you can build with it

  • Internal assistants over your own docs
  • Chat front ends for a team workflow
  • AI tools that remember past conversations

What's inside

  • AI SDK v5 chat
  • Chat messages saved with Prisma
  • Postgres via DATABASE_URL

Before you deploy

  • Set OPENAI_API_KEY as secrets with elula env secret.
  • Add a managed Postgres with elula init --database; the connection string is injected as DATABASE_URL.

Source

github.com/prisma/prisma-examples/tree/latest/orm/ai-sdk-nextjs