Cook the onions and tomatoes in a covered cast iron pot until reduced to a purée. Season with ginger, licorice, Worcestershire sauce and soya sauce.
Remove 330 ml of the purée and stir in the agar-agar, stirring to dissolve until it reaches an elastic consistency; set aside.
Cut into rectangles and cover with the chopped nuts, pressing them in well. Pass quickly under the grill or into the skillet and cut each rectangle diagonally to obtain two triangles. Set aside until needed.