Class QueryBrowserAgent

java.lang.Object
com.inductiveautomation.ignition.designer.querybrowser.ai.QueryBrowserAgent
All Implemented Interfaces:
Agent

public final class QueryBrowserAgent extends Object implements Agent
Agent powering the "Ask AI" popup on the Query Browser. The system prompt describes the wire format emitted by QueryBrowserPromptComposer and the reply contract parsed by QueryBrowserReplyRenderer — three contracts in three files; if any one moves the other two must move with it.

Exposes the QueryBrowserSchemaTools lookups so the agent can ground its suggestions in the actual database schema. The tools self-report when no datasource is selected, so we 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

    • QueryBrowserAgent

      public QueryBrowserAgent(Supplier<QueryBrowserSnapshot> 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