<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>ajq — semantic jq for JSON streams on ajq — semantic jq</title><link>https://ricardocabral.github.io/ajq/</link><description>Recent content in ajq — semantic jq for JSON streams on ajq — semantic jq</description><generator>Hugo</generator><language>en-us</language><atom:link href="https://ricardocabral.github.io/ajq/index.xml" rel="self" type="application/rss+xml"/><item><title>Your first ajq pipeline</title><link>https://ricardocabral.github.io/ajq/docs/tutorials/first-pipeline/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/tutorials/first-pipeline/</guid><description>&lt;p&gt;Run a real jq query through ajq. You&amp;rsquo;ll process a small JSON document, filter it, and
confirm ajq matches jq for ordinary queries. No model, API key, or configuration.&lt;/p&gt;
&lt;p&gt;Time: &lt;strong&gt;5 minutes&lt;/strong&gt;. Requires ajq on your &lt;code&gt;PATH&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="step-1--get-ajq"&gt;Step 1 — Get ajq&lt;/h2&gt;
&lt;p&gt;Use the checksum-verifying install script, a manual release download, or build from source
(see &lt;a href="../../how-to/install/"&gt;Install ajq&lt;/a&gt; for details):&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -fsSL https://raw.githubusercontent.com/ricardocabral/ajq/main/scripts/install.sh &lt;span class="p"&gt;|&lt;/span&gt; sh
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Check that it works:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ajq --version
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This tutorial uses only deterministic jq, so there&amp;rsquo;s nothing else to set up — no model
download, no API key.&lt;/p&gt;</description></item><item><title>Command-line interface</title><link>https://ricardocabral.github.io/ajq/docs/reference/cli/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/reference/cli/</guid><description>&lt;h2 id="synopsis"&gt;Synopsis&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ajq [query] [flags]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ajq [command]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;ajq reads input from standard input, applies one jq/semantic &lt;code&gt;query&lt;/code&gt;, and writes results
to standard output. Errors are written to standard error and produce a non-zero exit code.&lt;/p&gt;
&lt;p&gt;&lt;code&gt;query&lt;/code&gt; is a single argument. ajq desugars &lt;code&gt;=~&lt;/code&gt;/&lt;code&gt;!~&lt;/code&gt; to &lt;code&gt;sem_match(...)&lt;/code&gt;, parses with
&lt;a href="https://github.com/itchyny/gojq"&gt;gojq&lt;/a&gt;, and executes through the selected backend only
when semantic operators require one.&lt;/p&gt;
&lt;h2 id="global-flags"&gt;Global flags&lt;/h2&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Flag&lt;/th&gt;
					&lt;th&gt;Short&lt;/th&gt;
					&lt;th&gt;Description&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--backend &amp;lt;name&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;/td&gt;
					&lt;td&gt;Select the semantic backend: &lt;code&gt;anthropic&lt;/code&gt;, &lt;code&gt;local&lt;/code&gt;, &lt;code&gt;mock&lt;/code&gt;, &lt;code&gt;ollama&lt;/code&gt;, &lt;code&gt;openai&lt;/code&gt;, or &lt;code&gt;openrouter&lt;/code&gt;.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--base-url &amp;lt;url&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;/td&gt;
					&lt;td&gt;Set the HTTP base URL for backends that use one (&lt;code&gt;local&lt;/code&gt;, &lt;code&gt;ollama&lt;/code&gt;, &lt;code&gt;openai&lt;/code&gt;, &lt;code&gt;openrouter&lt;/code&gt;). For &lt;code&gt;openai&lt;/code&gt;/&lt;code&gt;openrouter&lt;/code&gt;, custom URLs must use HTTPS unless the host is loopback (&lt;code&gt;127.0.0.1&lt;/code&gt;, &lt;code&gt;localhost&lt;/code&gt;, or &lt;code&gt;[::1]&lt;/code&gt;).&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--backend-concurrency &amp;lt;N&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;/td&gt;
					&lt;td&gt;Maximum in-flight semantic requests in one provider batch. Default &lt;code&gt;1&lt;/code&gt;; maximum &lt;code&gt;2&lt;/code&gt; for OpenAI-compatible/Anthropic and &lt;code&gt;4&lt;/code&gt; for Ollama. Must be positive when set.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--cloud&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;/td&gt;
					&lt;td&gt;Select the Anthropic cloud backend; equivalent to &lt;code&gt;--backend anthropic&lt;/code&gt;.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--compact-output&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;-c&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Emit compact JSON output.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--exit-status&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;-e&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Set the exit status based on the last output value.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--explain&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;/td&gt;
					&lt;td&gt;Print the deterministic/semantic execution plan and exit without executing the query.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--max-calls &amp;lt;N&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;/td&gt;
					&lt;td&gt;Maximum post-dedup backend judgements before aborting; &lt;code&gt;0&lt;/code&gt; means unlimited. Paid backends default to &lt;code&gt;100&lt;/code&gt;; local/Ollama/mock default to unlimited.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--model &amp;lt;id-or-alias&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;/td&gt;
					&lt;td&gt;Semantic model id or alias for the selected backend.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--no-cache&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;/td&gt;
					&lt;td&gt;Disable persistent on-disk judgement cache reads and writes for this run.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--null-input&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;-n&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Use a single &lt;code&gt;null&lt;/code&gt; input value instead of reading stdin.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--raw-input&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;-R&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Read each input line as a string.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--raw-output&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;-r&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Emit strings without JSON quoting.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--stats&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;/td&gt;
					&lt;td&gt;Print run statistics to stderr after a successful run.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--stream&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;/td&gt;
					&lt;td&gt;Run supported semantic queries inline for low-latency frame output instead of window batching. Does not change backend, model, cache identity, or &lt;code&gt;--max-calls&lt;/code&gt;; pure-jq and planner-required inline queries retain their existing behavior.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--window-bytes &amp;lt;N&amp;gt;&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;/td&gt;
					&lt;td&gt;Maximum source bytes per supported three-phase semantic window; positive integer, default &lt;code&gt;262144&lt;/code&gt;. Has no execution effect for pure-jq or inline queries, including &lt;code&gt;--stream&lt;/code&gt;.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--version&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;-v&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Print the version and exit.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;--help&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;-h&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Print usage and exit.&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;See &lt;a href="../io-modes/"&gt;Input and output modes&lt;/a&gt; for framing and formatting details, &lt;a href="../backends/"&gt;Backends&lt;/a&gt;
