At a previous company I worked for we had a component-based system with state-based AI. We had an AI component that controlled all behavior for that object/unit. When the AI was active, like wandering, attacking, etc, it would receive an update each frame to do any logic that was needed. When the AI was idling or not moving the component was deactivated and not updated each frame. The component, while deactivated, could still receive event-based messages, so it would receive a message for something like a player entering its aggro radius, and could respond to that by reactivating the AI component so that it could do frame-based updates.
The AI component has sub-components, that it could create and destroy on the fly, based on what type of actions it was performing. For example if it was wandering it could create a wandering sub-component and update that each frame while wandering, and then if aggro'd while wandering it would close that sub-component and open an attack sub-component. The AI component should be independent of all other components on an object. For example, we had an input component, that would simply query for movement values on a unit. The query it made was something that both human and AI objects would respond to. This allowed the AI component to simply set movement values on itself during things like wandering, that the input component could pick up on, just as a human controllable component would set values that the input component could pick up on. Things like this allow the AI component to be independent of any other component on the object.