← All AI Engineer talks

AI Engineer World's Fair 2026

A Song of Types and Agents

Roberto Stagi· Co-founder, Ratel14:16

Read the talk

A Song of Types and Agents

As AI moves from training models to shipping applications, TypeScript offers a practical way to connect agent loops, tools, backend services and interfaces through shared code and schemas.

From a talk by Roberto Stagi

Before you start: Basic familiarity with TypeScript, backend services and model APIs will help with the shared-schema example.

Who owns the AI language throne?

If Python became the leading language on GitHub as AI expanded, why would TypeScript become its challenger? Roberto Stagi opens with a contest for the AI language throne. For years, Python was the obvious choice for AI development. ChatGPT’s release in 2022 brought AI beyond its specialist audience, expanding both the ambitions of applications and the reach of Python.

In the GitHub report Stagi cites, Python ranked first in 2024 by broad contribution activity; JavaScript still led code pushes. That distinction matters: a language can lead one measure without dominating every kind of development. TypeScript enters the story as the challenger whose strength lies in building applications.

Slide showing Python on a throne and an orange TS TypeScript emblem beneath text introducing another contender.
TypeScript emerges as the challenger to Python’s throne.

Stagi brings an application developer’s perspective to that contest. He introduces himself as Ratel’s CTO and co-founder, an EU ambassador for AI Socratic, and a longtime JavaScript developer who moved to TypeScript. His interest is where agents fit into the software that developers ship.

0:020:28
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

0:02 · section reference included

From training models to shipping applications

The relevant shift is from model infrastructure to the application layer. AI becomes something developers ship inside a product, rather than only something they train. A model call now sits alongside the interface, backend logic and other features that make an application useful. That brings AI development into territory where TypeScript already has a strong presence.

This leaves substantial work in Python. In Stagi’s division of responsibilities, research, training and GPU serving remain its domain. What changes is the language needed to build the application around those capabilities: TypeScript can cover the UI, backend and increasingly the agentic layer that calls models and coordinates work.

Stagi cites TypeScript overtaking Python in GitHub’s August 2025 ranking by monthly contributors. He juxtaposes two reports that both associated AI with the rise of their leading language—Python in 2024, then TypeScript in 2025. The 2025 report also described GitHub signups averaging more than one new developer per second over September 2024–August 2025. These are platform activity measures, not proof that coding agents caused developers to switch languages. They set up the next question: what changed in how people were building applications?

2:382:54
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

2:38 · section reference included

Coding agents create demand for TypeScript integrations

Stagi’s proposed explanation is that coding agents matured. Lovable, Claude Code, Cursor and Codex became established ways to build applications. He characterizes TypeScript as their default application language—a description of the development pattern he sees, rather than a universal rule about what these tools can generate.

Slide titled “The coding agents grew up,” listing Lovable, Claude Code, Cursor and Codex as the default way to build apps.
Coding agents grew up and became the default way to build apps.

The next link is demand for AI inside those applications. If a product is already written in TypeScript, adding an agent creates pressure for model integrations and agent tooling in the same ecosystem. Stagi describes this expansively, treating agentic features as an increasingly ordinary part of new applications. He points to Anthropic’s acquisition of Bun in December 2025 as a concrete signal of an AI lab investing in a JavaScript runtime.

But adoption does not settle the engineering choice. An application may already use TypeScript, and coding tools may make it convenient, without that alone establishing where its agent should live. The useful question becomes: what does keeping the agent in TypeScript actually buy?

5:426:00
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

5:42 · section reference included

A possible feedback loop in generated code

The first benefit is prospective. More TypeScript applications could provide more training material for future coding agents. Deeper native integrations between those agents and TypeScript tooling could also improve the quality of generated applications. Together, these changes could reinforce the initial preference for TypeScript.

Stagi presents this as an expectation, not a measured improvement in coding accuracy. Its relevance to agent development follows from his broader premise: if an agent is part of an application, improvements in the tools that build applications should benefit the agent code too.

7:387:58
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

7:38 · section reference included

The application around the model call

The next benefit is already familiar to application developers: npm supplies packages for authentication, payments, interfaces and infrastructure. Stagi calls it probably the richest package ecosystem available. The practical point is the breadth of surrounding product capabilities, rather than an ecosystem ranking.

As AI moves into applications, it must integrate with those capabilities. Building the agent in TypeScript puts it in the same package ecosystem as the rest of the product, making existing application integrations available alongside the model-facing code.

