#77th of 18 in Chat apps
langchain-nextjs-template
Next.js routes for LangChain.js chat, agents, structured output and RAG
- Stars
- 2.6k
- License
- MIT
- Last commit
- Nov 2026
- Language
- TypeScript
2,400 on 28 Mar 20262,553 on 21 Nov 2026
From GitHub's daily star counts.
Checked on GitHub.
LangChain is hiring: 101 open roles
Overview
Five Next.js API routes that each show one LangChain.js pattern: plain chat, Zod structured output, a prebuilt LangGraph.js agent with Tavily search, and RAG as a chain and as an agent over a Supabase pgvector table. Tokens stream to the client through the AI SDK, routes run on Edge functions, and there is no auth or persistence beyond the vector table. For developers learning LangChain.js who want runnable routes to copy.
Who it is for: Developers learning LangChain.js on Next.js
Strengths
- Each pattern is one route file you can lift into your own app
- Hosted demo on Vercel
- Mock-backed integration tests run without API keys or a live database
- Supabase adapter reuses the documents table and match_documents function; no migration
Weaknesses
- No auth and no chat history persistence
- OpenAI only out of the box; other providers need code changes
- Re-ingesting the same text duplicates vectors; no dedupe
- Agent and search examples need a Tavily key
What it needs
- TypeScript, openai, langchain, langgraph, ai-sdk
- Needs openai-api-key, supabase, tavily-api-key
- GitHub template
- env example file
Also in Chat apps
See all 18| Rank | Project | Score |
|---|---|---|
| #5 | chatbotNext.js chat template with Auth.js, Postgres history and AI Gateway models | 66 out of 100 |
| #6 | boarduiReact component library for agent UIs, installed as source via CLI | 58 out of 100 |
| #8 | twitterbioSingle-form Next.js text generator streaming from Together AI | 49 out of 100 |
| #9 | gemini-chatbotNext.js chatbot template defaulting to Gemini with NextAuth and Postgres | 44 out of 100 |
| #10 | chatNuxt chat app template with GitHub auth, SQLite history and AI SDK streaming | 41 out of 100 |