AI SDK + RAG chat (Postgres / pgvector)
What is RAG?
RAG stands for retrieval-augmented generation. Instead of hoping the model already "knows" your facts, you retrieve snippets that match the user's question and augment the prompt with that text so generation is grounded...