A cognitive architecture for ambient intelligence systems