Interface AgentDefinition
AutonomousAgent.define() and returned from AutonomousAgent.definition().
The @Component description captures
the agent's purpose and expected outcome: a short statement of what the agent does, when to use
it, and what it produces. The runtime injects the description into the model's system message and
uses it when other agents need to choose a delegation or handoff target. The description is
mandatory for autonomous agents.
Instructions are optional supplementary text for tone, persona,
domain rules, or procedural guidance to the model, also appended to the system message.
Multi-agent orchestration mechanics (when to delegate, when to hand off, who to message) do not
belong in instructions — they are derived automatically from the capabilities and from the
descriptions of the participating agents.
Each fluent method returns a new immutable instance.
-
Method Summary
Modifier and TypeMethodDescriptioncapability(AgentCapability capability) Add a capability to this agent: task acceptance, delegation, etc.contentLoader(ContentLoader contentLoader) Sets a custom content loader.instructions(String instructions) Optional internal, LLM-facing instructions appended to the system message.mcpTools(RemoteMcpTools... mcpTools) Remote MCP tool endpoints available to the agent.modelProvider(ModelProvider provider) The LLM model provider for this agent.requestGuardrails(Class<? extends Guardrail>... guardrails) Guardrails evaluated on requests before they are sent to the LLM.responseGuardrails(Class<? extends Guardrail>... guardrails) Guardrails evaluated on responses received from the LLM.Adds one or more tool instances or classes that the agent can use.
-
Method Details
-
instructions
Optional internal, LLM-facing instructions appended to the system message. Use this for tone, persona, role, domain rules (for example "Always cite sources" or "Never quote prices in non-USD currencies"), or procedural guidance on how the model should approach a task. The agent's purpose and expected outcome belong in@Component description, not here.Multi-agent orchestration mechanics do not belong here. Coordination details such as when to delegate, when to hand off, or who to message are derived automatically from the capabilities and from the descriptions of the participating agents. If you find yourself writing "delegate to X first, then to Y, then synthesize," the work belongs in capabilities and task definitions instead.
-
capability
Add a capability to this agent: task acceptance, delegation, etc. -
modelProvider
The LLM model provider for this agent. -
tools
Adds one or more tool instances or classes that the agent can use.Each element can be either an object instance or a
Classobject. If aClassis provided, it will be instantiated at runtime using the configuredDependencyProvider.Workflows, Event Sourced Entities, Key Value Entities, and Views can also be used as tools. Unlike regular objects, component instances cannot be passed to this method. Instead, you must pass the component
Classobject.Each instance or class must have at least one public method annotated with
FunctionTool.- Parameters:
toolInstancesOrClasses- one or more objects or classes exposing tool methods
-
mcpTools
Remote MCP tool endpoints available to the agent. -
requestGuardrails
Guardrails evaluated on requests before they are sent to the LLM. -
responseGuardrails
Guardrails evaluated on responses received from the LLM. -
contentLoader
Sets a custom content loader.When multimodal messages contain image or PDF references, the runtime resolves them automatically for built-in URI schemes:
http(s)://(public HTTP fetch) andobject://bucket/key(resolved against a configured object-storage bucket). Defining a custom loader is for other cases, such as authenticated endpoints, databases, or custom URI schemes.- Parameters:
contentLoader- The content loader implementation- See Also:
-