A LangChain starter that actually fits in Vercel's free tier
Five common LLM patterns—chat, agents, RAG, structured output—packaged as a Next.js template you can deploy in minutes.

What it does This is a batteries-included starter for building LLM apps with Next.js. It wires up five common patterns—simple chat, structured JSON output via Zod schemas, web-searching agents, basic RAG with Supabase, and agentic RAG—each as a working API route you can clone and modify. Token streaming to the frontend is handled through Vercel’s AI SDK.
The interesting bit The template is deliberately built for serverless Edge functions, and the README makes a point of its bundle footprint: LangChain core clocks in at 37.32 KB compressed for the RAG use case, or under 4% of Vercel’s 1 MB free-tier limit. That’s a rare admission that infrastructure constraints matter as much as model quality.
Key highlights
- Pre-built examples for chat, structured output, agents, retrieval, and retrieval-agents
- Uses LangGraph.js for agent workflows with preconfigured helpers to reduce boilerplate
- Streaming responses via Vercel AI SDK
- Supabase vector store included, swappable for others
- Bundle analyzer pre-configured (
ANALYZE=true yarn build)
Caveats
- Requires OpenAI key to start; agents need a separate SERPAPI key
- Supabase setup is manual—database URL, private key, and a
DELETE FROM documents;cleanup step if you re-ingest - LangSmith tracing needs
LANGCHAIN_CALLBACKS_BACKGROUND=falseor traces may not finish in Edge functions
Verdict Grab this if you want to see working LangChain.js patterns in a real Next.js app router project rather than isolated docs snippets. Skip it if you’re already past the “which RAG pattern do I use?” stage and need production observability or multi-tenant auth.