Next.js template for LangChain apps
Top 22.0% on sourcepulse
This template provides a starter application for building AI-powered features using LangChain.js and Next.js. It's designed for developers looking to quickly implement common LLM use cases like chat, structured output, agents, and retrieval-augmented generation (RAG) within a Next.js application, leveraging Vercel's AI SDK for token streaming and LangGraph.js for agentic workflows.
How It Works
The template showcases several LangChain.js patterns, including simple chat with token streaming via Vercel's AI SDK, structured output generation using Zod schemas and OpenAI Functions, and multi-step reasoning with agents built on LangGraph.js. Retrieval Augmented Generation (RAG) examples are demonstrated using Supabase as a vector store, with options to swap for other supported vector stores. LangChain Expression Language (LCEL) is used for composing chains, enabling flexible integration of various LangChain modules.
Quick Start & Requirements
yarn
yarn dev
Highlighted Details
ANALYZE=true yarn build
.Maintenance & Community
Licensing & Compatibility
Limitations & Caveats
The retrieval examples use Supabase by default; swapping vector stores requires code modifications in specific API routes. Re-ingesting documents without clearing the vector store can lead to duplicates.
4 months ago
1+ week