Hey everyone! Konichiwa, Khushi here (URESHIKO - learning Japanese now btw 🌸)
So this time it's Mastra - a TypeScript-native framework for building AI agents, bundling agents, tools, workflows, and memory into one toolkit instead of making you stitch together five libraries and pray.
I was exploring it and thought: let's actually build something instead of just reading about it. Spent a whole night digging in, and I built something cooool!
My Idea
You all know I love communities, so it's around communities this time.
Chat moves fast. Someone ships something incredible at 9am, and by 9:40 it's buried under meetup planning and "does anyone know a good React state library" chatter.
So what if an agent could scan through that noise and pull out the real wins — and even draft a tweet about it?
I called it Community Radar. Small idea, real use case, just vibes and curiosity 🌸
Setup
npm create mastra@latest
The CLI handles everything - a few quick questions (project name, AI provider), and you've got a working project with an example weather agent already built in.
Your src/mastra/ folder ends up with:
-
index.ts— registers everything with Mastra -
agents/weather-agent.ts— the agent itself -
tools/weather-tool.ts— a tool the agent uses to fetch weather -
workflows/weather-workflow.ts— a workflow that runs the agent -
scorers/weather-scorer.ts— evaluates the agent's output
This isn't just filler - it's a template showing the exact pattern Mastra wants: Agent (the brain) + Tool (the hands) + Workflow (the process). You copy this pattern for your own idea.
I tested the weather agent first - asked it the weather in my hometown, Buxar, Bihar, just to confirm the pipeline worked. It did. Real weather, real response.
BTW, I used Gemini API keys from Google AI Studio — free for experiments like this.
Building My Agent
Copied the shape of the weather agent and rewrote it for my own thing:
Registered it in index.ts (you have to manually wire every agent into the main Mastra setup or Studio won't know it exists — learned this the hard way when my agent didn't show up 😂).
The First Real Test
Wrote up a fake community chat log - real wins hidden in a pile of small talk, exactly like my actual community chat looks:
That's the moment this stopped feeling like "following a tutorial" and started feeling like "wait, I built something real" 🥹
Adding a Workflow (and Immediately Breaking It)
Wanted the full pattern - Agent and Workflow together — not just the easy half.
A workflow is just a recipe with numbered steps. Mine only needed one: take chat text, hand it to the agent, return whatever comes back.
First attempt:
const response = await agent.stream([{ role: 'user', content: chatText }]);
let resultText = '';
for await (const chunk of response.textStream) {
resultText += chunk;
}
return { result: resultText };
Status: Success ✅. Felt great for four seconds - until I opened the output:
Empty string. "Successfully" returned nothing. I cackled a little.
Turns out .stream() and manually collecting chunks doesn't resolve reliably inside a workflow step. Swapped to .generate(), which just hands back the full response:
const response = await agent.generate([{ role: 'user', content: chatText }]);
return { result: response.text };
New error 😵💫:
You exceeded your current quota... limit: 0, model: gemini-2.5-pro
I'd left it pointed at gemini-2.5-pro, which doesn't have a real free tier. Swapped to gemini-2.5-flash - the same lighter model that worked fine earlier:
Full pipeline, finally working, for real this time.
In Plain Terms, Community Radar Does:
- Input → community chat text (pasted manually for v1)
- Agent + Workflow → identifies the wins, summarizes them
- Output → a draft tweet ready to share
What I Learned
Build first, read docs second. By the end of one night I had something real, and a much clearer picture of what Mastra actually is - not just what the landing page said.
If you're on the fence about trying a new framework: build the small, dumb version of your idea. You'll learn more from one broken workflow than an hour of docs.
Resources
- Mastra GitHub Repo → github.com/mastra-ai/mastra
- Community Radar (my repo) → github.com/khushikumari239/community-radar
💌 Building something too? Tell me what — let's build, break things, and figure it out together 🫶
— Khushiii








