An AI assistant drafted this article from my project. The code, the EXPLAIN output and the design decisions come from that project, and every snippet was checked against it.
I'm building a multi-tenant AI receptionist on Laravel 13 and PostgreSQL. Every business uploads its own files: price lists, FAQs, policies. We split them into chunks, embed each chunk, and the AI agent searches them when a customer asks a question.
The search taught me three things. The most embarrassing one: my vector index had never been used.
1. 3,072 dimensions don't fit in a vector index
Our embeddings have 3,072 dimensions. That's the default size of both Gemini's gemini-embedding-001 and OpenAI's text-embedding-3-large. The column itself is no problem:
$table -> vector ( 'embedding' , 3072 ) -> nullable ( ) ;
Enter fullscreen mode
Exit fullscreen mode
The index is. pgvector can index the vector type only up to 2,000 dimensions, with HNSW and IVFFlat alike.…