Back to Articles
AI EngineeringJavaScriptTypeScriptVercel AI SDKLangChainMastra

The JavaScript AI Tech Stack: SDKs & Frameworks (December 2025)

Frank Atukunda
Frank Atukunda
Software Engineer
December 8, 2025
5 min read
The JavaScript AI Tech Stack: SDKs & Frameworks (December 2025)

You've chosen your model. You've estimated your costs. Now you need the tools to actually ship.

The JavaScript AI ecosystem has exploded in 2025. We have production-ready frameworks, type-safe SDKs, and an industry standard for tool integrations. This post covers the first two layers: SDKs and Frameworks.


Layer 1: Provider SDKs

The foundation of any AI feature is the SDK that talks to your model provider.

OpenAI SDK (openai)

The most mature option. Excellent TypeScript support, comprehensive documentation, largest community.

import OpenAI from 'openai'
 
const openai = new OpenAI()
 
const response = await openai.chat.completions.create({
  model: 'gpt-5-mini',
  messages: [{ role: 'user', content: 'Hello!' }]
})

Features: Streaming, function calling, batch API, structured outputs, vision.

Anthropic SDK (@anthropic-ai/sdk)

Full TypeScript support with tool use and computer use capabilities. Anthropic created MCP—the industry standard for AI-tool integrations.

import Anthropic from '@anthropic-ai/sdk'
 
const anthropic = new Anthropic()
 
const response = await anthropic.messages.create({
  model: 'claude-sonnet-4-5-20251022',
  max_tokens: 1024,
  messages: [{ role: 'user', content: 'Hello!' }]
})

Google AI SDK

Two options:

  • @google/generative-ai for AI Studio (simpler)
  • @google-cloud/vertexai for Vertex AI (enterprise)

Google's strength is native multimodal—text, images, video, and audio in a single model.

OpenAI Agents SDK (@openai/agents)

New in 2025. A dedicated SDK for building multi-agent workflows.

import { Agent, run } from '@openai/agents'
 
const agent = new Agent({
  name: 'assistant',
  model: 'gpt-5-mini',
  tools: [myTool],
  instructions: 'You are a helpful assistant.'
})
 
const result = await run(agent, 'Help me with my task')

Features: Multi-agent handoffs, built-in tracing, guardrails, real-time voice via WebRTC.

When to Use Raw SDKs

  • Simple, single-provider projects
  • Maximum control over API calls
  • Learning and prototyping
  • When frameworks add unnecessary overhead

Layer 2: Frameworks

Frameworks add structure, provider abstraction, and higher-level patterns.

Vercel AI SDK

2M+ weekly npm downloads. The ecosystem leader for JavaScript AI.

The SDK provides a unified interface across providers—swap OpenAI for Anthropic with one line. Particularly strong for streaming UIs in React and Next.js.

import { generateText } from 'ai'
import { openai } from '@ai-sdk/openai'
 
const result = await generateText({
  model: openai('gpt-5-mini'),
  prompt: 'What is the capital of France?'
})

AI SDK 6 (Beta as of Dec 2025) added:

  • Agent abstraction layer (ToolLoopAgent)
  • Human-in-the-loop tool execution approval
  • Type-safe agent development
  • Stable structured output with multi-step tool calling

Note: The agent features are currently in Beta. Core streaming and generation APIs are stable.

Best for: React/Next.js apps, streaming chat UIs, provider flexibility.


LangChain.js + LangGraph

LangChain 1.0 and LangGraph 1.0 shipped in October 2025, bringing full parity with Python.

LangChain is the orchestration layer—chains, prompts, memory, tools. LangGraph adds stateful, multi-agent workflows.

LangGraph's killer features:

  • Durable execution — Agents persist through failures and resume from last state
  • Conditional branching — Dynamic routing based on LLM decisions
  • Human-in-the-loop — Pause for approval, then continue
  • Checkpointing — Rewind to previous states for debugging
  • LangGraph Studio — Visual IDE for debugging agent flows
  • LangGraph Cloud — Managed deployment and scaling

Best for: Complex multi-step agents, enterprise workflows, teams wanting built-in observability via LangSmith.

When to avoid: Simple chat apps (overkill), early learning (too much abstraction).


Mastra

TypeScript-first AI framework, Y Combinator backed, founded in 2024.

Mastra takes an all-in-one approach: agents, workflows, RAG, memory, and evaluations in a single framework.

Key features:

  • 40+ LLM providers through standard interface
  • Graph-based workflow engine with branching and parallel execution
  • MCP server support built-in
  • Built-in observability platform
  • Local development server with visual playground

Best for: Teams wanting opinionated TypeScript patterns, greenfield projects, developers who prefer batteries-included.


Which Framework Should You Use?

Streaming chat UI? → Vercel AI SDK

Multi-step agents with complex control flow? → LangChain/LangGraph

RAG + agents in one framework? → Mastra or LangChain

Maximum simplicity? → Vercel AI SDK

Built-in observability? → LangChain (LangSmith) or Mastra

TypeScript-first everything? → Mastra


🎁 Free Resource: The Tech Stack Cheat Sheet

Want a one-page reference for this entire stack? I've built a printable cheat sheet with a decision tree and code snippets.

View the AI Tech Stack Cheat Sheet →


What's Next?

You now know the SDK and framework layer of the JavaScript AI stack.

Next post: Building AI Apps: Data, Observability & Deployment — LlamaIndex, vector databases, MCP, observability tools, and deployment platforms.

Previous posts in this series:


0claps
Frank Atukunda

Frank Atukunda

Software Engineer documenting my transition to AI Engineering. Building 10x .dev to share what I learn along the way.

Share this article

Get more like this

Weekly insights on AI engineering for developers.

Comments (0)

Join the discussion

Sign in with GitHub to leave a comment and connect with other engineers.

No comments yet. Be the first to share your thoughts!