code: def add_node(self, node):
          
          other_nodes = [n for n in self.nodes() if n.id != node.id]
          if len(self.nodes()) > 11:
              parents = [max(other_nodes, key=attrgetter("creation_time"))]
          else:
              parents = [n for n in other_nodes if isinstance(n, Source)]
  
          for parent in parents:
              parent.connect(whom=node)
docs: Add an agent, connecting it to the previous node.