An agent is a CDI bean that encapsulates autonomous, goal-driven behavior. The agent's lifecycle, workflow, and actions are fully defined using additional annotations.
Agents support two scope annotations: WorkflowScoped and
@ApplicationScoped. If no scope annotation is present on the class, the
agent will be assumed to be WorkflowScoped.
A workflow context will still be created for each workflow execution even
when the agent is @ApplicationScoped, beginning with a trigger and in most
cases ending with an outcome.
Any conversational state maintained by injected
LargeLanguageModel implementations is expected to follow this
workflow context lifecycle.
- Since:
- 1.0
-
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionThe agent's description.The agent's name.
-
Element Details
-
name
String nameThe agent's name.If not specified, the simple class name with the first letter lowercased will be used as a default (e.g.,
MyAgentbecomesmyAgent).- Returns:
- the configured agent name, or an empty string to use the default derived name
- Default:
- ""
-
description
String descriptionThe agent's description.Used for documentation and discovery purposes.
- Returns:
- the agent description, or an empty string if none is provided
- Default:
- ""
-