Four silent ingestion bugs that wreck RAG retrieval quality in Laravel are examined with real code and eval results: (1) chunking that severs answers mid-sentence, causing answer@1 to fail while source hit@1 looks fine; (2) HNSW index built with vector_l2_ops while querying with cosine distance, causing Postgres to silently full-scan (worsened by Laravel 13's whereVectorSimilarTo() hardcoding <=>); (3) embedding dimensions baked into the vector(1536) column type, meaning any resize requires a full re-embed and can silently drop retrieval accuracy to 47%; (4) ingesting and querying with different embedding models, turning all distances into noise. Each bug is demonstrated with working code verified against laravel/ai v0.7.2 and pgvector.

2m read timeFrom freek.dev
Post cover image
2.4K Impressions