Critical Changes
Message Factory API Changes
TheMessage class is now a pure factory class with only typed static factory methods. The following methods have been removed:
Find Message::create() occurrences
Replace with typed factory methods
Replace Message::fromArray()
Replace Message::fromJSON()
Available Factory Methods
ToolResultMessage Constructor Signature
The constructor now accepts$toolName as an optional third parameter.
Find ToolResultMessage usages
Update constructor calls
ToolCallMessage Constructor Signature
TheToolCallMessage constructor no longer accepts the $message array parameter.
Find ToolCallMessage usages
Update constructor calls
ChatHistory Interface Changes
Key Changes
getMessages()now returnsMessageArrayinstead ofarray- Several methods have been removed from the interface
- New truncation system replaces manual context window management
Removed Methods
Update getMessages() usage
Replace context window methods
Replace chat key management
Agent Class Changes
Removed Properties and Methods
Removed Properties
Removed Methods
Renamed Methods
Available Methods
These methods fromHasContext trait are available:
Update method calls
Remove includeModelInChatSessionId usage
Replace contextWindowSize with truncationThreshold
New Context System
LarAgent v1.0 introduces a new Context System that manages all storages (chat history, state, identities) through a unified interface.New Properties
Config Property Renames
Update your published config file (config/laragent.php):
Driver and Configuration Changes
DriverConfig DTO for Custom Drivers
DriverConfig DTO internally instead of plain arrays.
Update constructor signature
Update config access
Update sendMessage signatures
Custom ChatHistory Implementations
ChatHistoryStorage instead of the old ChatHistory abstract class.
Update your custom history class
Create custom StorageDriver (if needed)
New Features
Message IDs and Timestamps
All messages now have unique IDs and timestamps:Message Extras
Store driver-specific or custom fields:Usage Tracking
Enable automatic token usage tracking:Truncation Strategies
Automatic conversation truncation when context exceeds threshold:Context Facade
New facade for managing storage outside of agents:DataModel Classes
Use DataModels for structured output:Quick Migration Checklist
Message API Changes
Message API Changes
- Replace all
Message::create()with typed factory methods - Replace all
Message::fromArray()with specific message classfromArray() - Update
ToolResultMessageconstructor calls to include$toolName - Update
ToolCallMessageconstructor calls to remove$messageparameter
Agent Properties & Methods
Agent Properties & Methods
- Replace
$contextWindowSizewith$truncationThreshold - Remove
$saveChatKeys(now automatic via Context system) - Remove
$includeModelInChatSessionIdand related method calls
Configuration
Configuration
- Update provider config
default_context_window→default_truncation_threshold - Update provider config
chat_history→history
Custom Implementations
Custom Implementations
- If custom drivers: update constructor to call
parent::__construct($settings) - If custom chat history: refactor to use
ChatHistoryStoragewith custom driver

