Agent handling with UI