Class ComposedAgent
java.lang.Object
com.inductiveautomation.ignition.common.ai.ComposedAgent
- All Implemented Interfaces:
Agent
Agent composed from named slots — a preamble and framing for the system prompt, a series
of ToolBundles, and a series of AdditionalContextParts. All slots are evaluated
once when ComposedAgent.Builder.build() is invoked; freshness comes from the surrounding Agent.AgentFactory rebuilding the agent at each click.
A builder seeded with a base agent extends that agent additively: the base's system prompt is rendered before any builder-supplied preamble/framing, the base's tools are placed before builder-supplied bundles, and the base's additional context is prepended to builder-supplied sections. Identity (typeId, name, description) and the turn limit default to the base's values; any may be overridden via the matching builder method.
Example — extending a base agent the caller already holds:
Agent agent = ComposedAgent.builder(baseAgent)
.typeId("com.example.scripting.extension")
.framing(EXTENSION_FUNCTION_BODY_FRAMING)
.contextSection("Function signature", () -> renderSignature(descriptor))
.contextSection("Caller context", () -> callerContext)
.build();
Factories such as PlatformAgentFactory return a pre-seeded ComposedAgent.Builder directly,
so callers chain customizations on the factory result without re-wrapping through this static.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface Agent
Agent.AgentFactory -
Method Summary
Modifier and TypeMethodDescriptionstatic ComposedAgent.BuilderSeeds a builder that extendsbaseadditively.static ComposedAgent.BuilderSupplemental context to be folded into the prompt (e.g.Human and Agent readable description used in logs and routing.intMaximum number of model turns — tool-calling rounds — the harness runs in a single invocation before it stops the loop.getName()Human-readable name used in logs and routing.System prompt that primes the model for this agent's role.getTools()Callable tools exposed to the model.Stable type identifier for this agent type.
-
Method Details
-
builder
- Parameters:
typeId- stable type identifier for this agent type. Useful for diagnostics and routing.name- human-readable name used in logs and routing.- Returns:
- a new builder seeded with the given identity.
ComposedAgent.Builder.descriptionmust be called beforeComposedAgent.Builder.build().
-
builder
Seeds a builder that extendsbaseadditively. The base's system prompt becomes the outermost layer of the rendered prompt; its tools are concatenated before any builder-supplied bundles; its additional context is rendered before any builder-supplied sections. Identity (typeId, name, description) and the turn limit default to the base's; callComposedAgent.Builder.typeId,ComposedAgent.Builder.name,ComposedAgent.Builder.description, orComposedAgent.Builder.maxTurnsPerInvocationto override.- Parameters:
base- the agent to extend; its accessors are read atComposedAgent.Builder.build()time.- Returns:
- a new builder seeded from
base.
-
getTypeId
-
getName
-
getDescription
Description copied from interface:AgentHuman and Agent readable description used in logs and routing.- Specified by:
getDescriptionin interfaceAgent
-
getSystemPrompt
Description copied from interface:AgentSystem prompt that primes the model for this agent's role.- Specified by:
getSystemPromptin interfaceAgent
-
getTools
Description copied from interface:AgentCallable tools exposed to the model. Typically built fromTool-annotated methods viaTools.fromAnnotated(Object...), but may include hand-rolledCallableToolimplementations. Returns an empty list if the agent declares no tools. -
getAdditionalContext
Description copied from interface:AgentSupplemental context to be folded into the prompt (e.g. project state, schema, current selection), or empty if none is provided.- Specified by:
getAdditionalContextin interfaceAgent
-
getMaxTurnsPerInvocation
public int getMaxTurnsPerInvocation()Description copied from interface:AgentMaximum number of model turns — tool-calling rounds — the harness runs in a single invocation before it stops the loop. A single turn may run several tools at once, so this bounds rounds, not individual tool calls. Defaults to 20; agents backed by user config override this with their configured value. The harness additionally caps this at its own hard ceiling.- Specified by:
getMaxTurnsPerInvocationin interfaceAgent
-