A Hierarchical Framework for Collaborative Artificial Intelligence