PostgreSQL and pgvector for AI Applications
Why I chose to keep vectors and relational data in one PostgreSQL database — and what that trade actually costs and saves.
Blog / Databases
PostgreSQL-first data design: pgvector, row-level security, migrations and keeping embeddings beside the rows they describe.
Every AI stack article assumes a dedicated vector database. I have not needed one. In Kilele Archade the vectors describe rows that already live in PostgreSQL — documents, subjects, competences — so splitting them across two systems would have bought a second security model, a second backup story and a sync problem for no capability I was using.
These notes are about that trade and the practical edges of it: picking an embedding dimension you can live with, when an index is actually worth building, and why transactions over documents and their embeddings are worth more than a marginally faster similarity search.
Why I chose to keep vectors and relational data in one PostgreSQL database — and what that trade actually costs and saves.