settles pick, lowest escape_p first, and reads current answers only.
POST /v1/namespaces/acme%2Fprod/query
settlesmatches a payment to an open invoice (match one record to another). Itsunmatchedthreshold is true whenescape_p(the probability of no match) is at least 0.3, so this filter keeps the payments with a pick.escape_p,valueand the threshold are the fitted numbers whensettleshas features and a fit, so a new fit can move a payment in or out of this query and change its pick.- Each row has its
id, itsrevision, theblockattribute and thesettlesanswer."state": trueadds each row’sstate, and"images": trueitsimages, as references.
Filters
A filter is[field, op, value], ["And", [...]], ["Or", [...]] or ["Not", filter].
The operators are Eq, NotEq, In, NotIn, Lt, Lte, Gt, Gte, Glob, Contains (on arrays of strings) and Exists.
A comparison on a missing field is false, except NotEq and NotIn, which are true, so ["answers.settles.value", "NotEq", "none_of_the_above"] also matches payments with no answer yet. Add ["answers.settles.value", "Exists", true] to leave them out.
Fields you can filter on
You can filter onid, revision, updated_at and attributes.*, never on state, and on these fields of each judgment’s answer, as answers.<j>.<field>:
A
text column takes value, a json column the keys under value, and an embedding column none of its value; each takes freshness, judgment_version, engine and engine_version. Any other field of these types, and a key of a decision’s value, is invalid_request.
Each filter reads the number that the answer shows, which is the engine’s number on a judgment without features (never calibrated), the fitted number on a judgment with features, and the combined p on a composite. See which number your thresholds and queries read.
Filter on how sure a calibrated number is
fit.interval is the 95% interval of the fitted p on a judgment with features (on a choice, escape_p; on a score, score), and interval.lower and interval.upper are its bounds. You can compare them with numbers (Eq, NotEq, Lt, Lte, Gt, Gte, In, NotIn), test them with Exists, or rank on them. To act only where the probability is surely high, filter on the lower bound rather than on p.
- The bounds read the same fit as
p, in the same read. - The bounds are missing while
pis the engine’s (which includes every judgment with features below 100 outcomes) and for a fit made before fits recorded intervals.["answers.invoice_settlement.interval.lower", "Exists", false]selects those documents. - The bounds are
invalid_requeston a judgment without features, since the corrected numbers there are for reading only. Readcalibrated.intervalin your own code, or pick a threshold with the recommender. - A query always reads the current bounds, which change when the fit changes and can narrow as outcomes arrive.
Find the answers of one version
judgment_version, engine and engine_version find the answers that one version of the judgment, one engine, or one engine version made. After you activate version 4 of settles, this filter finds the answers that versions 1 to 3 made.
judgment_versionis an integer. Compare it withEq,NotEq,Lt,Lte,Gt,Gte,InorNotIn, or test it withExists.engineis a string, such asjevorgpt-6-luna. Compare it withEq,NotEq,InorNotIn, or test it withExists.engine_versionis a string, compared the same way. For an engine version that is not pinned (jevcurrent, for example), it holds the label of the epoch, such ascurrent+2026-09-24.1. Each engine numbers its own epochs, so two engines can share a label and you filter onenginetoo.
stale, with stale_reason older_version. A new epoch never makes an answer stale, however. To compare two epochs, filter on engine_version. See versions.
Filter on a feature
A feature filter names the judgment and the feature. Ifinvoice_settlement keeps matched_payments.count, this filter finds the invoices with two or more matched payments.
- All the text after
features.is the feature’s name, and it must be a feature of that judgment. - Compare it with numbers (
Eq,NotEq,Lt,Lte,Gt,Gte,In,NotIn), or test it withExists. - The filter reads the value stored with the answer, which follows the related documents after the judgment’s debounce. If freshness matters, also check the answer’s
freshness. Awindowcounts back from the document’s newest activity rather than from today.
Read only current answers
Each answer has a freshness, which a query uses in two ways:answers: "fresh_only"removes each row whose included answers are notfresh. It checks only the judgments thatinclude.answersnames, and also removes a row with no answer for one of them.- A filter on
freshnessreads one judgment’s freshness, such as["answers.settles.freshness", "Eq", "fresh"].
stale.
A fresh_only query on an on_read judgment reads the rows it leaves out, so Brussle judges them again as it does the rows it returns. A later query returns each row once its answer is fresh. One query starts this judging for at most top_k left-out rows per judgment (among rows that match the rest of the query), so a “current answers only” queue refills a page at a time after a version switch.
A filter on pending tells you whether a judgment has caught up with your writes, since a query for one pending answer returns no row when it has. A judgment’s judged_through tells you too, and reads no documents. See is a judgment caught up?.
Rank and page
rank_byis one field and a direction,["updated_at", "desc"]by default, and ties go byid.top_kis at most 1,000, andmore: truemeans more rows matched.cursorgets the next page when you send the previous page’snext_cursor. A cursor lasts 10 minutes and keeps the namespace as it was at the first page, so all pages agree.consistency: "eventual"can serve a view up to 60 seconds old for lower latency, while the default,strong, sees every write acknowledged before the query.- Large scans are refused. Brussle refuses a query whose estimated scan is more than 4 GB with
too_largeand the estimate, and does not bill it. Add attribute filters to narrow it. - A filter or rank on a
jsonkey reads each answer it compares. Brussle refuses one that would read more than 256 MB ofjsonanswers withtoo_largeand the estimate, and does not bill it. Add attribute filters to narrow it. A query that only returns ajsonorembeddinganswer reads its value, and one that neither returns nor filters on it does not.
pending, for example). See tradeoffs for which filters are fast.
Which judgments you can filter on
You can filter or rank on any judgment except anon_read one.
- An
on_readanswer exists only after something reads it, so a filter on it isinvalid_request. Switch the judgment toon_changefirst, and Brussle backfills the missing answers once you confirm an estimate, never without one. on_changekeeps each answer current, so use it for the judgments you filter on.- Filters read
periodicandmanualanswers as they are stored.
Read one document
GET /namespaces/{ns}/documents/{id} returns one document with all its answers, and their history on request. See reading documents.
Count answers per group
A query returns documents, so to count answers per key value (the matched payments for each customer each month, for example), declare a group. A group keeps counts, sums and averages over documents and answers for each key value, and you read its rows when you want them.Get told when a document matches
A subscription is a saved query that sends an event when a document starts or stops matching its filter. Its filter uses the same grammar as a query’s filters, exceptfreshness.