Skip to content
Tech News
← Back to articles

We Rewrote JSONata with AI in a Day, Saved $500K/Year

read original get JSONata Query Builder Tool → more articles
Why This Matters

By leveraging AI to rewrite JSONata in Go, Reco significantly optimized its data pipeline, achieving a 1,000x speedup and saving $500K annually. This approach demonstrates how AI-driven code reimplementation can drastically reduce costs and improve performance in large-scale data processing systems, highlighting a transformative potential for the tech industry and consumers alike.

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