8:288:48
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

8:28 · section reference included

One language, one shared contract

TypeScript can cover the agent loop, its tools, the backend service and the UI within one codebase. Stagi contrasts this with a Python service using FastAPI or Pydantic AI alongside a separate React application. That is a common architecture, not a mandatory consequence of choosing Python, but it introduces a contract between the services that must be maintained.

ConcernShared TypeScript codebasePython service and React or Vue UI
Agent and interface codeOne languageTwo language ecosystems
Type definitionsCan be shared directlyMust stay synchronized across a boundary
Application contractShared schema can define itSeparate representations must agree

The boundary becomes especially visible in types. A Python agent and backend may have internally consistent definitions, while the frontend has another set. Changing a record means keeping both representations aligned.

Zod provides a concrete way to share that contract. Define a schema once, infer its TypeScript type, and reuse it in the backend, model-facing code and UI. For example, a proposed task can have one definition throughout the application:

typescript

import { z } from "zod";

export const ProposedTask = z.object({
  title: z.string().min(1),
  status: z.enum(["pending", "approved"]),
});

export type ProposedTask = z.infer<typeof ProposedTask>;

export function validateProposal(input: unknown) {
  const result = ProposedTask.safeParse(input);
  if (!result.success) {
    return { ok: false as const, issues: result.error.issues };
  }
  return { ok: true as const, task: result.data };
}

export function taskLabel(task: ProposedTask): string {
  return `${task.title} (${task.status})`;
}

const result = validateProposal({
  title: "Review invoice",
  status: "pending",
});

if (result.ok) {
  console.log(taskLabel(result.task));
} else {
  console.error(result.issues);
}

Here, ProposedTask supplies both runtime validation and the type consumed by taskLabel. The record remains a pending proposal; validation does not approve or execute it. Shared types do not automatically make external model output valid. Incoming data still needs to pass through the schema, and the application must handle validation failures.

9:099:28
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

9:09 · section reference included

An expanding AI ecosystem

This is the practical meaning of a type checked end to end: the same definition can connect the model-facing boundary to backend logic and interface code. Stagi then broadens the argument from shared types to the growth of TypeScript’s AI tooling.

Stagi reports that Vercel AI SDK weekly downloads rose from 1.6 million to 15.1 million in one year, roughly nine to ten times. This is his download-growth example, not a count of unique users or production applications. It supports the picture of a growing ecosystem without measuring the quality of applications built with it.

Orange growth curve from 1.6M in June 2025 to 15.1M per week in June 2026, with a source note identifying npm weekly downloads.
The TypeScript-only AI SDK’s roughly ninefold growth in one year.

The combined case joins five considerations: coding-agent preferences, one language throughout the codebase, a growing AI ecosystem, consistent types and npm’s existing application integrations. Their practical force comes from working together. A team can build agent behavior in the same environment that supplies its product dependencies and defines its application contracts.

10:4811:05
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

10:48 · section reference included

Atwood’s law reaches agents

The closing analogy comes from Jeff Atwood’s JavaScript maxim: applications that can be written in JavaScript eventually will be. Stagi follows it with a TypeScript corollary: applications that could be written in JavaScript will eventually be written in TypeScript.

Agentic applications fall into that category too. This is a rhetorical extension of the application-layer argument, not a technical inevitability: as agents become ordinary application components, they become candidates for the same languages, dependencies and development tools as the rest of the product.

11:5912:21
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

11:59 · section reference included

Models on pip, agents on npm

Stagi forecasts that TypeScript’s advantage at the application layer will widen. His packaging analogy separates the roles: a model can remain in the Python and pip ecosystem while the agent that calls it ships through npm. In that picture, Python continues to handle model and inference infrastructure, while TypeScript handles the surrounding application. The distinction describes ecosystem responsibilities, not a deployment procedure.

His recommendation follows that division: keep training in Python, but consider TypeScript for agents and applications. The warning about falling behind is directed at developers who overlook TypeScript entirely. The choice concerns how to build and maintain the product around the model—and whether its agent should share the language, packages and contracts already used by the application.

12:4313:02
Suggest correction

This note stays in this page until you copy or download it. Nothing is submitted; reloading clears the draft.

12:43 · section reference included

Resources

From the talk

