Oya: Open-Source Framework Cuts AI Agent Token Costs by 10x
Key Takeaways
- ▸Oya eliminates token waste in agentic loops by keeping tool outputs opaque to the model, achieving 2.3x-10x token reduction versus competing frameworks
- ▸The framework is injection-safe by design and guarantees deterministic execution through static DAG compilation, addressing both cost and reliability concerns in AI agent systems
- ▸Open-source and MIT-licensed with a drop-in Mastra API, Oya is designed for easy adoption by developers already using framework-based agent patterns
Summary
Oya, an open-source TypeScript framework, has been released to optimize AI agent execution by eliminating a fundamental inefficiency: re-feeding tool outputs back through language models. Traditional frameworks like ReAct, LangGraph, Mastra, and the Vercel AI SDK loop the model on each step, re-typing every tool result as input for the next operation. Oya instead compiles a typed plan once and executes it as a directed acyclic graph (DAG), keeping all tool outputs opaque to the model.
Benchmark tests on the real Anthropic API show Oya achieves 2.3x fewer tokens than LangGraph and nearly 10x fewer than Mastra, while delivering 3.5x faster execution. The framework maintains identical determinism across runs and is injection-safe by construction. Values flow by reference rather than through the model, eliminating both the token waste and the security vulnerabilities of re-emitting data through LLM inference.
The MIT-licensed framework is a drop-in replacement for Mastra with the same API surface, making adoption straightforward for existing projects. Developers can run public benchmarks to verify the results themselves, and migration requires minimal code changes.



