The legend says that when Lord Buddha dies, King Ajatshatru was entrusted to safeguard his relics.
He hid them in an underground chamber near Patliputra (today’s Patna which is capital of state of Bihar).
Since the relics were priceless, he deployed guards which were extraordinary to safeguard them.
These guards were robots, not humans.
Since they could move on their own, they were called ‘Bhoot Vahan Yantra’, which meant machines which are being moved essentially by a spirit.
The legend further says that, the robots were meant to be on their ‘duty’, until a future king would distribute the relics, throughout the empire.