A tutorial on building a RAG (Retrieval-Augmented Generation) knowledge base in Laravel 13 using text embeddings and PostgreSQL's pgvector extension. It covers creating a KnowledgeArticle model with a 1,536-dimension vector column, generating embeddings via the Laravel AI SDK's Embeddings facade, seeding FAQ articles, and using Laravel 13's whereVectorSimilarTo method for semantic search. The knowledge base is then wired into a support agent so policy questions return answers from real documentation rather than hallucinated responses.

2m read timeFrom laravel-news.com
Post cover image

Sort: