AlmondTill/G3N API

askConsultation

mutation · in the family Work and notes

What it does

Ask Aldric one question in a consultation — the reply may include a drafted plan of records to create.

Ask Aldric ONE question in a Consultation: appends your question, composes the stored summary + the last 12 turns verbatim + your attached materials' stored extractions (extract-then-compose — mint/confirm them with wizardType 'consultation' first; only your own confirmed materials compose), asks the platform-keyed model, and appends the reply. When the un-summarized tail outgrows the window, the older turns fold into the stored summary first (its own metered call — the memory is visible on the record, never hidden model state). A drafted plan in the reply is validated against the live registry + wire schema as it lands — invalid steps arrive marked, never repaired; nothing real is created by asking (takeConsultationPlan mints the walk). Refuses INTEGRATION/UNAVAILABLE keyless · RATE_LIMIT/THROTTLED past the 30/hour allowance · CONFLICT/REF_STATE on a non-open consultation · the honest transcript-full refusal naming the follow-on cure. Every made call meters (at.ai.call.v1 — surfaces office.consultation + office.consultation_summary). Requires authentication (user sessions) + the record's current revision.

Before you call

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

Capability area: Work and notes — Tasks, notes, messages, dashboards and the everyday tools every staff member keeps.

Roles that may call it:

What happens

Your question and the reply both land on the transcript. Aldric reads the stored summary, the recent turns, and any materials you attach (their stored extractions — files are never re-read). When the conversation grows long, the older turns fold into the stored summary first — visible on the record, never hidden. A drafted plan is checked immediately; steps that do not check out arrive marked, never silently fixed. Each ask is a metered AI call with an hourly allowance per person.

Careful

Nothing real is created by asking — a drafted plan only becomes records after you take, review, approve, and realize it yourself.

Arguments

NameTypeRequiredNotes
inputAskConsultationInput AskConsultationInput!yesThe askConsultation input — the target + its current revision, your question, and optionally your own confirmed materials (≤4, minted with wizardType 'consultation' — their stored extractions compose,

Concurrency

Send the record’s current revision from your last read as revision. A stale revision is refused as CONFLICT/REVISION_STALE — read the record again and retry with the new value.

Returns

AskConsultationResult AskConsultationResult! — The askConsultation result — the updated record + the two turns the ask appended (the question as spoken, the reply as drafted-and-marked).

Example request

graphql
mutation ExampleAskConsultation($input: AskConsultationInput!) {
  askConsultation(input: $input) {
    consultation {
      id
      sysId
      type
      caption
      status
      parentId
      rootId
      createdAt
      updatedAt
      revisionNum
      revision
      turnCount
      summary
      summarizedThroughSeq
      followOnOfId
      idleArchiveAt
      turnsTierAt
      turnsTier
    }
  }
}

Variables:

json
{
  "input": {
    "id": "01900000-0000-7000-8000-37386ae00000",
    "revision": "01900000-0000-7000-8000-b7960e180000",
    "message": "Restock before the weekend.",
    "materialIds": [
      "01900000-0000-7000-8000-cbd54f800000"
    ]
  }
}

Send it with the envelope naming the version: "extensions": {"at": {"version": {"name":"genesis","number":0}}}.

Example response

json
{
  "data": {
    "askConsultation": {
      "consultation": {
        "id": "01900000-0000-7000-8000-f9c8c6240000",
        "sysId": "CI-EXMP-0000-000F",
        "type": "Consultation",
        "caption": "Blue jeans",
        "status": "open",
        "parentId": "01900000-0000-7000-8000-e0a63e120000",
        "rootId": "01900000-0000-7000-8000-a1295a650000",
        "createdAt": "2027-01-31T00:00:00.000Z",
        "updatedAt": "2027-01-31T00:00:00.000Z",
        "revisionNum": 1,
        "revision": "01900000-0000-7000-8000-53c6eea90000",
        "turnCount": 1,
        "summary": "<summary>",
        "summarizedThroughSeq": 1,
        "followOnOfId": "01900000-0000-7000-8000-8aada40c0000",
        "idleArchiveAt": "2027-01-31T00:00:00.000Z",
        "turnsTierAt": "2027-01-31T00:00:00.000Z",
        "turnsTier": "<turns tier>"
      }
    }
  },
  "extensions": {
    "at": {
      "callId": "01EXAMPLE-CALL-ID",
      "version": {
        "requested": {
          "name": "genesis",
          "number": 0
        },
        "serviced": {
          "name": "genesis",
          "number": 0
        }
      }
    }
  }
}

Errors this call can answer

Used in