memoryTools function

List<AgentTool> memoryTools(
  1. MemoryController? controller, {
  2. void onChanged()?,
})

Returns the three memory tools backed by controller. memory_add is write-tier; memory_search and memory_list are read-tier. onChanged fires after every successful memory_add — hosts use it to refresh the prompt's cached <memory> section.

Implementation

List<AgentTool> memoryTools(
  MemoryController? controller, {
  void Function()? onChanged,
}) {
  if (controller == null) return const [];
  return [
    _memoryAddTool(controller, onChanged),
    _memorySearchTool(controller),
    _memoryListTool(controller),
    _memoryDeleteTool(controller, onChanged),
  ];
}