TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: Write JSON processor queries (jq) in natural language

38 pointsby Areibmanabout 1 year ago
Hey HN! Jaiqu is an AI agent for creating repeatable JSON transforms using jq query language syntax.<p>Jaiqu translates complex JSON structures into repeatable jq queries. jq is a command line utility built for fast, reliable JSON queries. Jaiqu takes advantage of the LLMs for both constructing jq queries as well as using feedback to fix errors&#x2F;invalid results if those queries are incorrect.<p>Writing code to parse JSON is super annoying. It usually involves manually reading huge JSON balls, parsing the keys in a language of your choice, and pulling the data manually. Also, you&#x27;re likely to run into key mismatches (i.e. source data might have &quot;customer_id&quot; as a key but my table is &quot;user_id&quot;), so you would have to write the translation dictionaries by hand.<p>This struck me as a task that was analogous to the many AI &quot;natural language to SQL&quot; editors out there. However, there were a lot of consistency issues where the LLMs would not produce functioning code. So I wrote an AI agent that does it for me.<p>It only takes two args: 1. A blob of messy JSON containing data you want 2. A JSON schema formatted in the way you want<p>Jaiqu generates a repeatable jq query that collects the data in the exact JSON schema you specify. This way, you can run this query as many times you want or save it as a config without having to prompt LLMs each and every time.<p>This tool beats the standard &quot;prompt ChatGPT for a jq query&quot; because by and large, LLMs don&#x27;t perform too well when writing DSLs like jq. Jaiqu essentially works by: 1. Fuzzy matching each key against your schema to make sure it&#x27;s available to query 2. Writing individual jq queries to fetch and transform those keys 3. Compiling each individual query into a single complex jq query. 4. Feeding back any errors or data mismatches to a &quot;self-healing&quot; loop that adjusts the queries accordingly until it works.<p>Would love to hear thoughts or feedback. This has saved our team a ton of time internally, so hopefully it can help others as well.

no comments

no comments