A step-by-step walkthrough of building a RAG-powered AI chat agent in Laravel 12 using the new Laravel AI SDK, MongoDB Atlas Vector Search, Voyage AI embeddings, and Google Gemini. The tutorial covers setting up the project, generating and storing vector embeddings for Airbnb listings, creating a semantic search tool using the SDK's Tool interface, defining an Agent with automatic tool-calling loop handling, and wiring it all together in a controller. Key advantages highlighted include Voyage AI's asymmetric retrieval (different models for documents vs. queries), flexible embedding dimensionality, and MongoDB Atlas serving as a unified data and vector store.
Table of contents
# What we're building# Why this stack?# Setting up the foundation# The Listing Model & Embeddings# Creating the Search Tool# The Agent# The Controller# Wrapping UpSort: