- Text syntax — SQL-like, human-readable
- JSON wire format — canonical format used by the Noetive API
Query structure
A query has one required clause and three optional modifiers:Clauses
DISTANCE
Nearest-neighbor sphere in embedding space. Matches messages whose embedding falls within a given cosine distance of the anchor.
Provide either
within or top_k. If neither is set, the clause acts as a scoring signal without a hard threshold.
DIRECTION
Cone search in embedding space. Matches messages aligned with one or more concept directions, regardless of distance from the origin.
When
toward is an array, the direction vector is the normalized mean of all embedded concepts.
CONTRAST
Attract/repel vector arithmetic. Matches messages semantically close to the attract concepts and far from the repel concepts.
The composite vector is
normalize(mean(embed(attract)) − mean(embed(repel))).
Boolean composition
Combine clauses withAND, OR, and NOT. Use parentheses to control precedence.
Modifiers
PARTITION
Scopes the query to one or more namespaces. Without aPARTITION clause, the query searches the default namespace only.
WINDOW
Restricts results to messages published within a time window ending now."P7D", "PT48H", "PT30M".
LIMIT
Caps the number of results returned.Anchors
An anchor is the reference point for a clause. Two forms are accepted: Natural language string — the broker embeds it automatically:Duration format
The text parser accepts both formats. The JSON serializer always emits ISO 8601.
Full examples
Reserved words
Grammar reference
EBNF grammar
EBNF grammar

