# DSPy vs Mastra

DSPy is free, with no paid plan attached. Mastra is free, with no paid plan attached.

| | DSPy | Mastra |
|---|---|---|
| Pricing | Free | Free |
| Free to start | Yes | Yes |
| Category | AI Agents & Automation | AI Agents & Automation |
| Type | Agent Frameworks (Developers) | Agent Frameworks (Developers) |
| Best for | Open-source (MIT) framework from Stanford NLP, 37k+ GitHub stars | Open-source TypeScript framework (Apache 2.0) for agents, workflows and RAG |

## FAQ

### DSPy vs Mastra: what is the difference?

DSPy is free, with no paid plan attached and is listed for open-source (MIT) framework from Stanford NLP, 37k+ GitHub stars. Mastra is free, with no paid plan attached and is listed for open-source TypeScript framework (Apache 2.0) for agents, workflows and RAG. Both sit in Agent Frameworks (Developers).

### Is DSPy or Mastra cheaper to start with?

Neither — DSPy and Mastra are both free, so the choice comes down to capability rather than cost. Both entries list what they uniquely do above.

### Which should I choose, DSPy or Mastra?

Choose DSPy if you need open-source (MIT) framework from Stanford NLP, 37k+ GitHub stars; choose Mastra if you need open-source TypeScript framework (Apache 2.0) for agents, workflows and RAG. Flocci AI Tools does not rank one above the other — it shows both feature sets side by side and lets the requirement decide.

## Related

- [DSPy](https://aitools.flocci.in/tool/dspy)
- [Mastra](https://aitools.flocci.in/tool/mastra)
- [DSPy alternatives](https://aitools.flocci.in/alternatives/dspy)
- [Mastra alternatives](https://aitools.flocci.in/alternatives/mastra)
---

Source: Flocci AI Tools — https://aitools.flocci.in/compare/dspy-vs-mastra

Facts last verified: October 2026