Read the complete timestamped transcript
  1. 0:02

    Hello, and thank you for being here. I'm Roberto, and today I'm going to tell you this song of types and agents. Uh, basically a song that speaks about languages that fight each other to conquer what's the throne in the AI realm, and how I think that TypeScript might actually be winning this war.

  2. 0:28

    But let's start from the beginning. A few years ago, whenever someone was building, uh, in AI, they were certainly using Python. Like, there was no doubt. All the other languages were bowing to Python because, um, because of its, uh, dominion, uh, over the AI world.

  3. 0:51

    And then when in twenty twenty-two ChatGPT was released, everybody started wondering and starting understanding that AI was becoming something more, was going outside of the bubble that it lived for years and started to becoming something more ambitious.

  4. 1:14

    And together with it, Python, which was the standard language for AI, became more ambitious as well.

  5. 1:22

    And that's how in twenty twenty-four, uh, GitHub actually claim- climbed the ladder and became the most popular language on GitHub. So, you know, everybody was happy. Python finally reached the top.

  6. 1:40

    But little did they know that there was another contender for the throne, another contender that was rising to challenge the claim that Python had on the throne. And this contender, as you may have guessed by now, was indeed TypeScript.

  7. 2:01

    But before talking about this, let me present myself. My name is, uh, Roberto. I'm the CTO and co-founder of Ratel, a context layer for AI agents, and I'm also the EU ambassador for AI Socratic, a global community of AI builders meeting once per month to discuss the latest news in AI.

  8. 2:23

    I'm also a longtime JavaScript then turned TypeScript, uh, developer, and that's basically why I am, um, talking about TypeScript today. So let's begin.

  9. 2:38

    As we said, AI started moving up to the stack. It was moving from the infrastructure layer of these, um, models, machine learning, and all related ecosystem towards the application layer.

  10. 2:54

    This means that AI, uh, stopped being something that you train, and it started being something that you ship inside your application. Applications started featuring AI, started having features powered by AI, which basically means that we started having applications that think.

  11. 3:19

    And the application layer was not Python's. The application layer has been TypeScript's for pretty long time now.

  12. 3:32

    Don't get me wrong, like, I still think that Python has its own, um, application. Like, I still think that the brain of the, of the agent and all the, of all the AI world is actually still owned by Python.

  13. 3:50

    All the training, the research, the GPU serving is all Python's. Uh, has been Python's all along and it's going to be Python's for a long time yet. And, um, what's changing is actually the application layer.

  14. 4:05

    Like, few years ago, if you wanted to build something with AI built in the application, you had to use Python. But today, that's not the case anymore, and that's all, uh, the shift is about.

  15. 4:20

    TypeScript doesn't just own, you know, the UI or the back end. It started owning also the agentic layer of our application.

  16. 4:31

    And that's why in August twenty twenty-five, types three-- TypeScript actually passed Python as the most used language on GitHub. And the funny thing is that the reason that the GitHub report gave was the same.

  17. 4:48

    Like in twenty twenty-four, it said AI leads Python to top language, while in twenty twenty-five it said AI leads TypeScript as the first language. And in both cases, as you can see, the global developers, the number of global developers were surging.

  18. 5:10

    In twenty twenty, twenty twenty-five, we even have one new developer joining GitHub every second.

  19. 5:18

    So what actually changed in this year? Like, yeah, we were flooded from, like, new developers. In twenty twenty-four, these newcomers were reaching for Python or even maybe existing developers were reaching for Python, and in twenty twenty-five they reached for TypeScript instead.

  20. 5:42

    What changed between twenty twenty-four and twenty twenty-five was actually coding agents. The coding agents grew up. Like we saw established, um... We saw the players establishing themselves like Lavapo, Glo- CloudCode, Cursor, Codex.

  21. 6:00

    They became the default way to build applications. And the default way to, uh, to which these coding agents actually build the applications was TypeScript. And, you know,

  22. 6:17

    since every new app, pretty much every new app is an agent today because they ship this AI and agentic capabilities, they are hungry to embed AI inside themselves, the demand to have more AI integrations, more and more AI integrations doesn't fall onto Python, it

  23. 6:41

    falls on TypeScript. And pretty much all the tools that we use to build AI today already run on TypeScript. We even saw an AI lab acquiring a JavaScript runtime, like last December, Anthropic acquired Bun.

  24. 7:05

    But still, you know, okay, everybody us- is using TypeScript because of the coding agents, and we are having

  25. 7:15

    more and more demand to build, uh, a, to embed the AI inside TypeScript application. But does this mean that we should do it? Like, this is a fair question.

  26. 7:26

    Like, it's an honest question, and it's a question worth answering.

  27. 7:32

    And the answer, in my opinion, can be yes, like for several reasons.

  28. 7:38

    The first one is that since TypeScript is the default language for coding agents today, we can expect that they will become better and better in, in TypeScript because we are having more and more application in TypeScript, which are going to field the training of next coding agents.

  29. 7:58

    And then we are having, uh, deeper integrations and more native integrations from these coding agents towards TypeScript, and we can expect that the quality of the output in TypeScript is going to be better and better from these coding agents.

  30. 8:14

    Since we're building applications and, uh, we want to have like the highest quality of these applications, might make sense to build agents which are the new kind of applications in TypeScript.

  31. 8:28

    And also, if you use TypeScript, you're actually tapping into what is probably the richest package manager out there. NPM comes with everything, uh, pretty much everything like authentication, payments, UI, infra.

  32. 8:48

    Like it's, uh, the deepest app layer tail that there is. So

  33. 8:54

    since, again, AI is coming towards the application layer, we need to integrate with all this right now, and tapping inside NPM is a very convenient way to do that.

  34. 9:09

    Also, you have... By building in TypeScript, you can have one single language throughout all your codebase. You can have one single codebase for the whole application because you can use TypeScript for your agent loop, for the tools, for the backend service, for the UI.

  35. 9:28

    While if you use Python, you probably have to split, uh, split it at least into two services, which means, you know, one service with FastAPI, Pythantic AI, and whatever.

  36. 9:41

    And then another, um, separate React application that you need to sync betwe- between these two with a, uh, with a contract which you have to maintain and synchronize.

  37. 9:55

    And speaking of contract, with TypeScript, you can have one single consistent typing across all your ap- all your application. While if you use Python instead, you at some point will stop at a boundary because you will have your agent, maybe your backend, et cetera, with one consistent typing, and then you will have your React

  38. 10:20

    application or Vue or whatever with, um, another set of typing at which you need to synchronize between the two.

  39. 10:31

    So if you use TypeScript, you can use Zod as a single schema throughout all your application, which is very convenient. You can define the type once. You can use this type in the backend and, uh, in the model, and you can use the same type in your UI.

  40. 10:48

    One type checked end-to-end. Also, like it makes sense to build in TypeScript today, uh, also in the AI ecosystem because we are seeing a very surge in, in the AI ecosystem as well.

  41. 11:05

    Like take the Versace AI SDK, for example. You can see that in just one year it went from one point six million to fifteen point one million downloads per week, which is between nine and ten X in just one year.

  42. 11:22

    So finally, like to put everything together, in my opinion, yes, it makes sense to build AI agents in TypeScript because you have like, um, uh, you can leverage the de facto default language for coding agent.

  43. 11:37

    You can have one single language for your whole application and your whole codebase. You can tap into a fast-growing AI ecosystem. You can have consistent typing, uh, across all your application, and you can tap into the richest package manager that there is, NPM.

  44. 11:59

    So, um, you might ask, was all this unpredictable? And the answer is actually no. Someone predicted this, uh, many years ago, almost, uh, twenty years ago. Jeff Atwood said any application that can be written in JavaScript will eventually be written in JavaScript.

  45. 12:21

    And, you know, as you, as you probably know, in the last few years, we have a corollary of this that any application that could be written in JavaScript will eventually be written in TypeScript.

  46. 12:33

    And so basically, we can say that any application, even the agentic ones, will be written in TypeScript.

  47. 12:43

    And be mindful that what I showed you today is just the beginning, like we're just getting started. You can project this in a few years, and you can see that on the application layer, the difference between TypeScript and Python is actually going to widen from here.

  48. 13:02

    So, um, as I said, the model can still run on pip, but the agents, which is the application layer today, so the agent that call the models will probably ship on npm.

  49. 13:20

    So everything on the inference layer, you know, is going to be Python, but everything ver- everything else, probably all TypeScript.

  50. 13:31

    Let me leave you with one recommendation then. Um, keep training in Python. As I said, I don't see that one going away, uh, soon. But please consider building the agents and the applications in TypeScript, 'cause if you don't do that now, if you overlook TypeScript, you are probably going to fall behind.

  51. 13:56

    That was all on my side today. Um, I thank you all for, uh, your listening, and please, uh, scan the QR code for the slides. Reach out to me if you agree or if, if you disagree, if you have any feedback, and let's get in touch.

  52. 14:11

    Thank you. Bye-bye.