Skip to content
Tech News
← Back to articles

We rewrote JSONata with AI in a day, saved $500k/year

read original get JSONata AI Toolkit → more articles
Why This Matters

By leveraging AI to rewrite JSONata in Go, Reco significantly optimized its data pipeline, reducing costs by $500,000 annually and achieving a 1,000x speedup in expression evaluation. This approach demonstrates how AI-driven code reimplementation can lead to substantial performance gains and cost savings in large-scale tech operations.

Key Takeaways

A few weeks ago, Cloudflare published “How we rebuilt Next.js with AI in one week.” One engineer and an AI model reimplemented the Next.js API surface on Vite. Cost about $1,100 in tokens.

The implementation details didn’t interest me that much (I don’t work on frontend frameworks), but the methodology did. They took the existing Next.js spec and test suite, then pointed AI at it and had it implement code until every test passed. Midway through reading, I realized we had the exact same problem - only in our case, it was with our JSON transformation pipeline.

Long story short, we took the same approach and ran with it. The result is gnata — a pure-Go implementation of JSONata 2.x. Seven hours, $400 in tokens, a 1,000x speedup on common expressions, and the start of a chain of optimizations that ended up saving us $500K/year.

An expensive language boundary

At Reco, we have a policy engine that evaluates JSONata expressions against every message in our data pipeline - billions of events, on thousands of distinct expressions. JSONata is a query and transformation language for JSON (think jq with lambda functions), which makes it ideal for enabling our researchers to write detection rules without having to directly interact with the codebase.

... continue reading