Back to stack index

Language

TypeScript

Dominant language for agent UIs and typed API servers.

Short answer

TypeScript is JavaScript with static types, and it is the main language for the user-facing half of open-source AI: chat interfaces, workflow builders, observability dashboards, agent frameworks for web apps and coding agents. Directory projects written mainly in TypeScript include n8n, Langfuse, LobeChat, CopilotKit, Activepieces, OpenCode and Continue. The current stable release is TypeScript 7.0.2, from August 20, 2026; the 7.0 line replaced the old compiler, written in TypeScript itself, with a native compiler written in Go, which Microsoft said builds large projects around ten times faster. TypeScript is free under the Apache 2.0 license. For people self-hosting these tools the language mostly shows up as a Node.js runtime requirement and a Docker image; for contributors, it means a single language across front end, back end and the AI SDKs from OpenAI, Anthropic, Vercel and others.

Latest stable
TypeScript 7.0.2, August 20, 2026
TypeScript GitHub
Compiler
Native, written in Go, from 7.0
Microsoft
License
Apache 2.0
TypeScript GitHub
Main AI SDKs
OpenAI, Anthropic, Vercel AI SDK, MCP SDK
Vendor docs

Updated October 21, 2026How we evaluate tools

Official site

Directory projects (7)

  • CopilotKit

    Embeds copilot-style UI and agent state into existing React products.

  • LobeChat

    Modern chat shell for running and comparing multiple models locally or via API.

  • n8n

    n8n accelerates app backends or internal tools with frameworks you can self-host.

  • Langfuse

    Open LLM engineering hub for traces, prompts, scores, and datasets.

  • ActivePieces

    ActivePieces accelerates app backends or internal tools with frameworks you can self-host.

  • OpenCode

    OpenCode pairs with local or remote models inside editors and terminals you trust.

  • Continue

    Continue pairs with local or remote models inside editors and terminals you trust.

TypeScript in open-source AI tools: why chat UIs, agents and gateways are written in it in 2026

Where TypeScript sits in an AI stack

Open-source AI projects split roughly into two halves. The model half, covering training, fine-tuning, inference engines, evaluation and data pipelines, is written in Python, C++ and Rust. The product half, covering the interfaces people use, the servers behind them, and the glue that connects models to business tools, is increasingly written in TypeScript. That split shows clearly in our directory: the inference runners are Go and C++, the RAG frameworks are Python, and the chat apps, dashboards and workflow builders are TypeScript.

TypeScript wins the product half for practical reasons. One language covers the React front end, the Node.js API, background workers and shared types between them. Streaming tokens from a model to a browser, the core interaction in every chat app, is natural in JavaScript's event model. And the hiring pool of TypeScript web developers is large.

Which directory projects use it

ProjectWhat it isTypeScript's role
n8nWorkflow automation with AI agentsEntire codebase: Node.js back end, Vue front end, custom nodes
LangfuseLLM tracing and evaluationNext.js web app and workers
LobeChatMulti-provider chat appNext.js app with a plugin system
CopilotKitIn-app copilots for React appsReact components and runtime
ActivepiecesOpen-source Zapier alternativeBack end, front end and "pieces" integrations
OpenCodeTerminal coding agentAgent core and client
ContinueCoding assistant for VS Code and JetBrainsExtension and core logic

If you want to extend one of these, you write TypeScript: an n8n custom node, an Activepieces piece, a LobeChat plugin, or a CopilotKit action.

TypeScript 7 and the native compiler

In March 2025 Microsoft announced that it was porting the TypeScript compiler from TypeScript to Go, a project codenamed Corsa. The aim was speed: type-checking a large codebase could take a minute or more, and editors slowed down on big projects. Microsoft reported that the native compiler built large codebases, including VS Code's own, about ten times faster, with lower memory use, because Go compiles to native code and runs type-checking in parallel.

TypeScript 7.0 shipped the native compiler as the standard tsc, and 7.0.2 followed on August 20, 2026. The language is the same: code that compiled on TypeScript 5.x compiles on 7 with few changes. What changed is the compiler's programmatic API. Tools that hooked into the old JavaScript-based compiler, such as some linters, documentation generators and custom transformers, needed updates, and a handful of projects pinned the 5.x line while their tooling caught up.

For AI projects, the faster compiler matters in two places. Large monorepos such as n8n and Langfuse build and type-check faster in CI. And AI coding agents, which run the type-checker after each edit to see whether their change compiled, get feedback in seconds rather than tens of seconds, which shortens every agent loop.

The main AI SDKs

