Skip to content
PilotBefore method v0.1Published 10 Nov 2026

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?

Same pipeline, two routesMastrasearchagent reads allanalysisLangChainsearchanalysisThe extra LLM call sits in the research step.

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

Pilot results, as recorded in the repository
TopicMastra timeLangChain timeMastra tokensLangChain tokens
The state of TypeScript AI frameworks in 202628.9 s21.6 s——
How LangGraph and Mastra handle agent memory differently43.7 s25.6 s25,6589,720
Simpler topics (typical)——about 6,200about 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

  1. 01The same pipeline in both frameworks: research with Tavily, analysis, a 400-word report, a G-Eval critic, and up to 3 revisions.
  2. 02Both pipelines use claude-haiku-4-5.
  3. 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}
}

Data and code