Pilot: Mastra and LangChain on the same research pipeline
When the same five-step pipeline runs on Mastra and on LangChain with the same model, how do tokens and time compare?
Finding
Mastra used 1.5 to 2.5 times more tokens than LangChain on the same pipeline, and LangChain finished in 25% to 45% less time. Most of the gap is in the research step. In Mastra an agent reads the full search results, which cost 21,280 input tokens on one topic. LangChain calls Tavily directly, with no LLM call. Both produced reports of similar quality.
Results
| Topic | Mastra time | LangChain time | Mastra tokens | LangChain tokens |
|---|---|---|---|---|
| The state of TypeScript AI frameworks in 2026 | 28.9 s | 21.6 s | — | — |
| How LangGraph and Mastra handle agent memory differently | 43.7 s | 25.6 s | 25,658 | 9,720 |
| Simpler topics (typical) | — | — | about 6,200 | about 3,900 |
A dash means the run did not record that number. We do not estimate missing values.
Why it matters
Framework choice is usually made on developer experience. This pilot shows it also sets a fixed cost on every task.
Method
- 01The same pipeline in both frameworks: research with Tavily, analysis, a 400-word report, a G-Eval critic, and up to 3 revisions.
- 02Both pipelines use claude-haiku-4-5.
- 03Each run records tokens and time for every step.
Limits
- Two topics and single runs, so there is no range or confidence interval.
- One model.
- In the first harness, LangChain's write step received less context than Mastra's. The framework overhead study fixes this and reruns everything under method v0.1.
Reproduce this
git clone https://github.com/sholajegede/mastra-vs-langchain.git cd mastra-vs-langchain npm install cp .env.example .env npx convex dev --once npm run web
Cite this study
Plain text
Windage Labs. (2026). Pilot: Mastra and LangChain on the same research pipeline. https://www.windagelabs.com/research/mastra-vs-langchain-pilot
BibTeX
@misc{windagelabs2026mastravslangchainpilot,
author = {{Windage Labs}},
title = {Pilot: Mastra and LangChain on the same research pipeline},
year = {2026},
url = {https://www.windagelabs.com/research/mastra-vs-langchain-pilot}
}