← API reference
SCHEMA VIEW

AI and ML

AI adapters and agents, chat sessions, knowledge notes, ML models and their configurations.

Open workbench ↗Download SDL ↓AI context →

75 operations · complete schema 141 KB

Query

magicQuery

Executes a Magic Query string and returns the predefined query's JSON result. On a bad noun or parameter, returns a structured error whose 'extensions' carry 'code', 'actionable_message', and 'suggestions' for self-correction.

→
Query

getMagicQuerySchema

Returns the input JSON Schema and output introspection for a Magic Query noun, so consumers (especially LLMs) can learn its contract before calling magicQuery.

→
Query

listMagicQueries

Lists every available Magic Query noun with a short description and its options — the discovery entry point.

→
Query

getMagicQueryGraphQL

Resolves a Magic Query string to the real GraphQL operation and variables it runs, so consumers can graduate from the façade to raw GraphQL. Does not execute.

→
Query

listDataChangeEventTopics

List all valid data change event topics, grouped by resource. Requires authentication.

→
Query

generateDefaultDataQuery

Generate a default GraphQL data query for an event topic. Returns a query string with all scalar fields for the resource, or null if the topic has no matching query. The query uses $id as the variable for the resource ID.

→
Query

ping

Health check endpoint

→
Query

getAIAdapter

Fetch an AI adapter by ID. Requires aiadapter:read permission.

→
Query

listAIAdapters

List AI adapters with pagination and filtering. Requires aiadapter:list permission.

→
Query

getAIAgent

Fetch an AI agent by ID. Requires aiAgent:read permission.

→
Query

listAIAgents

List AI agents with pagination. Requires aiAgent:list permission.

→
Query

getMLModelConfig

Fetch an ML model config by ID. Requires mlmodelconfig:read permission.

→
Query

listMLModelConfigs

List ML model configs with pagination and filtering. Requires mlmodelconfig:list permission.

→
Query

exportMLModelConfig

Export an ML model config as JSON or YAML. Requires mlmodelconfig:read permission.

→
Query

listMLModelConfigVersions

List versions for an ML model config, newest first, with pagination. Requires mlmodelconfig:read permission.

→
Query

getMLModelConfigVersion

Get a specific ML model config version by ID. Requires mlmodelconfig:read permission.

→
Query

getChatSession

Fetch a chat session by ID. Requires chatsession:read permission.

→
Query

listChatSessions

List chat sessions with pagination and filtering. Requires chatsession:list permission.

→
Query

chatAIAvailability

Report configured adapter eligibility for this tenant. This is not a live provider health check; use testAIAdapter to verify credentials and model access.

→
Query

iacSchema

The infrastructure-only view of this schema, for declarative tooling. Contains only annotated resources and the types they reach.

→
Query

iacValidate

Validate an infrastructure artifact. Pure and side-effect free; safe to alias many times in one document.

→
Query

iacGuides

Every authoring guide, for a tool that syncs them to a folder. Intended for `schema pull` to call once and write to disk, not for an agent to call while authoring — a file can be grepped and re-read in part, where a response arrives whole.

→
Query

helpChapters

List human-facing manual chapters from the running deployment.

→
Query

helpChapter

Read a chapter of the current published manual edition.

→
Query

searchHelp

Search human-facing manuals using shared semantic and text retrieval.

→
Query

schemaAuthoringCatalog

Compiler-owned vocabulary for the standalone XML JSON Schema dialect, including native form annotations.

→
Query

compileSchemaXML

Compile standalone XML schema syntax into JSON Schema without persisting it; host restrictions apply when embedded.

→
Query

renderSchemaXML

Render JSON Schema as native XML without dropping unsupported keywords or changing a saved document.

→
Query

iacSchemaDocument

Fetch the JSON Schema document a SCHEMA-kind validator references, for declarative tooling.

→
Query

reportQuery

Execute a MicroSQL reporting query against the analytics schema. Supports SELECT with WHERE, JOIN, ORDER BY, GROUP BY, LIMIT. Tenant isolation is enforced automatically. Covers production (jobs, components, operations, milestones), prepress, scheduling (work_centers, planned_operations, schedule_allocations), sales (estimates, orders, invoices), cost accounting, catalog/inventory (products, substrates, warehouse_stock), logistics (shipments), tasks, time-series (metric_points, progress_points), and people (users, teams). Per-table IAM authorization is enforced — requires :list on each table's resource.

→
Query

describeQuerySchema

Analyze a MicroSQL query and return the inferred result schema (column names, data types) without executing it. Returns validation errors with typo-correcting suggestions if the query is invalid. Validates only against tables the caller can list.

→
Query

concept

Fetch a single concept by ID. Requires concept:read permission.

→
Query

concepts

List the tenant's concepts with pagination. Requires concept:list permission.

→
Query

knowledgeNote

Fetch a single knowledge note by ID. Requires knowledgeNote:read permission.

→
Query

knowledgeNotes

List knowledge notes with pagination and filtering. A direct query over the store; for situational relevance use `retrieveKnowledge`. Requires knowledgeNote:list permission.

→
Query

retrieveKnowledge

