Skip to content
In progressMethod v0.1Started 10 Nov 2026

Framework overhead: what Mastra and LangChain add per task

For the same pipeline, model and tasks, how many tokens, dollars and seconds does each framework add, and does quality change?

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

Status

This study is running. Results publish here with the raw data and the code. Until then, this page shows the question and the method only.

Why it matters

Mastra and LangChain are the two common TypeScript choices for agent pipelines. A per-step breakdown shows where the tokens go, so each framework gets a concrete fix and not only a ranking.

Method

  1. 01Fix the unequal context in the write step that the pilot found.
  2. 02Run 30 topics across 10 categories, 3 runs each, on claude-haiku-4-5.
  3. 03Score each final report with the same G-Eval critic.
  4. 04Report the median and range for cost per task, tokens per step, wall time and score.

Data and code