AI SDK & Agent Framework for Next.js: what 44 makers' products chose
Among 44 makers' products built with Next.js that we know the AI SDK & agent framework of, LangChain leads: 24 of them (55%). Next come Mastra (11) and LlamaIndex (6).
Broad framework or thin SDK. Broad frameworks come with integrations for loaders, vector stores and memory, but add layers of abstraction you have to learn and debug. Thin SDKs give you a typed agent loop close to the raw API and leave the rest to you. An agent harness goes further the other way: the whole loop — file access, shell, context management — comes ready-made, for agents that work inside a workspace. A visual builder sits outside your code entirely: you assemble the agent, its tools and its retrieval on a canvas and call the result over an API, trading control and version history in your repo for speed and edits non-developers can make.
What makers on Next.js chose
| Option | Next.js products | All makers |
|---|---|---|
| 24 (55%) | 56% | |
| 11 (25%) | 20% | |
| 6 (14%) | 14% | |
| 2 (5%) | 3% | |
| 2 (5%) | 4% |
Live makers' products with a source for both: that they're built with Next.js, and what they use for AI SDK & agent framework. A product using two options counts in both; not market share. "All makers" is the option's share among every maker's product that made this decision.
Which to pick, by situation
- Your app is TypeScript and you want agents without adding a Python service
AI SDK 2 here
Mastra 11 here - You need many prebuilt connectors for models, tools and data sources
LangChain 24 here - The agent mostly retrieves and reasons over your own documents
LlamaIndex 6 here
LangChain
Broad framework24 Next.js products here (55%).
llms.txtBest forThe largest set of ready-made integrations for models, tools and data sources, in Python and JavaScript.
Trade-offLayers of abstraction make debugging harder, and the API has changed often.
“Core framework for LLM orchestration, tool binding, prompt management, and embeddings. Powers the entire AI layer across all services.”
- One interface across many model providers, so switching models, prompts and chains is cheap. 3 sources
- A large ecosystem of document loaders, chunkers, retrievers and tool integrations for RAG and agents. 3 sources
- Frequent breaking API changes force rewrites, and coding agents trained on older versions produce messy code for it. 3 sources
- Layers of abstraction make debugging slow, and many developers find calling model APIs or lighter libraries simpler. 4 sources
“Great for rapid and reliable AI development”
AI SDK & Agent FrameworkMaker says so · source ↗“Langchain was again crucial in building our browser agent which has improved a ton in terms of reliability”
AI SDK & Agent FrameworkMaker says so · source ↗“The atoms to our molecules.”
AI SDK & Agent FrameworkMaker says so · source ↗“The orchestration layer that ties Fonda's AI together. LangChain made it possible to build structured, multi-step workflows that remember context across the entire 14-step founder journey -- not just one session. Hard to build a co-founder with memory without it.”
AI SDK & Agent FrameworkMaker says so · source ↗“Gives us flexibility to work with various model providers, avoiding vendor lockin.”
AI SDK & Agent FrameworkMaker says so · source ↗“Awesome tooling to build agents”
AI SDK & Agent FrameworkMaker says so · source ↗“We use Langchain to orchestrate our entire agent framework — from the AI inbox and SDR copilots to outbound flows and long-term memory. It helps manage complex tool use, contextual reasoning, and multi-turn interactions across our platform. Langchain has been critical to scaling structured LLM workflows with modular, maintainable logic. Grateful to the Langchain team and open-source contributors (part of pour team) pushing this ecosystem forward.”
AI SDK & Agent FrameworkMaker says so · source ↗“LangGraph's graph-based architecture with nodes and edges was the key on how we coordinate complex AI workflows. We're orchestrating multi-agent conversations where each node handles specific tasks (analysis, decision-making, action execution) and edges manage the flow between them. Memory lets us build operations that maintain context across conversations, while parallel execution nodes handle multiple AI operations simultaneously. The Pydantic formatted outputs ensure type-safe data flow between nodes, and the checkpoint system with PostgreSQL persistence lets us maintain state across these graph executions, so conversations can resume seamlessly even after server restarts.”
AI SDK & Agent FrameworkMaker says so · source ↗“Core framework for LLM orchestration, tool binding, prompt management, and embeddings. Powers the entire AI layer across all services.”
AI SDK & Agent FrameworkMaker says so · source ↗“The best framework for inferencing LLM models.”
AI SDK & Agent FrameworkMaker says so · source ↗
Mastra
TypeScript framework11 Next.js products here (25%).
llms.txtCLIBest forTypeScript and Next.js apps that want agents, workflows, memory and RAG without a Python service.
Trade-offYounger ecosystem, and some enterprise features sit under a separate source-available license.
“Really like the depth of product here, very hard to make a product of this scale high quality, impressed!”
- TypeScript-first with type safety, so it fits teams whose product stack is already TypeScript. 4 sources
- Workflows, agents, memory, RAG and evals come in one package, replacing half-built in-house frameworks. 4 sources
- Workflows with rule-based, non-LLM branching feel clunky, pushing some to write their own. 1 source
- The Elastic v2 license bars offering it as a hosted service, so it is not open source in the usual sense. 1 source
Does it work inside a Next.js app? Yes. Mastra can live in a Next.js or Astro project and deploy with it; on Vercel you add @mastra/* to serverExternalPackages and drop the file-based LibSQLStore, which needs a filesystem. Mastra docs ↗
“Really like the depth of product here, very hard to make a product of this scale high quality, impressed!”
AI SDK & Agent FrameworkMaker says so · source ↗“Revolte runs a harness of specialized agents across the full dev lifecycle, so the framework underneath had to be production-grade, not a prototyping toy. Mastra's modern TypeScript stack gave us type safety, real workflow control, and structure we could actually build a platform on, without the sprawl and glue code that slows other frameworks down. A serious TypeScript foundation with clean agent orchestration is what set it apart.”
AI SDK & Agent FrameworkMaker says so · source ↗“Mastra powers our chat infrastructure and makes developing a coding agent seamless”
AI SDK & Agent FrameworkMaker says so · source ↗
LlamaIndex
Broad framework6 Next.js products here (14%).
llms.txtBest forAgents that mostly retrieve and reason over your own documents.
Trade-offLess natural for agents whose work is mostly calling external tools rather than reading data.
“We built on top of LlamaIndex's open source package to provide agentic capabilities for our application”
- Connects LLMs to whatever data sources you have, with indexing and search over large datasets. 2 sources
- LlamaParse handles complex PDFs, tables and scanned material with high-quality results. 2 sources
- Out-of-the-box chunking can split words and sentences mid-way, giving poor retrieval results. 1 source
- Some developers found it a poorly written wrapper whose tooling was quickly made irrelevant by model progress. 1 source
“We built on top of LlamaIndex's open source package to provide agentic capabilities for our application”
AI SDK & Agent FrameworkMaker says so · source ↗“We integrated LlamaIndex.ai to harness the power of AI-driven indexing and search capabilities. This tool enabled us to efficiently manage and query large datasets, making it easier for users to find the information they need within diagrams. Its advanced algorithms and ease of integration provided a seamless experience, allowing us to deliver cutting-edge AI features to our users.”
AI SDK & Agent FrameworkMaker says so · source ↗“A great open source tool that enables you to interact with your custom data.”
AI SDK & Agent FrameworkMaker says so · source ↗“The unsung hero behind Webjourney’s AI reasoning. It makes connecting structured data, embeddings, and context feel effortless.”
AI SDK & Agent FrameworkMaker says so · source ↗
CrewAI
Multi-agent orchestration2 Next.js products here (5%).
llms.txtBest forPython projects that split work across several role-based agents, like researcher, writer and reviewer.
Trade-offMulti-agent setups cost more tokens and are harder to predict than one well-prompted agent.
“We love using CrewAI for our own agents have built Kodosumi specifically to be able to work with CrewAI and easily scale up CrewAI agents.”
“Great platform for building multi agent systems”
AI SDK & Agent FrameworkMaker says so · source ↗“We love using CrewAI for our own agents have built Kodosumi specifically to be able to work with CrewAI and easily scale up CrewAI agents.”
AI SDK & Agent FrameworkMaker says so · source ↗
AI SDK
Thin SDK2 Next.js products here (5%).
Best forTypeScript agents with tool calling, multi-step loops and streaming to the UI, on any model provider.
Trade-offMemory, workflows and evals are left to you or other libraries.
“• TypeScript-first, ergonomic API with excellent Next.js integration; streaming and tool calling are rock solid. • Consistent abstractions across multiple model providers (great with OpenRouter) minimize vendor lock-in and churn. • Clear docs and examples reduce boilerplate and accelerate iteration; fewer edge-case failures in production.”
- One TypeScript API across many model providers, so swapping models needs no code rewrite. 3 sources
- Streaming and tool calling are dependable, with tight Next.js and React integration. 3 sources
- Easy to drop in but hard to make resilient: no resumable streaming after a dropped connection and no multi-device support. 2 sources
- Streaming tool-call JSON is re-parsed on every chunk, which stalls on large payloads. 1 source
Does it work outside React and Next.js? Yes. The UI hooks support React, Svelte, Vue.js, Angular and SolidJS, and AI SDK Core also runs in plain Node.js or Deno with no UI framework. AI SDK docs ↗
“• TypeScript-first, ergonomic API with excellent Next.js integration; streaming and tool calling are rock solid. • Consistent abstractions across multiple model providers (great with OpenRouter) minimize vendor lock-in and churn. • Clear docs and examples reduce boilerplate and accelerate iteration; fewer edge-case failures in production.”
AI SDK & Agent FrameworkMaker says so +1 · source ↗“AI SDK made super simple to integrate all the different models into our app. Its the best sdk for build ai apps right now.”
AI SDK & Agent FrameworkMaker says so · source ↗Also chosen, and not seen yet
Real options for AI SDK & agent framework not seen among these Next.js products yet: OpenAI Agents SDK, Pydantic AI, Claude Agent SDK, LangGraph.
Who switches, and to what
Public GitHub pull requests whose title says "X to Y", by developers in general, not only on Next.js.
- LangChain → AI SDK 4 pull requests
- AI SDK → LangChain 3 pull requests
Getting AI SDK & agent framework right
Write your first agent as a plain loop around the model's tool-calling API — it's under a hundred lines and teaches you what a framework would hide. Reach for a framework when you need the pieces it saves you from: retries, streaming, tracing, multi-step workflows. Choose by language first; a TypeScript app should not grow a Python service just for an agent.
- Reaching for a multi-agent setup before one agent with good tools works; more agents mean more tokens and more ways to fail.
- Letting the agent loop run with no step or cost cap, so a confused model calls tools until it hits the provider's rate limit.
- Adopting a broad framework's abstractions for a single model call, then fighting them when you need to see the actual prompt.
The rest of the Next.js stack
What makers' Next.js products chose for their other decisions, the most common pick for each:
- Hosting: Vercel 1,078 of 1,312
- Transactional Email: Resend 493 of 830
- Database: Supabase 171 of 382
- Payments: Stripe 288 of 359
- LLM API: OpenAI API 222 of 301
- Authentication: Clerk 176 of 211
- Web Analytics: Google Analytics 105 of 197
- Product Analytics: PostHog 123 of 168
Questions
What do most Next.js apps use for AI SDK & agent framework?
Among 44 makers' products built with Next.js that we know the AI SDK & agent framework of, LangChain leads: 24 of them (55%). Next come Mastra (11) and LlamaIndex (6).
How this is counted: a product is on Next.js when a live-product source says so (the maker, its website, a customer story or a subprocessor list), and the same for its AI SDK & agent framework. How evidence is collected.