withIdentity
Sets the agent’s core identity or purpose. The identity defines who or what the agent is. This should be a clear, concise statement that establishes the agent’s role, expertise, and primary function. This appears first in the generated prompt and frames all subsequent instructions.A description of the agent’s identity. Should be written in second person (“You are…”) or third person (“The assistant is…”). Keep it focused and specific to guide the model’s behavior.
The builder instance for method chaining
Example
withCapability
Adds a single capability to the agent’s skillset. Capabilities define what the agent can do. Each capability should describe a specific skill, action, or area of expertise. Multiple calls to this method will accumulate capabilities - they don’t replace previous ones.A single capability description. Should be action-oriented and specific enough to be meaningful but broad enough to be useful.
The builder instance for method chaining
Example
withCapabilities
Adds multiple capabilities at once to the agent’s skillset. This is a convenience method for adding several capabilities in a single call, equivalent to calling.withCapability() multiple times. Empty strings in the array are filtered out automatically.
An array of capability descriptions. Each should describe a specific skill or action the agent can perform.
The builder instance for method chaining