An Architecture for Building Multi-Agent Systems