# A Song of Types and Agents

Roberto Stagi, Ratel | AI Engineer World's Fair 2026 | 14:16

Source: https://www.youtube.com/watch?v=UlFB6efYN5Q
Channel: AI Engineer (https://www.youtube.com/@aiDotEngineer). Summarised by AIE Talks.
Page: https://aietalks.com/talks/a-song-of-types-and-agents
Published: 2026-07-12
Tags: agents, coding-agents, developer-experience, team-adoption

## TL;DR
- Python still dominates model training, research, and GPU serving, while TypeScript is taking over the application and agent layers.
- Coding agents have helped make TypeScript the default language for building new AI applications, increasing demand for TypeScript integrations.
- TypeScript lets teams use one language, one codebase, shared schemas, and the large npm ecosystem across agents, back ends, and UIs.

## Summary
Roberto Stagi argues that Python and TypeScript are winning different parts of the AI stack. Python remains the language for training, research, and GPU serving. TypeScript is becoming the language for applications that embed AI, including agents. Stagi connects this shift to coding agents such as Claude Code, Cursor, and Codex, which commonly generate TypeScript applications. He gives practical reasons to use TypeScript for agents: npm covers authentication, payments, UI, and infrastructure; a team can use one language across the agent loop, tools, back end, and UI; and shared schemas such as Zod can keep types consistent. He also points to rapid growth in the Vercel AI SDK. His recommendation is to keep training models in Python while considering TypeScript for agents and applications. He expects the split between Python at the inference layer and TypeScript at the application layer to grow.

## Key ideas
### AI moved from model infrastructure into applications
[02:26](https://www.youtube.com/watch?v=UlFB6efYN5Q&t=146s)
Stagi describes AI moving up the stack. It used to focus on training models, machine learning infrastructure, and related systems. Now AI is shipped inside products as application features, creating applications that can think. He says the application layer has historically belonged to TypeScript, even though Python still owns the model side. In his view, the shift is about where AI is used, rather than Python disappearing from AI altogether.

### Python still owns the model and inference side
[03:32](https://www.youtube.com/watch?v=UlFB6efYN5Q&t=212s)
Stagi draws a boundary between the brain of an AI system and the application around it. Python remains dominant for training, research, and GPU serving, and he expects that to continue. The change is that teams no longer need Python to build every application with AI inside it. TypeScript has expanded from UI and back-end work into the agent layer, where applications call models and expose agentic features.

### Coding agents helped TypeScript pass Python on GitHub
[04:25](https://www.youtube.com/watch?v=UlFB6efYN5Q&t=265s)
Stagi points to August 2025, when TypeScript passed Python as the most-used language on GitHub. He connects this change to the growth of coding agents. Claude Code, Cursor, and Codex established themselves as common ways to build applications, and they generally produced TypeScript applications. Since many new applications now include AI or agentic capabilities, that usage creates more demand for TypeScript-based AI integrations.

### Coding agents may improve faster at TypeScript
[07:32](https://www.youtube.com/watch?v=UlFB6efYN5Q&t=452s)
Stagi says TypeScript can benefit from a feedback loop. It is already the default language for many coding agents, so more TypeScript applications can provide material for improving future coding agents. Those agents can also develop deeper, more native TypeScript integrations. If teams want high-quality generated applications, Stagi thinks it makes sense to build agents in the language where these tools are becoming strongest.

### npm connects agents to the rest of an application
[08:16](https://www.youtube.com/watch?v=UlFB6efYN5Q&t=496s)
TypeScript gives teams access to npm, which Stagi calls a very rich package manager. He names authentication, payments, UI, and infrastructure as areas covered by the ecosystem. Since agents now need to connect to ordinary application features, using npm lets developers work with those integrations from the same environment. His argument is practical: the agent is part of a product, so its language should have access to the product's surrounding systems.

### One TypeScript codebase can span the whole product
[09:14](https://www.youtube.com/watch?v=UlFB6efYN5Q&t=554s)
Stagi says a TypeScript application can use one language and one codebase for the agent loop, tools, back-end service, and UI. A Python-based setup may split the system between a service using FastAPI and Pydantic AI and a separate React application. That split requires a contract between services and ongoing synchronization. With TypeScript, the boundaries between these parts can be smaller and easier to manage.

### Shared schemas keep types consistent across the stack
[10:01](https://www.youtube.com/watch?v=UlFB6efYN5Q&t=601s)
Stagi focuses on typing as another reason to use TypeScript. A Python service and a React or Vue application can end up with separate sets of types that must be synchronized. With Zod, he says a team can define a schema once and use it in the back end, model-facing code, and UI. The same type can then be checked across the application instead of being recreated at each boundary.

### Python training and TypeScript agents will coexist
[12:48](https://www.youtube.com/watch?v=UlFB6efYN5Q&t=768s)
Stagi does not predict that Python will leave AI. He recommends continuing to train models in Python while considering TypeScript for agents and applications. His expected division is that models and inference systems will keep running in the Python ecosystem, including pip, while the agents that call those models will increasingly ship through npm. He thinks overlooking TypeScript now could leave developers behind as the application-layer gap widens.

## Notable quotes
- "The application layer was not Python's. The application layer has been TypeScript's for pretty long time now." (03:00)
- "The coding agents grew up like we saw established themselves like Claude Code, Cursor, Codex." (05:31)
- "You can use TypeScript for your agent loop, for the tools, for the back end service, for the UI." (09:14)
- "The model can still run on pip. But the agents, which is the application layer today, so the agent that called the models will probably ship on NPM." (13:08)

## Tools & references mentioned
- Python
- TypeScript
- GitHub
- ChatGPT
- Ratel
- AI Socratic
- Claude Code
- Cursor
- Codex
- Anthropic
- Bun
- npm
- FastAPI
- Pydantic AI
- React
- Vue
- Zod
- Vercel AI SDK
- Jeff Atwood

## Who should watch
- You build AI products and are deciding whether the agent layer should live in Python or TypeScript.
- Your stack crosses an agent service, a back end, and a web UI, and duplicated types or service contracts are causing maintenance work.
- You use coding agents and want to understand why TypeScript may produce better results from those tools over time.