SDKMaintainerUse
openaiOpenAIOfficial client for the OpenAI API
@anthropic-ai/sdkAnthropicOfficial client for Claude
@google/genaiGoogleOfficial Gemini client
ai (Vercel AI SDK)VercelOne interface for many providers, streaming UI helpers, agents
@modelcontextprotocol/sdkMCP projectBuild MCP servers and clients
@langchain/coreLangChainLangChain.js chains and agents
@mastra/coreMastraTypeScript agent framework with workflows and memory

The Vercel AI SDK is the most common choice in new open-source TypeScript AI apps because it abstracts providers and handles streaming to React with a few lines of code. Projects that want fewer dependencies call the official SDKs directly.

Typing model output

Language models return text, and text is untyped. TypeScript projects close that gap with schema libraries, most often Zod. You define the shape you expect, such as a support ticket classification with a category, priority and summary, pass the schema to the model as a structured output request, and validate the reply against it before using it. The result is a typed object the rest of the app can trust, and a clear error when the model returns something malformed. The Vercel AI SDK, the OpenAI SDK and the MCP SDK all accept Zod schemas directly.

This pattern also makes tool calling safer. When an agent asks to run a tool, its arguments are validated against the tool's schema before the code runs, which blocks a class of bugs where a model invents a parameter or passes the wrong type.

What it means for self-hosting

For someone running these tools, TypeScript mostly appears as:

  • A Node.js version requirement. Check the project's .nvmrc or engines field. Most target the current Node.js LTS line.
  • A build step. Running from source means pnpm install and pnpm build before start, which can take several minutes and a few gigabytes of memory on large projects. Docker images skip this.
  • Memory use. Node.js apps typically use a few hundred megabytes to a couple of gigabytes of memory. n8n and Langfuse workers grow with workload; set container memory limits.
  • Package supply chain. TypeScript apps pull hundreds of npm packages. Prefer official Docker images with pinned digests, and watch security advisories; npm has seen repeated malicious package campaigns.

Contributing

TypeScript projects usually follow the same layout: a monorepo managed with pnpm workspaces and Turborepo or Nx, ESLint or Biome for linting, Vitest or Jest for tests, and Playwright for browser tests. Read CONTRIBUTING.md, run the test suite before changing anything, and keep pull requests small. Many maintainers ask contributors to open an issue before large changes. AI coding agents work well on TypeScript codebases because the type-checker catches many of their mistakes immediately.

TypeScript compared with Python for AI products

ConcernTypeScriptPython
Web front endNativeNeeds a separate JS front end
Model training and researchRareStandard
Agent frameworksVercel AI SDK, Mastra, LangChain.jsLangChain, LlamaIndex, CrewAI, many more
Data and ML librariesLimitedExtensive
Type safetyBuilt inOptional type hints
Typical runtimeNode.jsCPython

Many products use both: a Python service for retrieval, evaluation or fine-tuning, and a TypeScript app for everything users touch. Dify is an example, with a Python back end and a Next.js front end.

Learning path for AI developers

If you know JavaScript, TypeScript adds a type layer you can adopt gradually: start with strict mode off, add types to function boundaries, then turn on strict checks. If you come from Python, the async model and the npm toolchain take the most adjustment. The fastest way to learn the AI side is to build a small chat app with the Vercel AI SDK, then read the source of a project like LobeChat or CopilotKit to see how larger apps structure providers, streaming and tools.

Related: JavaScript stack, Node.js stack, Next.js stack, React stack, Python stack, Stack index.

Frequently asked questions

Why are so many AI apps written in TypeScript?

Most AI products are web apps, and TypeScript runs in both the browser and the server. Teams can share types between the chat interface and the API, stream model output to the browser easily, and use mature SDKs from every major model provider. Python dominates model training and data work; TypeScript dominates the product layer.

What changed in TypeScript 7?

TypeScript 7 ships a compiler rewritten in Go, a project Microsoft announced in March 2025 under the codename Corsa. It type-checks and builds large codebases much faster and uses less memory, while keeping the language itself compatible. Some older compiler APIs used by tools changed, so certain plugins needed updates.

Do I need to know TypeScript to self-host n8n or Langfuse?

No. Both ship Docker images, and configuration happens through environment variables and web interfaces. TypeScript matters only if you want to modify the code, write custom nodes, or contribute fixes.

Is TypeScript better than Python for AI agents?

Neither is better overall. Python has more research libraries and agent frameworks. TypeScript is stronger when the agent lives inside a web product, such as an in-app copilot, and when the team already writes TypeScript. Both have official SDKs from OpenAI and Anthropic and an official MCP SDK.

Which runtime do TypeScript AI projects use?

Most run on Node.js. Some use Bun or Deno, which run TypeScript directly. Node.js can now strip type annotations and run .ts files natively for simple cases, but most projects still compile with tsc or a bundler for production.

Sources

  1. TypeScript releases
  2. A 10x faster TypeScript (Microsoft)
  3. Vercel AI SDK
  4. MCP TypeScript SDK