DEV Community

Cover image for BracketView's JQ Panel Just Got Smarter — AI-Powered Queries, Dynamic Filters & More
Jameel Shaikh
Jameel Shaikh

Posted on

BracketView's JQ Panel Just Got Smarter — AI-Powered Queries, Dynamic Filters & More

I shipped a major update to BracketView's JQ Filter panel — you can now ask AI to generate jq queries in plain English, the quick filter buttons adapt to your actual JSON data, and the whole experience feels significantly more polished.


The Problem with JQ

If you've ever worked with JSON data, you know jq is incredibly powerful. It's the Swiss Army knife of JSON transformation. But let's be honest — its syntax has a learning curve. Even experienced developers frequently reach for the docs when writing anything beyond .field or .[0].

I wanted to bridge that gap. BracketView already had a JQ Filter panel where you could write and run jq queries against your JSON data in the browser. But we kept hearing the same feedback:

"I know what I want, I just don't know how to write it in jq."

So I fixed that.


What's New

1. AI-Powered Query Generation

There's now an AI button in the filter toolbar. Click it, describe what you want in plain English, and the AI generates a valid jq filter — using your actual field names.

For example, with a dataset of programming languages, you could type:

"Get all languages where the year is greater than 2000"

And the AI generates:
[.[] | select(.year > 2000)]

It works because the AI doesn't just see your prompt — it sees your JSON structure. The API extracts a schema from your data (field names, types, nesting, array sizes) and sends it alongside your request. For small JSON, it sends the raw data. For large datasets, it sends a compact structural schema plus a sample — so the AI always understands what it's working with, regardless of file size.

2. Context-Aware Quick Filters

The old quick filter chips were static — "Identity", "Keys", "Length", "First", "Select", "Map", etc. Useful as a starting point, but generic.

Now, the quick filters adapt to your data.

Paste an array of objects with fields like name, language, and year, and you'll see chips like:

  • All name → [.[] | .name]
  • Sort by year → sort_by(.year)
  • Group by language → group_by(.language)
  • Unique language → [.[] | .language] | unique]
  • Min by year / Max by year → min_by(.year) / max_by(.year)
  • Pick fields → [.[] | {name, language, year}]

The logic is smart about which filters to suggest:

  • Number fields get Sort, Min, and Max
  • String fields get Group by and Unique — but only if the cardinality makes sense (not all unique, not all identical)
  • Boolean fields get a "Where" filter (e.g., Where active)
  • Nested arrays get Flatten suggestions
  • Fields named name, title, id, email, etc. are prioritized for extraction chips

If your JSON is a flat array of primitives (numbers, strings), you get Sort, Unique, Sum, Min, Max. If it's a top-level object, you get Keys, Values, To entries, and direct access chips for each key — with array counts shown inline.

When there's no JSON loaded or it's invalid, the panel falls back to universal generic filters.


Try It

BracketView is live at bracketview.in. Paste any JSON, switch to the JQ Filter tab, and click the AI button.

Top comments (0)