A COGNITIVE ARCHITECTURE FOR AMBIENT INTELLIGENCE