Class NamedQueryAgent

java.lang.Object
com.inductiveautomation.ignition.designer.db.namedquery.workspace.ai.NamedQueryAgent
All Implemented Interfaces:
Agent

public final class NamedQueryAgent extends Object implements Agent
Agent powering the "Build with AI" popup on the Named Query authoring panel. The system prompt describes the wire format emitted by NamedQueryPromptComposer and the reply contract parsed by NamedQueryReplyRenderer — three contracts in three files; if any one moves the other two must move with it.

Exposes the NamedQuerySchemaTools lookups so the agent can ground its suggestions in the actual database schema. The tools self-report when the user has selected the Parameter datasource option, so we can register them unconditionally and let the agent learn at call time that no schema is available.

Also exposes the DatasourceTools lookups so the agent can ground its suggestions in the actual datasources available on the gateway when the user does not have a specific datasource selected.

  • Field Details

  • Constructor Details

    • NamedQueryAgent

      public NamedQueryAgent(Supplier<NamedQuerySnapshot> snapshotSupplier)
      Parameters:
      snapshotSupplier - supplies the panel's live state — passed through to the schema tools so they always resolve against the currently selected datasource rather than the one in effect when the popup opened.
  • Method Details

    • getTypeId

      public String getTypeId()
      Description copied from interface: Agent
      Stable type identifier for this agent type. Useful for diagnostics and routing.
      Specified by:
      getTypeId in interface Agent
    • getName

      public String getName()
      Description copied from interface: Agent
      Human-readable name used in logs and routing.
      Specified by:
      getName in interface Agent
    • getDescription

      public String getDescription()
      Description copied from interface: Agent
      Human and Agent readable description used in logs and routing.
      Specified by:
      getDescription in interface Agent
    • getSystemPrompt

      public String getSystemPrompt()
      Description copied from interface: Agent
      System prompt that primes the model for this agent's role.
      Specified by:
      getSystemPrompt in interface Agent
    • getTools

      public List<CallableTool> getTools()
      Description copied from interface: Agent
      Callable tools exposed to the model. Typically built from Tool-annotated methods via Tools.fromAnnotated(Object...), but may include hand-rolled CallableTool implementations. Returns an empty list if the agent declares no tools.
      Specified by:
      getTools in interface Agent
    • getAdditionalContext

      public Optional<String> getAdditionalContext()
      Description copied from interface: Agent
      Supplemental context to be folded into the prompt (e.g. project state, schema, current selection), or empty if none is provided.
      Specified by:
      getAdditionalContext in interface Agent