AlmondTill/G3N API

interpretFilter

query · in the family Reading your records

What it does

Turn a written request — “issued orders from Acme since June” — into filter conditions you can review and apply.

Interpret a written request into structured filter conditions for a declared filterable family: the model drafts under a schema constrained to the family's roster, the server re-validates every clause exactly as hand-built (the grammar disposes), and reference names resolve in-tenant (ambiguity answers candidates for the picker — no tenant data leaves the platform; the prompt carries only the roster, its vocabularies, and your sentence). Inexpressible parts come back worded in unmappable. type must be a declared filterable family; text is one sentence (<= 500 chars). Refuses INTEGRATION/UNAVAILABLE while the interpreter is offline/keyless — build the filter by hand. Requires authentication (user sessions). Every call is cost-metered (at.ai.call.v1).

Before you call

A signed-in user’s session — the call refuses an API key (AUTHZ/FORBIDDEN).

Capability area: Reading your records — Looking up and listing the records of your organization.

Roles that may call it:

What happens

A drafting assist: nothing filters until you press Apply, and anything it could not express is named so you can add it by hand. Each use makes one metered AI call.

Arguments

NameTypeRequiredNotes
typeString String!yes
textString String!yes

Returns

InterpretedFilter InterpretedFilter! — The NL interpreter's answer: grammar clauses that survived the strict validator, the parts that could not map (worded), and the reference names needing a human pick.

Example request

graphql
query ExampleInterpretFilter($type: String!, $text: String!) {
  interpretFilter(type: $type, text: $text) {
    clauses {
      field
      op
      values
    }
  }
}

Variables:

json
{
  "type": "<type>",
  "text": "Restock before the weekend."
}

Example response

json
{
  "data": {
    "interpretFilter": {
      "clauses": [
        {
          "field": "<field>",
          "op": "<op>",
          "values": [
            "<values>"
          ]
        }
      ]
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": null,
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer