Problem
The semantic query API combines all request filters with AND. It also does not support common null operations.
The API cannot represent questions such as:
- Which accounts have no assigned customer-success manager?
- Which contracts have no renewal date?
- Which accounts are enterprise customers or are located in EMEA?
- Which tickets are escalated or outside SLA?
Proposed solution
Extend the request filter model with:
IS NULL
IS NOT NULL
NOT LIKE
- Explicit
AND groups
- Explicit
OR groups
- A bounded nesting depth
- A bounded total predicate count
Example:
{
"filter": {
"or": [
{
"field": "account.segment",
"op": "=",
"value": "Enterprise"
},
{
"field": "account.region",
"op": "=",
"value": "EMEA"
}
]
}
}
All referenced fields must still resolve through the compiled model and pass governance checks.
The request must never accept raw SQL predicates.
Implementation areas
- internal/planner/plan.go
- internal/planner/plan_sql.go
- internal/serving/limits.go
- internal/serving/mcp/mcp.go
- REST and planner tests
Acceptance criteria
- IS NULL and IS NOT NULL are supported.
- NOT LIKE is supported.
- Explicit AND and OR groups are supported.
- Nesting depth and total predicates are bounded.
- Every referenced field is authorized.
- Raw SQL cannot enter the filter tree.
- Request hashing includes the complete filter structure.
- StarRocks and Trino emit equivalent Boolean semantics.
Problem
The semantic query API combines all request filters with
AND. It also does not support common null operations.The API cannot represent questions such as:
Proposed solution
Extend the request filter model with:
IS NULLIS NOT NULLNOT LIKEANDgroupsORgroupsExample:
{ "filter": { "or": [ { "field": "account.segment", "op": "=", "value": "Enterprise" }, { "field": "account.region", "op": "=", "value": "EMEA" } ] } }All referenced fields must still resolve through the compiled model and pass governance checks.
The request must never accept raw SQL predicates.
Implementation areas
Acceptance criteria