AbstractGets the timestamp when this entity was created.
Gets the timestamp when this entity was last updated.
Protected AbstractexecuteProtectedMain execution method for the agent. Must be implemented by concrete agent classes.
This method is called internally by executeWithEvents() and should contain the core agent logic. Domain events are automatically recorded by the wrapper.
The input data for the agent
A promise resolving to the agent result
Executes the agent with automatic domain event recording. This is the public method that should be called by orchestrators and clients.
Records the following events:
The input data for the agent
A promise resolving to the agent result
Protected OptionalbeforeOptional hook called before execution
The input that will be executed
Protected OptionalafterOptional hook called after successful execution
The execution result
Protected OptionalonOptional hook called when an error occurs
The error that occurred
Sets the execution context for this agent
The execution context
Sets the memory system for this agent
The memory implementation
Sets the retry configuration for this agent
The retry configuration
Sets the execution timeout for this agent
Timeout in milliseconds
Executes the agent with automatic retry logic
The input data for the agent
A promise resolving to the agent result
ProtectedrememberStores a value in agent memory
The key to store under
The value to store
Memory type: 'short' for session, 'long' for persistent
ProtectedrecallRetrieves a value from agent memory
The key to retrieve
The stored value, or null if not found
ProtectedsearchSearches memory semantically
The search query
Maximum results to return
Array of relevant values
ProtectedforgetRemoves a value from memory
Type of memory to clear
Gets the agent's unique identifier
Checks if this agent has a specific capability
The capability to check for
Gets agent metadata as a plain object
ProtectedrecordProtectedRecords a tool used event Should be called by subclasses when they use tools
Name of the tool used
Arguments passed to the tool
OptionaltoolResult: unknownResult from the tool execution
ProtectedrecordProtectedRecords a domain event that occurred within this aggregate. Events are stored internally and can be retrieved later for publishing.
The domain event to record
Retrieves and clears all domain events recorded by this aggregate. This is typically called after the aggregate is persisted, to publish the events.
An array of domain events
Checks if this aggregate has any recorded domain events.
true if there are pending domain events, false otherwise
ProtectedtouchProtectedUpdates the updatedAt timestamp to the current time. Should be called whenever the entity's state changes.
Compares this entity with another for equality based on identity. Two entities are equal if they have the same ID and are of the same type.
The other entity to compare with
true if the entities are equal, false otherwise
Abstract ReadonlynameHuman-readable name of the agent
Abstract ReadonlydescriptionDescription of what the agent does
Abstract ReadonlyversionAbstract ReadonlycapabilitiesCapabilities this agent has
Abstract ReadonlymodelLLM model configuration
Protected Optional_contextCurrent execution context
Protected Optional_memoryProtected OptionalretryProtected Optionaltimeout
Base class for AI Agents in the Stratix framework.
An AI Agent is an aggregate root that encapsulates AI capabilities, manages its own state, memory, and execution context.
Example