The retrieval (RAG) entry point. Given the entities in context (`seeds`) and an optional `query`, returns the most relevant knowledge in two buckets — graph-reached and semantically-supporting — each ranked by a blended relevance score. Requires knowledgeNote:read permission.

→
Mutation

upsertAIAdapter

Create or update an AI adapter. Requires aiadapter:write permission.

→
Mutation

createAIAdapter

Create a new AI adapter. Requires aiadapter:write permission.

→
Mutation

updateAIAdapter

Update an AI adapter. Only provided fields are changed. Requires aiadapter:write permission.

→
Mutation

deleteAIAdapter

Delete an AI adapter. Requires aiadapter:delete permission.

→
Mutation

testAIAdapter

Verify provider credentials and all effective configured models using provider model endpoints. Does not generate content. Requires aiadapter:read permission.

→
Mutation

upsertAIAgent

Create or update an AI agent. Requires aiAgent:write permission.

→
Mutation

createAIAgent

Create a new AI agent. Requires aiAgent:write permission.

→
Mutation

updateAIAgent

Update an AI agent. Only provided fields are changed. Requires aiAgent:write permission.

→
Mutation

deleteAIAgent

Delete an AI agent. Requires aiAgent:delete permission.

→
Mutation

upsertMLModelSource

Create or replace ML XML authoring source. Updates require the observed authoring revision and preserve training and publication state.

→
Mutation

upsertMLModelConfig

Create or update an ML model config. Requires mlmodelconfig:write permission.

→
Mutation

createMLModelConfig

Create a new ML model config. Requires mlmodelconfig:write permission.

→
Mutation

updateMLModelConfig

Update an ML model config. Only provided fields are changed. Requires mlmodelconfig:write permission.

→
Mutation

deleteMLModelConfig

Delete an ML model config. Requires mlmodelconfig:delete permission.

→
Mutation

trainMLModel

Trigger training for an ML model. Requires mlmodelconfig:execute permission.

→
Mutation

previewMLModelPipeline

Run the data pipeline over a sample WITHOUT training and return the emitted fields. Requires mlmodelconfig:execute permission.

→
Mutation

importMLModelConfig

Import an ML model config from JSON or YAML. Requires mlmodelconfig:write permission.

→
Mutation

predictMLModel

Run a prediction using a trained ML model. Requires mlmodelconfig:execute permission.

→
Mutation

forecastMLModel

Forecast future values using a trained time-series model. Requires mlmodelconfig:execute permission.

→
Mutation

retrainSystemModels

Manually trigger retraining of all system-managed ML models for the current tenant. Requires mlmodelconfig:execute permission.

→
Mutation

publishMLModelVersion

Set a version as the published version used for predictions. Requires mlmodelconfig:write permission.

→
Mutation

createChatSession

Create a new chat session. Requires chatsession:write permission.

→
Mutation

updateChatSession

Update an existing chat session. Requires chatsession:write permission.

→
Mutation

deleteChatSession

Delete a chat session. Requires chatsession:delete permission.

→
Mutation

sendChatMessage

Send a message to a chat session and receive an AI response. Requires chatsession:write permission.

→
Mutation

clearChatMessages

Clear all messages from a chat session. Requires chatsession:write permission.

→
Mutation

createConcept

Manually author a concept in the ontology. Requires concept:write permission.

→
Mutation

updateConcept

Rename or reclassify an existing concept. Requires concept:write permission.

→
Mutation

deleteConcept

Delete a concept. Requires concept:delete permission.

→
Mutation

createKnowledgeNote

Contribute a knowledge note about a concept or an entity. Requires knowledgeNote:write permission.

→
Mutation

updateKnowledgeNote

Edit a note's body or scope, or supersede it with a replacement. The attachment is immutable. Requires knowledgeNote:write permission.

→
Mutation

confirmKnowledgeNote

Endorse a note: increments its confirmation count (raising its retrieval trust weight) and promotes a PENDING note to LIVE. Requires knowledgeNote:write permission.

→
Mutation

deleteKnowledgeNote

Delete a note and any graph edges it sourced. Requires knowledgeNote:delete permission.

→
Mutation

markKnowledgeNotesContradict

Record that two notes contradict each other; the conflict is surfaced by `retrieveKnowledge` via `KnowledgeHit.contradicts`. Requires knowledgeNote:write permission.

→
Mutation

unmarkKnowledgeNotesContradict

Remove a previously recorded contradiction between two notes. Requires knowledgeNote:write permission.

→
Mutation

captureKnowledge

Capture a knowledge subgraph — concepts, a note, and instance/semantic edges — in one atomic transaction. The manual, deterministic core of knowledge capture; the Phase-2 LLM path produces this same input. `scope` is caller-controlled. Requires knowledgeNote:write permission.

→
Subscription

dataChangeEvents

Subscribe to real-time data change events. Requires read permission on each requested resource.

→
Subscription

mlModelTrainingStatus

Stream real-time training status events for an ML model config.

→
Subscription

chatMessageStream

Stream AI responses for a chat message in real-time. Emits chunks as they arrive. Requires chatsession:write permission.

→