Database
The template uses Prisma 7 with PostgreSQL and the pgvector
extension (for RAG embeddings). The Prisma client connects through a driver
adapter (@prisma/adapter-pg).
Schema
The schema is split by domain in — Prisma merges every file:
Local database
The db service in ships
pgvector/pgvector:pg16, so the extension is available out of the box.
Commands
Seed
creates a demo account (demo@nova.dev)
with a subscription, credits, a conversation and an indexed document — so a
fresh clone shows a working product immediately. It is idempotent.
pgvector & RAG
DocumentChunk.embedding is a vector(1536) column. Prisma has no native
vector type, so it is declared Unsupported(...) and read/written via raw SQL
in the RAG service. An HNSW index (cosine distance) is created in the migration
for fast similarity search. The dimension matches OpenAI
text-embedding-3-small; change it in the schema and the embedding config if
you switch models.