Building AI agents in TypeScript without standing up a Python service
Mastra is the leading open-source TypeScript framework for AI agents, offering agents, workflows, memory and evaluations that run inside an existing Next.js or Node application. Teams that must stay in Python but want comparable type safety should use pydantic-ai. Both are free and open source, and both remove the need to deploy a separate Python service purely to host an agent.
Free. 2 repositories, no paywall. Tip only if it helps.
Almost every agent tutorial assumes Python. Almost every mobile and web product I get called into is TypeScript. That gap costs real money.
It usually shows up as a second deployment target: a small Python service sitting next to the app, with its own container, its own secrets and its own on-call story, existing entirely because the agent library was written in the other language.
Sometimes that's the right call. If your team has Python depth and the agent is doing heavy retrieval or data work, a separate service is honest architecture. But if the agent is three tools and a conversation, splitting your stack to run it is a tax you're paying for nothing, and it slows down every change you make afterwards.
Mastra is the first TypeScript framework I've used that doesn't feel like a port. Agents, workflows, memory and an evaluation harness, designed to sit next to your Next.js app rather than behind it. Check the licence before you ship commercially. It isn't a plain MIT project, and for some buyers that matters more than anything technical on this page.
If you're stuck on the Python side by circumstance rather than choice, pydantic-ai is the closest thing to the TypeScript experience: typed end to end, failing at the boundary instead of three calls later. That is most of what type safety buys you in agent code anyway.
This week: find out whether your agent genuinely needs Python, or whether it needs Python because the first tutorial you read was in Python. Those are different answers.
If your product is TypeScript, start here
Most agent tutorials assume Python. Most mobile and web products do not. These two close that gap.
- mastra-ai/mastra28,039· TypeScript · Elastic-2.0
Agents, workflows, memory and evals in TypeScript, designed to sit next to a Next.js app rather than behind a Python service.
- pydantic/pydantic-ai19,936· Python · MIT
Python, but typed end to end. The closest thing to the TypeScript developer experience if you are stuck on the Python side.
Star counts are a snapshot taken 2026-09-14, not live figures. Licences are as published by each project, so check them yourself before you ship commercially.
Want the whole list in your inbox?
Every repository above, with the notes, in one email you can search later, plus a note from me whenever we publish something new on AI and where mobile development is going. That's the only trade.
Tip if it helped. Only if it helped.
The library is free and stays free. You already have it, whether or not you click anything here. If it saved you an afternoon, you can name your own amount. It goes toward the time we spend testing these so you don't have to.
You can change the amount on the next screen. Secure checkout by Stripe, and we never see your card.
Questions people actually ask
Ready to Build Your Application?
Let's discuss your project. Our team will help you build solutions that transform your business.