Uploaded April 2024 | Updated November 2026, 2 hours ago
Web Dev Roadmap for Beginners (Free!): bit.ly/DaveGrayWebDevRoadmap
Learn how to build an AI RAG application with LangChain & Next.js. This tutorial introduces LangChain and shows how to use the framework to enhance your chatbots and build RAG (retrieval augmented generation) applications with Next.js.
π Support me on Patreon β patreon.com/davegray
β Become a full-stack web dev with Zero To Mastery Courses:
- Complete Next.js Developer: bit.ly/CompNextJSDev
- Advanced React: bit.ly/AdvReactDev
- Junior to Senior Dev Roadmap: bit.ly/WebDevRoadmap-JrtoSr
π© Subscribe β bit.ly/3nGHmNn
π¬ Course Updates β https://courses.davegray.codes/
β Questions - Please post them to my Discord β discord.gg/neKghyefqh
β Buy Me A Coffee β buymeacoffee.com/davegray
π Starter Source Code Example: github.com/gitdagray/nextjs-ai-chat
π Completed Source Code Example: github.com/gitdagray/nextjs-rag-langchain
π My Next.js Videos: youtube.com/playlist?list=PL0Zuz27SZ-6Pk-QJIdGd1tGZEzy9RTgtj
π Follow Me On Social Media:
GitHub: github.com/gitdagray
Twitter: twitter.com/yesdavidgray
LinkedIn: linkedin.com/in/davidagray
Build an AI RAG Application with LangChain & Next.js
(00:00) Intro
(00:12) Welcome
(00:34) Lesson Goal
(01:03) What is RAG?
(02:17) What is LangChain?
(03:39) Source Code
(04:14) OpenAI API Key
(05:04) Dependencies
(06:35) Frontend Chat Component
(07:24) Simple Chat Example
(09:29) Ex. 1: LangChain Chat
(14:51) Ex. 2: Chat with History
(21:06) Ex. 3: Chat with Personality
(22:37) Ex. 4a: RAG Pattern Chat with JSON Object
(29:58) Ex. 4b: RAG Pattern Chat with JSON file
(32:11) Wrap-up
π Tutorial References:
π LangChain: js.langchain.com/docs/get_started/introduction
π Next.js: nextjs.org
π Vercel AI SDK: sdk.vercel.ai/docs
π OpenAI: openai.com
π shadcn/ui: ui.shadcn.com
π Next.js Light & Dark Modes: https://www.davegray.codes/posts/light-dark-mode-nextjs-app-router-tailwind
Was this tutorial about building a RAG application with LangChain & Next.js helpful? If so, please share. Let me know your thoughts in the comments.
#rag #app #langchain
Web Dev Roadmap for Beginners (Free!): bit.ly/DaveGrayWebDevRoadmap
Learn how to build an AI RAG application with LangChain & Next.js. This tutorial introduces LangChain and shows how to use the framework to enhance your chatbots and build RAG (retrieval augmented generation) applications with Next.js.
π Support me on Patreon β patreon.com/davegray
β Become a full-stack web dev with Zero To Mastery Courses:
- Complete Next.js Developer: bit.ly/CompNextJSDev
- Advanced React: bit.ly/AdvReactDev
- Junior to Senior Dev Roadmap: bit.ly/WebDevRoadmap-JrtoSr
π© Subscribe β bit.ly/3nGHmNn
π¬ Course Updates β https://courses.davegray.codes/
β Questions - Please post them to my Discord β discord.gg/neKghyefqh
β Buy Me A Coffee β buymeacoffee.com/davegray
π Starter Source Code Example: github.com/gitdagray/nextjs-ai-chat
π Completed Source Code Example: github.com/gitdagray/nextjs-rag-langchain
π My Next.js Videos: youtube.com/playlist?list=PL0Zuz27SZ-6Pk-QJIdGd1tGZEzy9RTgtj
π Follow Me On Social Media:
GitHub: github.com/gitdagray
Twitter: twitter.com/yesdavidgray
LinkedIn: linkedin.com/in/davidagray
Build an AI RAG Application with LangChain & Next.js
(00:00) Intro
(00:12) Welcome
(00:34) Lesson Goal
(01:03) What is RAG?
(02:17) What is LangChain?
(03:39) Source Code
(04:14) OpenAI API Key
(05:04) Dependencies
(06:35) Frontend Chat Component
(07:24) Simple Chat Example
(09:29) Ex. 1: LangChain Chat
(14:51) Ex. 2: Chat with History
(21:06) Ex. 3: Chat with Personality
(22:37) Ex. 4a: RAG Pattern Chat with JSON Object
(29:58) Ex. 4b: RAG Pattern Chat with JSON file
(32:11) Wrap-up
π Tutorial References:
π LangChain: js.langchain.com/docs/get_started/introduction
π Next.js: nextjs.org
π Vercel AI SDK: sdk.vercel.ai/docs
π OpenAI: openai.com
π shadcn/ui: ui.shadcn.com
π Next.js Light & Dark Modes: https://www.davegray.codes/posts/light-dark-mode-nextjs-app-router-tailwind
Was this tutorial about building a RAG application with LangChain & Next.js helpful? If so, please share. Let me know your thoughts in the comments.
#rag #app #langchain