for backend-specific defaults, and &lt;a href="../configuration/"&gt;Configuration&lt;/a&gt; for env/config
precedence.&lt;/p&gt;</description></item><item><title>Install ajq</title><link>https://ricardocabral.github.io/ajq/docs/how-to/install/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/install/</guid><description>&lt;p&gt;ajq is a single Go binary. Pure jq queries work immediately after the binary is on your
&lt;code&gt;PATH&lt;/code&gt;. Semantic queries need an explicitly selected backend such as &lt;code&gt;mock&lt;/code&gt;, &lt;code&gt;local&lt;/code&gt;,
&lt;code&gt;ollama&lt;/code&gt;, &lt;code&gt;openai&lt;/code&gt;, &lt;code&gt;openrouter&lt;/code&gt;, or &lt;code&gt;--cloud&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="install-with-the-script"&gt;Install with the script&lt;/h2&gt;
&lt;p&gt;The install script downloads the matching release archive for your OS/architecture,
verifies it against &lt;code&gt;checksums.txt&lt;/code&gt;, and installs without sudo into &lt;code&gt;~/.local/bin&lt;/code&gt; (or
&lt;code&gt;$AJQ_INSTALL_DIR&lt;/code&gt;).&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;curl -fsSL https://raw.githubusercontent.com/ricardocabral/ajq/main/scripts/install.sh &lt;span class="p"&gt;|&lt;/span&gt; sh
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Pin a version or install directory if needed:&lt;/p&gt;</description></item><item><title>Split execution</title><link>https://ricardocabral.github.io/ajq/docs/explanation/split-execution/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/explanation/split-execution/</guid><description>&lt;h2 id="the-observation"&gt;The observation&lt;/h2&gt;
&lt;p&gt;A real-world &amp;ldquo;AI data&amp;rdquo; query is mostly &lt;em&gt;not&lt;/em&gt; fuzzy. Consider triaging support tickets:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat data.json | ajq --backend local &amp;#39;.users[] | select(.feedback =~ &amp;#34;angry/frustrated&amp;#34;) | .id&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └────────┬───────┘ └────────────┬────────────┘ └┬┘
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; deterministic path semantic predicate proj
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; (pure gojq) (LLM, per value) (pure gojq)
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Iterating the array, projecting &lt;code&gt;.id&lt;/code&gt;, shaping the output — all of that is exact,
mechanical work that &lt;code&gt;jq&lt;/code&gt; already does perfectly. Only one operator, &lt;code&gt;=~&lt;/code&gt;, needs
judgement. The insight behind ajq is to treat that asymmetry as a first-class execution
strategy: &lt;strong&gt;run the deterministic majority through a real jq engine, and call a model only
for the fuzzy operators, on the smallest possible slices of data.&lt;/strong&gt;&lt;/p&gt;</description></item><item><title>See how ajq plans a semantic query</title><link>https://ricardocabral.github.io/ajq/docs/tutorials/explain-semantic-plan/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/tutorials/explain-semantic-plan/</guid><description>&lt;p&gt;Write a fuzzy match and inspect the plan. &lt;code&gt;--explain&lt;/code&gt; does not contact a model, so you can
inspect and cost any query before running it for real.&lt;/p&gt;
&lt;p&gt;Requires ajq on your &lt;code&gt;PATH&lt;/code&gt; (see &lt;a href="../../how-to/install/"&gt;Install ajq&lt;/a&gt;).&lt;/p&gt;
&lt;h2 id="step-1--write-a-fuzzy-predicate"&gt;Step 1 — Write a fuzzy predicate&lt;/h2&gt;
&lt;p&gt;Ordinary jq can test text with &lt;code&gt;test()&lt;/code&gt; or &lt;code&gt;==&lt;/code&gt;, but only &lt;em&gt;literally&lt;/em&gt;. ajq adds a fuzzy
operator, &lt;code&gt;=~&lt;/code&gt;, that asks a model &amp;ldquo;does this value match this description?&amp;rdquo;. Here&amp;rsquo;s a
stream of three messages, and a query that keeps the ones that read as &lt;em&gt;urgent&lt;/em&gt;:&lt;/p&gt;</description></item><item><title>The determinism contract</title><link>https://ricardocabral.github.io/ajq/docs/explanation/determinism/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/explanation/determinism/</guid><description>&lt;p&gt;ajq separates deterministic structure from semantic judgement.&lt;/p&gt;
&lt;h2 id="the-contract"&gt;The contract&lt;/h2&gt;
&lt;blockquote&gt;
&lt;p&gt;The deterministic pipeline is &lt;strong&gt;byte-reproducible&lt;/strong&gt;. Semantic judgements are
&lt;strong&gt;structurally&lt;/strong&gt; guaranteed, but their values are model- and cache-dependent.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Those are different promises.&lt;/p&gt;
&lt;h3 id="deterministic-parts-are-byte-reproducible"&gt;Deterministic parts are byte-reproducible&lt;/h3&gt;
&lt;p&gt;Every part of a query that is not a semantic operator runs through pure gojq. Given the
same input, it produces the same output bytes. There is no model, no sampling, and no
network in that path.&lt;/p&gt;</description></item><item><title>Input and output modes</title><link>https://ricardocabral.github.io/ajq/docs/reference/io-modes/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/reference/io-modes/</guid><description>&lt;h2 id="input-framing"&gt;Input framing&lt;/h2&gt;
&lt;p&gt;ajq selects an input framing based on flags and the shape of stdin.&lt;/p&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Mode&lt;/th&gt;
					&lt;th&gt;Flag&lt;/th&gt;
					&lt;th&gt;Behavior&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;Auto (default)&lt;/td&gt;
					&lt;td&gt;—&lt;/td&gt;
					&lt;td&gt;Auto-detects a single JSON value or a stream of top-level / NDJSON JSON values.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Null input&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;-n&lt;/code&gt;, &lt;code&gt;--null-input&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Ignores stdin; supplies one &lt;code&gt;null&lt;/code&gt; input frame.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;Raw input&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;-R&lt;/code&gt;, &lt;code&gt;--raw-input&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Reads each stdin line as a string, excluding the line terminator. &lt;code&gt;.&lt;/code&gt; is the line.&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;In the default mode, a stream of multiple top-level JSON values (whitespace- or
newline-separated, i.e. NDJSON/JSON Lines) is framed independently, with no whole-stream
buffering. Pure-jq and planner-required interleaved semantic queries execute and emit one
frame at a time. Supported three-phase semantic queries instead group complete frames into
configured byte-budgeted windows, resolve each window once, then emit their frames in
original order. The window retains only its frames plus bounded framing lookahead; a record
larger than the budget forms one oversized window and is never split. This still allows
inputs larger than available memory.&lt;/p&gt;</description></item><item><title>Make ajq available to a coding agent</title><link>https://ricardocabral.github.io/ajq/docs/how-to/make-ajq-available-to-coding-agents/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/make-ajq-available-to-coding-agents/</guid><description>&lt;p&gt;Use this guide when a team wants its coding agents to consider ajq before writing a
bespoke JSON-processing script. It assumes ajq is installed for the environment where the
agent runs and that the team already has a project-instruction mechanism its agents read.&lt;/p&gt;
&lt;h2 id="1-install-ajq-where-the-agent-can-execute-it"&gt;1. Install ajq where the agent can execute it&lt;/h2&gt;
&lt;p&gt;Install ajq in the same execution environment as the coding agent, then verify that the
binary is visible on that environment&amp;rsquo;s &lt;code&gt;PATH&lt;/code&gt;:&lt;/p&gt;</description></item><item><title>Process an NDJSON stream</title><link>https://ricardocabral.github.io/ajq/docs/how-to/process-ndjson/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/process-ndjson/</guid><description>&lt;p&gt;ajq auto-detects input framing. The common shapes:&lt;/p&gt;
&lt;h2 id="single-json-value"&gt;Single JSON value&lt;/h2&gt;
&lt;p&gt;A single top-level JSON value is processed as one input frame:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;{&amp;#34;a&amp;#34;:1}\n&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; ajq -c &lt;span class="s1"&gt;&amp;#39;.a + 1&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# 2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="ndjson--json-lines"&gt;NDJSON / JSON Lines&lt;/h2&gt;
&lt;p&gt;A stream of top-level JSON values (one per line, or concatenated) is processed &lt;strong&gt;one frame
at a time&lt;/strong&gt; — each value flows through the query independently, and results are emitted as
they&amp;rsquo;re produced:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;{&amp;#34;a&amp;#34;:1}\n{&amp;#34;a&amp;#34;:2}\n&amp;#39;&lt;/span&gt; &lt;span class="p"&gt;|&lt;/span&gt; ajq -c &lt;span class="s1"&gt;&amp;#39;.a, (.a + 10)&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# 1&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# 11&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# 2&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# 12&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There&amp;rsquo;s no whole-stream buffering in this mode, so it handles inputs larger than memory.&lt;/p&gt;</description></item><item><title>Filter JSON by meaning</title><link>https://ricardocabral.github.io/ajq/docs/how-to/filter-json-by-meaning/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/filter-json-by-meaning/</guid><description>&lt;p&gt;Use this when exact string matching is too brittle: support tickets that say the same
thing in different words, log messages that imply the same failure, or records where the
field name is known but the wording is messy.&lt;/p&gt;
&lt;p&gt;ajq keeps the surrounding jq pipeline deterministic. Only the explicit semantic predicate
(&lt;code&gt;=~&lt;/code&gt;, &lt;code&gt;!~&lt;/code&gt;, or &lt;code&gt;sem_match&lt;/code&gt;) asks a backend for a judgement.&lt;/p&gt;
&lt;h2 id="try-the-query-with-no-network"&gt;Try the query with no network&lt;/h2&gt;
&lt;p&gt;The mock backend is deterministic and in-process, so it needs no model, network, or API
key. It is useful for checking the jq shape before paying for model calls:&lt;/p&gt;</description></item><item><title>Use ajq with other data formats</title><link>https://ricardocabral.github.io/ajq/docs/how-to/use-other-data-formats/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/use-other-data-formats/</guid><description>&lt;p&gt;ajq&amp;rsquo;s core input modes stay small on purpose: JSON, NDJSON, raw strings, and
null input. When the source data is another format, put a format adapter before
ajq and let ajq work on the JSON it emits.&lt;/p&gt;
&lt;p&gt;This keeps pure jq-compatible ajq pipelines deterministic while still letting
you use the existing jq ecosystem around it. Tools such as &lt;code&gt;jc&lt;/code&gt;, &lt;code&gt;yq&lt;/code&gt;/&lt;code&gt;xq&lt;/code&gt;, and
&lt;code&gt;fq&lt;/code&gt; are commonly used alongside jq for this kind of conversion.&lt;/p&gt;</description></item><item><title>Write a semantic filter</title><link>https://ricardocabral.github.io/ajq/docs/how-to/semantic-filter/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/semantic-filter/</guid><description>&lt;p&gt;Use a semantic filter when literal matching with &lt;code&gt;test()&lt;/code&gt; or &lt;code&gt;==&lt;/code&gt; is too brittle. The
examples below use &lt;code&gt;--backend mock&lt;/code&gt; so you can verify the command shape without a model or
API key; switch to &lt;code&gt;--backend local&lt;/code&gt;, &lt;code&gt;--cloud&lt;/code&gt;, or another backend for real judgement.&lt;/p&gt;
&lt;h2 id="fuzzy-match-with-"&gt;Fuzzy match with &lt;code&gt;=~&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;The &lt;code&gt;=~&lt;/code&gt; operator asks the backend whether a value matches a description. Use it inside
&lt;code&gt;select&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;[{&amp;#34;id&amp;#34;:1,&amp;#34;feedback&amp;#34;:&amp;#34;urgent&amp;#34;},{&amp;#34;id&amp;#34;:2,&amp;#34;feedback&amp;#34;:&amp;#34;other&amp;#34;}]&amp;#39;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;|&lt;/span&gt; ajq --backend mock -c &lt;span class="s1"&gt;&amp;#39;.[] | select(.feedback =~ &amp;#34;urgent&amp;#34;) | .id&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Output with the mock backend:&lt;/p&gt;</description></item><item><title>Semantic functions</title><link>https://ricardocabral.github.io/ajq/docs/reference/semantic-functions/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/reference/semantic-functions/</guid><description>&lt;p&gt;Semantic operators are registered as jq functions, so gojq parses them inside ordinary jq
constructs. ajq adds only the &lt;code&gt;=~&lt;/code&gt; and &lt;code&gt;!~&lt;/code&gt; surface sugar before parsing.&lt;/p&gt;
&lt;h2 id="function-vocabulary"&gt;Function vocabulary&lt;/h2&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Function&lt;/th&gt;
					&lt;th&gt;Form&lt;/th&gt;
					&lt;th&gt;Kind&lt;/th&gt;
					&lt;th&gt;Returns&lt;/th&gt;
					&lt;th&gt;Execution status&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;sem_match&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;sem_match(value; &amp;quot;spec&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;predicate&lt;/td&gt;
					&lt;td&gt;boolean&lt;/td&gt;
					&lt;td&gt;Shipped&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;sem_classify&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;sem_classify(value; &amp;quot;a&amp;quot;; &amp;quot;b&amp;quot;; …)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;bounded value&lt;/td&gt;
					&lt;td&gt;one label from the given labels&lt;/td&gt;
					&lt;td&gt;Shipped&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;sem_extract&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;sem_extract(value; &amp;quot;what&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;unbounded value&lt;/td&gt;
					&lt;td&gt;string&lt;/td&gt;
					&lt;td&gt;Limited: supported only in gated/interleaved fallback contexts&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;sem_score&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;sem_score(value; &amp;quot;spec&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;unbounded value&lt;/td&gt;
					&lt;td&gt;number&lt;/td&gt;
					&lt;td&gt;Limited: supported in &lt;code&gt;sort_by(...)&lt;/code&gt; three-phase placeholder mode and in gated/interleaved fallback contexts&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;sem_norm&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;sem_norm(value; &amp;quot;canonicalization spec&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;unbounded value&lt;/td&gt;
					&lt;td&gt;string&lt;/td&gt;
					&lt;td&gt;Limited: supported in &lt;code&gt;group_by(...)&lt;/code&gt; three-phase placeholder mode and in gated/interleaved fallback contexts&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;sem_redact&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;sem_redact(value; &amp;quot;redaction spec&amp;quot;)&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;unbounded value&lt;/td&gt;
					&lt;td&gt;string&lt;/td&gt;
					&lt;td&gt;Limited: supported only in gated/interleaved fallback contexts&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;The &lt;strong&gt;spec&lt;/strong&gt; is a literal string in the query. Stream &lt;strong&gt;data&lt;/strong&gt; is structurally fenced by
the selected backend&amp;rsquo;s output constraints.&lt;/p&gt;</description></item><item><title>The three-phase executor</title><link>https://ricardocabral.github.io/ajq/docs/explanation/three-phase-executor/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/explanation/three-phase-executor/</guid><description>&lt;p&gt;ajq runs supported semantic queries in three phases. For NDJSON and raw streams, the
unit of work is a bounded window of complete frames rather than the complete stream.&lt;/p&gt;
&lt;h2 id="the-three-phases"&gt;The three phases&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Phase 1 HARVEST pure gojq run; semantic ops in COLLECT mode gather every
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; (op, spec, value) they observe. Permissive returns.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Phase 2 RESOLVE dedup collected values, consult/write the judgement cache,
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; and resolve misses through the selected backend.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Phase 3 EXECUTE pure gojq run; semantic ops in LOOKUP mode return resolved
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; values from cache. Deterministic given those cached values.
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Phases 1 and 3 are pure gojq. Phase 2 is the isolated semantic boundary: it deduplicates,
checks cache identity, and calls the backend only for misses.&lt;/p&gt;</description></item><item><title>--explain output</title><link>https://ricardocabral.github.io/ajq/docs/reference/explain-output/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/reference/explain-output/</guid><description>&lt;p&gt;&lt;code&gt;--explain&lt;/code&gt; prints a stable plan report and exits without executing the query. It does not
contact a provider or local model.&lt;/p&gt;
&lt;h2 id="pure-jq-report"&gt;Pure-jq report&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ajq explain v1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;query: &amp;#34;.users[] | select(.active) | .name&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;execution: pure-jq deterministic
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;deterministic: yes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;model_calls: 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;backend_calls: 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;byte_reproducible: yes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;stdin: ignored
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Field&lt;/th&gt;
					&lt;th&gt;Meaning&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;query&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;The query as parsed.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;execution&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;pure-jq deterministic&lt;/code&gt; — no semantic call sites.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;deterministic&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;yes&lt;/code&gt;.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;model_calls&lt;/code&gt; / &lt;code&gt;backend_calls&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;0&lt;/code&gt;.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;byte_reproducible&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;yes&lt;/code&gt;.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;stdin&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;ignored&lt;/code&gt; — pure-jq explain does not read input.&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="semantic-report"&gt;Semantic report&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ajq explain v1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;query: &amp;#34;.[] | select(sem_match(.msg; \&amp;#34;urgent\&amp;#34;)) | .msg&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;execution: semantic split plan
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;deterministic: no
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;model_calls: input-dependent
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;backend_calls: input-dependent
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;byte_reproducible: cache-dependent
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;stdin: harvested for estimates
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;planned_call_sites: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;semantic_predicates: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;semantic_values: 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;estimates:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; estimate_status: available
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; static_call_sites: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; input_frames: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; harvested_judgements: 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; post_dedup_judgements: 2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; mock_judge_batches: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; over_harvest_bound: post_dedup_judgements == mock distinct judgements; may be a safe superset of execute-needed judgements
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;subgraphs:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; deterministic: jq outside semantic call sites
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; semantic: 1 planned call site(s)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;semantic_plan:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - call_id: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; op: &amp;#34;sem_match&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; kind: &amp;#34;predicate&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; value_expr: &amp;#34;.msg&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; specs: [&amp;#34;urgent&amp;#34;]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; source_range: 13:38
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; gated: n/a
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; execution: 3-phase
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; subgraph: semantic
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="header-fields"&gt;Header fields&lt;/h3&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Field&lt;/th&gt;
					&lt;th&gt;Meaning&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;execution&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;semantic split plan&lt;/code&gt; — the query has semantic call sites.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;deterministic&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;no&lt;/code&gt;.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;model_calls&lt;/code&gt; / &lt;code&gt;backend_calls&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;input-dependent&lt;/code&gt;.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;byte_reproducible&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;cache-dependent&lt;/code&gt; — deterministic phases are byte-reproducible; semantic answers depend on backend/cache state.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;stdin&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;harvested for estimates&lt;/code&gt; when valid stdin is used for an estimate. With &lt;code&gt;--stream&lt;/code&gt; on a supported plan, &lt;code&gt;not harvested&lt;/code&gt;: inline execution has no cross-frame harvest estimate and explain leaves stdin untouched.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;planned_call_sites&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Total semantic call sites found in the static plan.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;semantic_predicates&lt;/code&gt; / &lt;code&gt;semantic_values&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Counts of predicate-kind and value-kind ops.&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;h3 id="estimates-block"&gt;&lt;code&gt;estimates&lt;/code&gt; block&lt;/h3&gt;
&lt;p&gt;Present when valid stdin was supplied and the mock harvest path can estimate the query.&lt;/p&gt;</description></item><item><title>Architecture</title><link>https://ricardocabral.github.io/ajq/docs/explanation/architecture/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/explanation/architecture/</guid><description>&lt;p&gt;ajq is a small pipeline of components.&lt;/p&gt;
&lt;h2 id="data-flow"&gt;Data flow&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;stdin → [Reader/Framer] → [Desugar] → [gojq.Parse] → [Planner] ──→ [Explain]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; [3-phase Executor]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├─ gojq (deterministic)
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └─ Semantic Executor → [Backend iface]
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├─ mock
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├─ local daemon
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├─ ollama
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├─ openai / openrouter
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └─ anthropic cloud
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;[Grammar/Schema builder] → GBNF / json_schema ─────────────────────────────┘
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;stdout ← [Assembler / schema-invariance guard]
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="the-components"&gt;The components&lt;/h2&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Component&lt;/th&gt;
					&lt;th&gt;Responsibility&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Reader / Framer&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;Stream framing: single JSON, NDJSON, and raw lines (awk-mode). Supported three-phase semantic input is grouped into complete-frame byte-budgeted windows; pure-jq and interleaved paths remain streaming.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Desugar&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;Rewrites &lt;code&gt;=~&lt;/code&gt; / &lt;code&gt;!~&lt;/code&gt; into &lt;code&gt;sem_match&lt;/code&gt; calls with a jq-aware lexer.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Planner&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;Exhaustive AST walk that discovers every semantic call site → a &lt;code&gt;Plan&lt;/code&gt; used for &lt;code&gt;--explain&lt;/code&gt;, validation, and cost estimation.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Executor&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;Runs the plan in three phases (harvest / resolve / execute), with interleaved fallback for gated unbounded value ops.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Semantic Executor&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;Deduplicates judgements, consults the persistent judgement cache when enabled, builds each op&amp;rsquo;s prompt and schema, and records run stats.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Backend&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;Pluggable inference. Shipped backends: &lt;code&gt;mock&lt;/code&gt;, &lt;code&gt;local&lt;/code&gt; (llama-server daemon), &lt;code&gt;ollama&lt;/code&gt;, &lt;code&gt;openai&lt;/code&gt;, &lt;code&gt;openrouter&lt;/code&gt;, and &lt;code&gt;anthropic&lt;/code&gt;/&lt;code&gt;--cloud&lt;/code&gt;.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Grammar / schema builder&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;Turns an op&amp;rsquo;s return type / enum into a JSON Schema and, for the local engine, GBNF grammar constraints.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;strong&gt;Assembler&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;Reassembles the output stream and enforces schema invariance.&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;h2 id="windowed-semantic-execution"&gt;Windowed semantic execution&lt;/h2&gt;
&lt;p&gt;For supported three-phase semantic queries, the executor retains one complete-frame window
at a time, harvests its semantic judgements, resolves deduplicated cache misses in one
backend batch, then executes frames in source order. The default source-byte budget is
256 KiB and can be overridden with &lt;code&gt;--window-bytes&lt;/code&gt;, &lt;code&gt;AJQ_WINDOW_BYTES&lt;/code&gt;, or
&lt;code&gt;window_bytes&lt;/code&gt; in TOML. A record that exceeds the budget is a valid one-frame oversized
window, so the budget is not a rejection limit. The executor does not retain the complete
stream: it keeps the current window, one lookahead frame, and bounded framing buffers.&lt;/p&gt;</description></item><item><title>Classify JSON and NDJSON streams</title><link>https://ricardocabral.github.io/ajq/docs/how-to/classify-json-streams/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/classify-json-streams/</guid><description>&lt;p&gt;Use &lt;code&gt;sem_classify&lt;/code&gt; when each record needs one label from a small list: support route,
incident type, moderation bucket, or review theme. The output is bounded to the labels you
write in the query, which makes it safer for downstream jq and shell pipelines than free
text generation.&lt;/p&gt;
&lt;h2 id="classify-a-json-array-with-no-network"&gt;Classify a JSON array with no network&lt;/h2&gt;
&lt;p&gt;Start with &lt;code&gt;--backend mock&lt;/code&gt; to validate the jq expression without a model, provider, or
API key:&lt;/p&gt;</description></item><item><title>Estimate model calls before running</title><link>https://ricardocabral.github.io/ajq/docs/how-to/estimate-model-calls/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/estimate-model-calls/</guid><description>&lt;p&gt;Semantic queries cost one backend judgement per &lt;em&gt;distinct&lt;/em&gt; value they judge. Use
&lt;code&gt;--explain&lt;/code&gt; with representative input to estimate that number before you run a paid or
slow backend.&lt;/p&gt;
&lt;h2 id="run---explain-with-real-input"&gt;Run &lt;code&gt;--explain&lt;/code&gt; with real input&lt;/h2&gt;
&lt;p&gt;Pipe a sample of your data into &lt;code&gt;--explain&lt;/code&gt;. ajq runs a deterministic mock harvest over
the input to estimate work — it never contacts a provider or local model:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;[{&amp;#34;msg&amp;#34;:&amp;#34;urgent&amp;#34;},{&amp;#34;msg&amp;#34;:&amp;#34;urgent&amp;#34;},{&amp;#34;msg&amp;#34;:&amp;#34;other&amp;#34;}]&amp;#39;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;|&lt;/span&gt; ajq --explain &lt;span class="s1"&gt;&amp;#39;.[] | select(.msg =~ &amp;#34;urgent&amp;#34;) | .msg&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="read-the-estimate-block"&gt;Read the estimate block&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;estimates:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; estimate_status: available
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; static_call_sites: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; input_frames: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; harvested_judgements: 3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; post_dedup_judgements: 2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; mock_judge_batches: 1
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The fields you&amp;rsquo;ll budget against:&lt;/p&gt;</description></item><item><title>Use ajq safely from coding agents</title><link>https://ricardocabral.github.io/ajq/docs/how-to/agent-safe-semantic-workflow/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/agent-safe-semantic-workflow/</guid><description>&lt;p&gt;Coding agents often discover ajq while trying to answer a concrete data-cleaning
question: &amp;ldquo;find the records that mean X&amp;rdquo; or &amp;ldquo;route these JSON lines into labels&amp;rdquo;. Use
this workflow when an agent, script, or CI job needs semantic matching while keeping the
jq parts deterministic and reviewable.&lt;/p&gt;
&lt;h2 id="1-keep-ordinary-jq-deterministic"&gt;1. Keep ordinary jq deterministic&lt;/h2&gt;
&lt;p&gt;First write the structural jq pipeline without semantic calls. This step should not need a
backend:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;[{&amp;#34;id&amp;#34;:1,&amp;#34;msg&amp;#34;:&amp;#34;refund requested&amp;#34;},{&amp;#34;id&amp;#34;:2,&amp;#34;msg&amp;#34;:&amp;#34;profile updated&amp;#34;}]&amp;#39;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;|&lt;/span&gt; ajq -c &lt;span class="s1"&gt;&amp;#39;.[] | {id, msg}&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Only add semantic operators once the field selection and output shape are correct.&lt;/p&gt;</description></item><item><title>Configuration</title><link>https://ricardocabral.github.io/ajq/docs/reference/configuration/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/reference/configuration/</guid><description>&lt;p&gt;ajq resolves semantic-backend settings from flags, environment variables, a TOML config
file, and backend defaults.&lt;/p&gt;
&lt;h2 id="precedence"&gt;Precedence&lt;/h2&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th style="text-align: right"&gt;Rank&lt;/th&gt;
					&lt;th&gt;Source&lt;/th&gt;
					&lt;th&gt;Notes&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td style="text-align: right"&gt;1&lt;/td&gt;
					&lt;td&gt;Command-line flags&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;--backend&lt;/code&gt;, &lt;code&gt;--model&lt;/code&gt;, &lt;code&gt;--base-url&lt;/code&gt;, &lt;code&gt;--backend-concurrency&lt;/code&gt;, &lt;code&gt;--max-calls&lt;/code&gt;, &lt;code&gt;--window-bytes&lt;/code&gt;, and &lt;code&gt;--no-cache&lt;/code&gt;.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: right"&gt;2&lt;/td&gt;
					&lt;td&gt;Environment variables&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;AJQ_BACKEND&lt;/code&gt;, &lt;code&gt;AJQ_MODEL&lt;/code&gt;, &lt;code&gt;AJQ_BASE_URL&lt;/code&gt;, &lt;code&gt;AJQ_BACKEND_CONCURRENCY&lt;/code&gt;, &lt;code&gt;AJQ_MAX_CALLS&lt;/code&gt;, &lt;code&gt;AJQ_WINDOW_BYTES&lt;/code&gt;.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: right"&gt;3&lt;/td&gt;
					&lt;td&gt;TOML config&lt;/td&gt;
					&lt;td&gt;Default path or &lt;code&gt;AJQ_CONFIG&lt;/code&gt;.&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: right"&gt;4&lt;/td&gt;
					&lt;td&gt;Backend defaults&lt;/td&gt;
					&lt;td&gt;For example, Anthropic&amp;rsquo;s default model and paid-backend call cap.&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Flags override environment variables; environment variables override config values; config
values override backend defaults.&lt;/p&gt;</description></item><item><title>Project status</title><link>https://ricardocabral.github.io/ajq/docs/explanation/project-status/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/explanation/project-status/</guid><description>&lt;p&gt;ajq has shipped its deterministic jq spine, semantic planning and supported semantic
execution, local inference, bounded-parallel local daemon transport, Phase 3
backend/cloud controls, first-run local asset provisioning, local model management, the
persistent judgement cache, byte-budgeted semantic windows, an explicit low-latency
semantic stream mode, and checksummed release archives with a no-sudo install script.
Further streaming optimizations remain planned. The iterative-harvest experiment is an internal-only no-go prototype, not a shipped mode; default windowed execution is unchanged.&lt;/p&gt;</description></item><item><title>Use cloud backends</title><link>https://ricardocabral.github.io/ajq/docs/how-to/use-cloud-backends/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/use-cloud-backends/</guid><description>&lt;p&gt;Use a cloud backend when you want hosted inference instead of the local
&lt;code&gt;llama-server&lt;/code&gt; backend. Each provider needs an API key in the environment; ajq does not
read API keys from &lt;code&gt;config.toml&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id="use-anthropic-claude"&gt;Use Anthropic Claude&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Export an Anthropic API key:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;ANTHROPIC_API_KEY&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;sk-ant-...&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Run a semantic query with &lt;code&gt;--cloud&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;{&amp;#34;msg&amp;#34;:&amp;#34;urgent billing issue&amp;#34;}&amp;#39;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;|&lt;/span&gt; ajq --cloud --model haiku &lt;span class="s1"&gt;&amp;#39;.msg =~ &amp;#34;urgent&amp;#34;&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;--cloud&lt;/code&gt; is the same as &lt;code&gt;--backend anthropic&lt;/code&gt;. If you omit &lt;code&gt;--model&lt;/code&gt;, ajq uses
&lt;code&gt;claude-haiku-4-5&lt;/code&gt;. The shipped aliases are &lt;code&gt;haiku&lt;/code&gt;, &lt;code&gt;sonnet&lt;/code&gt;, and &lt;code&gt;opus&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Backends</title><link>https://ricardocabral.github.io/ajq/docs/reference/backends/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/reference/backends/</guid><description>&lt;p&gt;Semantic operators require a backend. Pure jq queries do not construct a backend, spawn a
daemon, or make network calls unless a semantic operator is present and a backend is
selected by flags, environment, or config.&lt;/p&gt;
&lt;h2 id="backend-summary"&gt;Backend summary&lt;/h2&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th&gt;Backend&lt;/th&gt;
					&lt;th&gt;Select with&lt;/th&gt;
					&lt;th&gt;Model default / requirement&lt;/th&gt;
					&lt;th&gt;Base URL&lt;/th&gt;
					&lt;th&gt;Credentials&lt;/th&gt;
					&lt;th style="text-align: right"&gt;Default &lt;code&gt;max_calls&lt;/code&gt;&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;mock&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;--backend mock&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Built-in &lt;code&gt;ajq-default-model&lt;/code&gt; identity&lt;/td&gt;
					&lt;td&gt;none&lt;/td&gt;
					&lt;td&gt;none&lt;/td&gt;
					&lt;td style="text-align: right"&gt;&lt;code&gt;0&lt;/code&gt; (unlimited)&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;local&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;--backend local&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;qwen2.5-1.5b&lt;/code&gt; unless overridden&lt;/td&gt;
					&lt;td&gt;Managed loopback &lt;code&gt;http://127.0.0.1:8081&lt;/code&gt;; explicit &lt;code&gt;--base-url&lt;/code&gt; for user-trusted servers&lt;/td&gt;
					&lt;td&gt;managed bearer key (internal)&lt;/td&gt;
					&lt;td style="text-align: right"&gt;&lt;code&gt;0&lt;/code&gt; (unlimited)&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;ollama&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;--backend ollama&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Required &lt;code&gt;--model&lt;/code&gt; / config / env&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;OLLAMA_HOST&lt;/code&gt; or &lt;code&gt;http://127.0.0.1:11434&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;none&lt;/td&gt;
					&lt;td style="text-align: right"&gt;&lt;code&gt;0&lt;/code&gt; (unlimited)&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;openai&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;--backend openai&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Required &lt;code&gt;--model&lt;/code&gt; / config / env&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;https://api.openai.com/v1&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;OPENAI_API_KEY&lt;/code&gt;&lt;/td&gt;
					&lt;td style="text-align: right"&gt;&lt;code&gt;100&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;openrouter&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;--backend openrouter&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;Required &lt;code&gt;--model&lt;/code&gt; / config / env&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;https://openrouter.ai/api/v1&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;OPENROUTER_API_KEY&lt;/code&gt;&lt;/td&gt;
					&lt;td style="text-align: right"&gt;&lt;code&gt;100&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td&gt;&lt;code&gt;anthropic&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;--backend anthropic&lt;/code&gt; or &lt;code&gt;--cloud&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;claude-haiku-4-5&lt;/code&gt;; aliases &lt;code&gt;haiku&lt;/code&gt;, &lt;code&gt;sonnet&lt;/code&gt;, &lt;code&gt;opus&lt;/code&gt;&lt;/td&gt;
					&lt;td&gt;provider default; no user base URL&lt;/td&gt;
					&lt;td&gt;&lt;code&gt;ANTHROPIC_API_KEY&lt;/code&gt;&lt;/td&gt;
					&lt;td style="text-align: right"&gt;&lt;code&gt;100&lt;/code&gt;&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;&lt;code&gt;max_calls&lt;/code&gt; counts post-dedup backend judgements. &lt;code&gt;0&lt;/code&gt; means unlimited. For a
machine-readable static projection of these registered backends, use &lt;code&gt;ajq capabilities --json&lt;/code&gt;; it does not resolve configured credentials or runtime
asset state. In that projection Ollama has no &lt;code&gt;default_base_url&lt;/code&gt;, because its
runtime URL may come from &lt;code&gt;OLLAMA_HOST&lt;/code&gt; before the documented loopback fallback.&lt;/p&gt;</description></item><item><title>Control semantic costs</title><link>https://ricardocabral.github.io/ajq/docs/how-to/control-costs/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/control-costs/</guid><description>&lt;p&gt;Use this workflow before running semantic queries on a paid backend.&lt;/p&gt;
&lt;h2 id="1-estimate-calls-with---explain"&gt;1. Estimate calls with &lt;code&gt;--explain&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;Run the query with representative input and &lt;code&gt;--explain&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;printf&lt;/span&gt; &lt;span class="s1"&gt;&amp;#39;[{&amp;#34;msg&amp;#34;:&amp;#34;urgent&amp;#34;},{&amp;#34;msg&amp;#34;:&amp;#34;other&amp;#34;}]&amp;#39;&lt;/span&gt; &lt;span class="se"&gt;\
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="p"&gt;|&lt;/span&gt; ajq --explain &lt;span class="s1"&gt;&amp;#39;.[] | select(.msg =~ &amp;#34;urgent&amp;#34;) | .msg&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Read &lt;code&gt;post_dedup_judgements&lt;/code&gt; in the estimate block:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;estimates:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; estimate_status: available
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; static_call_sites: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; input_frames: 1
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; harvested_judgements: 2
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; post_dedup_judgements: 2
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;That number is the count to budget against. Repeated values are deduplicated before the
backend is called.&lt;/p&gt;</description></item><item><title>Install the ajq coding-agent skill</title><link>https://ricardocabral.github.io/ajq/docs/how-to/install-agent-plugin/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/install-agent-plugin/</guid><description>&lt;p&gt;Install the ajq skill when an agent should route semantic JSON or NDJSON
filtering and bounded classification work to ajq. Install &lt;code&gt;ajq&lt;/code&gt; itself first so
the skill can run its safe discovery and mock checks.&lt;/p&gt;
&lt;h2 id="install-for-codex"&gt;Install for Codex&lt;/h2&gt;
&lt;p&gt;Add the public ajq marketplace and install its plugin:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;codex plugin marketplace add ricardocabral/ajq
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;codex plugin add ajq@ajq
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For a reproducible environment, pin the marketplace to an ajq release tag that
contains this plugin. Replace &lt;code&gt;vX.Y.Z&lt;/code&gt; with that release tag:&lt;/p&gt;</description></item><item><title>Manage the judgement cache</title><link>https://ricardocabral.github.io/ajq/docs/how-to/manage-the-cache/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/manage-the-cache/</guid><description>&lt;p&gt;ajq stores successful semantic judgements on disk so repeated runs over the same
op/spec/model/value identity can skip backend calls.&lt;/p&gt;
&lt;h2 id="see-where-the-cache-lives"&gt;See where the cache lives&lt;/h2&gt;
&lt;p&gt;Run:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ajq cache status
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Example output:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;location: /Users/you/Library/Caches/ajq/judgements
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;entries: 0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;bytes: 0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Set &lt;code&gt;AJQ_CACHE_DIR&lt;/code&gt; when you want an isolated cache for a project or test:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nv"&gt;AJQ_CACHE_DIR&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="nv"&gt;$PWD&lt;/span&gt;&lt;span class="s2"&gt;/.ajq-cache&amp;#34;&lt;/span&gt; ajq cache status
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h3 id="inspect-cache-state-from-an-agent"&gt;Inspect cache state from an agent&lt;/h3&gt;
&lt;p&gt;Use the versioned JSON probe instead of parsing the human table-like output:&lt;/p&gt;</description></item><item><title>Configure defaults</title><link>https://ricardocabral.github.io/ajq/docs/how-to/configure-defaults/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/configure-defaults/</guid><description>&lt;p&gt;Use a config file when you do not want to repeat the same semantic-backend flags on every
command.&lt;/p&gt;
&lt;h2 id="1-create-the-config-file"&gt;1. Create the config file&lt;/h2&gt;
&lt;p&gt;ajq reads this path by default:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;${XDG_CONFIG_HOME:-~/.config}/ajq/config.toml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Create the directory and file:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;mkdir -p &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;XDG_CONFIG_HOME&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="p"&gt;/.config&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/ajq&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;cat &amp;gt; &lt;span class="s2"&gt;&amp;#34;&lt;/span&gt;&lt;span class="si"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;XDG_CONFIG_HOME&lt;/span&gt;&lt;span class="k"&gt;:-&lt;/span&gt;&lt;span class="nv"&gt;$HOME&lt;/span&gt;&lt;span class="p"&gt;/.config&lt;/span&gt;&lt;span class="si"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;/ajq/config.toml&amp;#34;&lt;/span&gt; &lt;span class="s"&gt;&amp;lt;&amp;lt;&amp;#39;EOF&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;backend = &amp;#34;mock&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;max_calls = 25
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;no_cache = false
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="s"&gt;EOF&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For a one-off location, set &lt;code&gt;AJQ_CONFIG&lt;/code&gt; to an explicit file path.&lt;/p&gt;
&lt;h2 id="2-add-semantic-defaults"&gt;2. Add semantic defaults&lt;/h2&gt;
&lt;p&gt;Recognized keys are:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-toml" data-lang="toml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;backend&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;local&amp;#34;&lt;/span&gt; &lt;span class="c"&gt;# mock, local, ollama, openai, openrouter, anthropic&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;model&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;qwen2.5-1.5b&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;base_url&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;http://127.0.0.1:8081&amp;#34;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;max_calls&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;100&lt;/span&gt; &lt;span class="c"&gt;# 0 = unlimited&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nx"&gt;no_cache&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;For example, to default to the deterministic mock backend with a small call cap:&lt;/p&gt;</description></item><item><title>Use a larger local model</title><link>https://ricardocabral.github.io/ajq/docs/how-to/use-a-larger-model/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/how-to/use-a-larger-model/</guid><description>&lt;p&gt;The local backend defaults to &lt;code&gt;qwen2.5-1.5b&lt;/code&gt;. Use &lt;code&gt;ajq models&lt;/code&gt; when you want one of the
larger shipped catalog models.&lt;/p&gt;
&lt;h2 id="1-list-catalog-models"&gt;1. List catalog models&lt;/h2&gt;
&lt;p&gt;Run:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;ajq models list
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Example output before any downloads:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NAME ACTIVE INSTALLED SIZE RAM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;qwen2.5-1.5b * no 1.2GiB ~4 GiB RAM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;qwen2.5-3b no 2.0GiB ~6 GiB RAM
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;qwen3-4b no 2.3GiB ~8 GiB RAM
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;ACTIVE&lt;/code&gt; shows the model selected by config/env/defaults. &lt;code&gt;INSTALLED&lt;/code&gt; shows whether the
GGUF file exists in the ajq cache.&lt;/p&gt;</description></item><item><title>Iterative-harvest prototype evaluation</title><link>https://ricardocabral.github.io/ajq/docs/explanation/iterative-harvest-evaluation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://ricardocabral.github.io/ajq/docs/explanation/iterative-harvest-evaluation/</guid><description>&lt;h2 id="decision-no-go-for-productionization"&gt;Decision: no-go for productionization&lt;/h2&gt;
&lt;p&gt;The iterative-harvest implementation is an internal test and benchmark prototype. It is
&lt;strong&gt;not&lt;/strong&gt; a CLI mode, is not selected by default, and must not be enabled for users.
The existing &lt;code&gt;three-phase-windowed&lt;/code&gt; executor remains the default and unsupported query
shapes continue to use their existing windowed or planner-required interleaved fallback.&lt;/p&gt;
&lt;p&gt;This is a no-go even though the pruning workload clears its judgement-saving target. A
reachable error case found during characterization has different behavior from the current
windowed executor: after an earlier gate rejects a value, a backend result/schema/transport
error for that pruned descendant is dispatched and returned by permissive windowed harvest,
but is intentionally not dispatched by iterative harvest or interleaved execution. That
changes the reachable error, cache, and exit contract. Reducing calls by dispatching the
unreachable descendant would defeat the prototype&amp;rsquo;s purpose. Until a separate design
resolves that semantic/error boundary, the required current-window parity gate is not met.&lt;/p&gt;</description></item></channel></rss>