Sign in

Sam Bhagwat

@calcsam.bsky.social
305 followers 351 following 71 posts

spice distributor. prev cofounder @gatsbyjs. now building mastra.ai

PostsRepliesMedia
Sam Bhagwat @calcsam.bsky.social · 24/02/2025
one more thing some people think this is how you keep score (?) it's not why we're building this, but definitely a morale boost and a reminder for all of us that great things take time
020
Sam Bhagwat @calcsam.bsky.social · 24/02/2025
made a gametime decision that since we had the spotlight we may as well cut the beta x.com/calcsam/sta...
100
Sam Bhagwat @calcsam.bsky.social · 24/02/2025
ofc folks also found the parts that didn't work quite right unclear docs, meh apis, weird ui artifacts our linear project is full of papercuts so this sprint we're sanding all the rough edges
110
Sam Bhagwat @calcsam.bsky.social · 24/02/2025
the first thing we saw was lots of excited devs people loved mastra's agent playground, the workflow api, the dev environment
110
Sam Bhagwat @calcsam.bsky.social · 24/02/2025
still catching our breath from last week here's what we learned when our typescript agent builder went viral
130
Sam Bhagwat @calcsam.bsky.social · 14/02/2025
Full blog post: mastra.ai/blog/solvin...
mastra.ai
Solving the hardest problem in computer science with LLMs
How Mastra enhances Vercel's AI SDK with agent primitives, RAG pipelines, and evaluation capabilities
010
Sam Bhagwat @calcsam.bsky.social · 14/02/2025
As an example, our workflow graph API has three main methods, .step() for branching, .then() for chaining, and .after() for merging. Every time we show it to someone building with AI, they immediately nod along. The control flow is apparent and intuitive.
110
Sam Bhagwat @calcsam.bsky.social · 14/02/2025
Even better, I can do this collaboratively on a screenshare with an engineer, so they can themselves learn the process and begin to develop better taste for APIs
100
Sam Bhagwat @calcsam.bsky.social · 14/02/2025
And that was incredibly difficult....until LLMs Now, I can describe the parameters of an API problem to Claude -- on web or in Cursor -- and ask it for help. It can access all the underlying code. It will propose five or six plausible approaches.
100
Sam Bhagwat @calcsam.bsky.social · 14/02/2025
One of the main reasons Next.js beat Gatsby was that @kylemathews and I struggled to articulate our taste around APIs in a way that was legible to others, as well as meaningfully review APIs others proposed.
100
Sam Bhagwat @calcsam.bsky.social · 14/02/2025
Left to their own devices even great engineers tend to ship overly verbose API names, create overly large options dictionaries, and overload methods in unintuitive ways.
100
Sam Bhagwat @calcsam.bsky.social · 14/02/2025
Class and function names and parameters need to be immediately intuitive Should a variable be a function parameter or part of an options object? Can you set configdefaults on a class but override them on a particular invocation? Do you want descriptive or evocative apis?
100
Sam Bhagwat @calcsam.bsky.social · 14/02/2025
so @mastra_ai is an open source typescript agent framework when you’re building a framework, you need to do a lot of API design, specifically the nouns and verbs your users use.
110
Sam Bhagwat @calcsam.bsky.social · 14/02/2025
excited to announce that we used llms to solve the hardest problem in computer science naming things
120
Sam Bhagwat @calcsam.bsky.social · 05/02/2025
please share what you build!
000
Sam Bhagwat @calcsam.bsky.social · 05/02/2025
if you're comfortable in JS you could try mastra.ai
mastra.ai
Mastra.ai
The Typescript AI framework
020
Sam Bhagwat @calcsam.bsky.social · 03/02/2025
Have you tried Mastra? github.com/mastra-ai/ma...
github.com
GitHub - mastra-ai/mastra: The TypeScript AI framework.
The TypeScript AI framework. Contribute to mastra-ai/mastra development by creating an account on GitHub.
100
Sam Bhagwat @calcsam.bsky.social · 03/02/2025
We are building Mastra for that: github.com/mastra-ai/ma...
github.com
GitHub - mastra-ai/mastra: The TypeScript AI framework.
The TypeScript AI framework. Contribute to mastra-ai/mastra development by creating an account on GitHub.
000
Sam Bhagwat @calcsam.bsky.social · 31/01/2025
thanks @libsqlhq @tursodatabase
000
Sam Bhagwat @calcsam.bsky.social · 31/01/2025
huge step forward today for @mastra_ai with a new storage layer you can persist agent messages. conversation history. tool calls. when you suspend a workflow, it persists that state too all using libsql so no local docker setup
110
Sam Bhagwat @calcsam.bsky.social · 29/01/2025
If you're interested in multi-agent orchestration, take a look at the code: github.com/mastra-ai/m... And the deployed app: mastra-eight.vercel.app/
github.com
mastra/examples/travel-app at main · mastra-ai/mastra
The TypeScript AI framework. Contribute to mastra-ai/mastra development by creating an account on GitHub.
100
Sam Bhagwat @calcsam.bsky.social · 29/01/2025
It passes the data into another agent that validates it and formats it for the user, again using a Zod schema:
110
Sam Bhagwat @calcsam.bsky.social · 29/01/2025
In order to get the agent to perform well, we needed to write rather exhaustive instructions:
100
Sam Bhagwat @calcsam.bsky.social · 29/01/2025
Tools take in defined input schemas using Zod and can call external APIs while maintaining strict typing.
110
Sam Bhagwat @calcsam.bsky.social · 29/01/2025
The first agent has detailed instructions and access to a set of tools. It generates a set of possibilities using tools provided and ranks them according to the user's preferences. It can call the tools in whatever order it needs.
100
Sam Bhagwat @calcsam.bsky.social · 29/01/2025
so everyone wants to plan their next trip with an (AI) agent now with @mastra_ai you can we just built a Travel AI that does everything a good travel agent should. input: budget and preferences. output: flights, accommodations, itinerary options how we did it:
110
Sam Bhagwat @calcsam.bsky.social · 16/12/2024
nice! if helpful github.com/mastra-ai/ma...
github.com
130
Sam Bhagwat @calcsam.bsky.social · 16/12/2024
we're building this into mastra, why?
110
Sam Bhagwat @calcsam.bsky.social · 03/12/2024
it's a 🔥🔥🔥 getting started experience for the next million AI devs
000
Sam Bhagwat @calcsam.bsky.social · 03/12/2024
also: first bits of a new `mastra init` are working. you can decide which top level objects of mastra (agents, workflows, tools) you want to start with. you can decide whether you want example code included. or more bare. you can do it interactively or with cli flags.
110
Sam Bhagwat @calcsam.bsky.social · 03/12/2024
day 10 at @mastra_ai and we are bullish on serverless clouds last week we shipped `mastra serve` which is a gamechanger. all of your agents and workflows with endpoints. and just now we got it working on @vercel. cloudflare coming next. something really special coming after that :)
250
Sam Bhagwat @calcsam.bsky.social · 03/12/2024
anyway we're working on this so please tell us why our abstractions are wrong and we are bad people github.com/mastra-ai/ma...
000
Sam Bhagwat @calcsam.bsky.social · 03/12/2024
terraform and kubernetes otoh are foxes with deep models of many types of external resources
100
Sam Bhagwat @calcsam.bsky.social · 03/12/2024
react circa 2014-2016 was this hedgehog with One Big Idea (componentization)
100
Sam Bhagwat @calcsam.bsky.social · 03/12/2024
a few different smart devtools friends have used this "react for ai" metaphor but we actually need a framework more like kubernetes or terraform
110
Sam Bhagwat @calcsam.bsky.social · 02/12/2024
these sort of GET requests between agents on different teams are gonna be the AI equivalent of Slack DMs
000
Sam Bhagwat @calcsam.bsky.social · 02/12/2024
which means the balance of agent coordination will likely happen on HTTP over REST
100
Sam Bhagwat @calcsam.bsky.social · 02/12/2024
we're also skeptical that a single agent framework instance will directly coordinate more than a two pizza team
100
Sam Bhagwat @calcsam.bsky.social · 02/12/2024
it gives you nice logging on severless clouds, makes them easy to deploy, and easy to figure out if anything weird is going on
100
Sam Bhagwat @calcsam.bsky.social · 02/12/2024
one reason we shipped `mastra serve` is that having agents live behind endpoints is a really nice affordance when you're iterating quickly
210
Sam Bhagwat @calcsam.bsky.social · 01/12/2024
...but my toolchain helps me speedrun those steps so i get to the right answer much faster in wall clock time
000
Sam Bhagwat @calcsam.bsky.social · 01/12/2024
the way my brain works i *need* to go through all the steps to arrive at the optimal solution...
100
Sam Bhagwat @calcsam.bsky.social · 01/12/2024
if you asked me why i love api design with claude so much it's probably that claude is helping me think more clearly
100
Sam Bhagwat @calcsam.bsky.social · 01/12/2024
saw this and it *immediately* felt right. except it still needs flags for the non-interactive flow. and instead of top-level project name we need directory location. so told claude that. et voila:
100
Sam Bhagwat @calcsam.bsky.social · 01/12/2024
i asked claude to rethink this using create-next-app which has a really good scaffolding experience. he (?) came back with a nice interactive flow:
100
Sam Bhagwat @calcsam.bsky.social · 01/12/2024
this is a pretty mediocre design tbh and when claude wrote the spec out it was quickly clear there would be way too many flags
100
Sam Bhagwat @calcsam.bsky.social · 01/12/2024
so i used @superwhisper to dictate my frankly pretty half baked thoughts to claude / cursor using the mastra repo as context
100
Sam Bhagwat @calcsam.bsky.social · 01/12/2024
example: we needed an upgraded `mastra init` command that scaffolds the different objects in the system
100
Sam Bhagwat @calcsam.bsky.social · 01/12/2024
okay i love pairing on api design with claude/cursor
210
Sam Bhagwat @calcsam.bsky.social · 26/11/2024
3) Contributing stuff: discord, contributing guide, code of conduct. also the first couple community PRs. be excellent to each other! 4) better docs on workflows, rag, cli, alternative providers
000