The beginnings of the Japanese state can be traced back to the Ritsuryo system. Implemented in phases starting in the 7th century and based on the government structure imported from Tang China, the Ritsuryo system codified the emperor’s role as the ruler of the land, its spiritual protector and administrative head responsible for the enforcement of Japan’s criminal and civil codes. The system, however, also did something much cooler. It established the creation of Japan’s bureau of magic staffed by literal tech-wizards. 

A statue of Onmyoji Abe no Seimei at Seimei Shrine in Kyoto | beibaoke via Shutterstock

Oh My Onmyoryo 

The Onmyoryo (the Bureau of Yin and Yang) was an official department in Japan’s Ministry of Central Affairs created by the Ritsuryo system. It underwent a couple of name changes and redefined its mission over the years but, in a nutshell, its role was to be the Imperial Court’s human smartphone that also protected it from evil spirits. Onmyoryo’s magic bureaucrats, called Onmyoji, were responsible for creating and keeping calendars, almanacs and clocks, as well as practicing astrology, astronomy and divination. 

The Onmyoji, eventually, were also tasked with performing various forms of magic, like summoning Ten’ichijin (also known as Ten’itsujin), one of the Twelve Heavenly Generals. Ten’ichijin was an especially important figure in the Onmyoryo because he was associated with directions and, consequently, geomancy. Though it sounds like something straight from a role-playing game, geomancy is simply the art of arranging the layout of settlements or structures to harness positive energies.  

Nara and Kyoto, Japan’s ancient capitals, were reportedly built on sites deemed auspicious under the principles of geomancy, like how Kyoto has Mount Kurama in the north, protecting it from malicious energies that tend to arrive from that direction. If this sounds suspiciously like feng shui, it’s because it totally is. 

Yin and Yang symbol | Altitude Visual via Shutterstock

The Mishmash Magic of Onmyodo 

The Onmyoryo’s Onmyoji practiced Onmyodo (try saying that three times quickly). Meaning “The way of the yin and yang,” it was only officially codified around the 10th century, prior to which it was a loosely connected set of magic beliefs sourced from all over the place. Its foundation is obviously Taoist, what with the yin and yang and feng shui elements, which Japan imported from China.

As previously mentioned, however, it also incorporated elements of Buddhism like Ten’ichijin, Shinto beliefs, Confucianism and local Japanese folklore. As a result, anything with even a whiff of the metaphysical, the spiritual and the unexplained was handled by ancient Japan’s bureau of magic. 

Onmyoji determined lucky days, told fortunes and performed exorcisms, among other tasks. It’s important, however, to note that they were never considered priests or holy men. While they eventually got to work alongside monks from the Office of Deities (Jingikan), which was responsible for the worship of gods, they were firmly outside of that structure and saw themselves as more akin to occult craftspeople.  

Without any sanctified veneer to their profession, they had no moral qualms about branching outside the Imperial Court and freelancing for any noble who needed demons exorcised from their property or advice on where to build their mansion. Yet for all their machinations with the mystical, Onmyoji were also scientists. 

Japan’s Bureau of Magic

Photo by Stray Toki via Shutterstock

Students of Science and Spirituality 

Onmyoji made significant contributions to the field of astronomy thanks to their detailed observations of the Moon, which were necessary for the proper keeping of the lunar calendar. Through this, they also recorded such events as an eclipse of the Aldebaran star and a preliminary outburst of a supernova that would be recorded in the West nearly a millennium later by the German astronomer and mathematician Johannes Kepler. Onmyoji were also adept at mechanical engineering. 

According to the Nihon Shoki, the second oldest written document in Japanese history, Prince Naka-no-Oe created the country’s first water clock in the year 660. Based on designs obtained from China through Korea, the original water clock was a series of containers, one stacked higher than the other, which continuously dripped water from one tank to the one below it. Once the water reached a mark inside a container, a gong would sound to announce that one unit of “time” had passed. It sounds simple in principle, but it required a lot of specialized knowledge that the clock-keeping Onmyoji had to figure out for themselves. 

The self-striking water clock was a marvel of engineering that used water containers, balls, pipes and a system of levers to strike a gong, bell or drum automatically every hour. Not every Onmyoji specialized in clock-making, but those who did were the very definition of “tech-wizards,” or “magic engineers,” if you will. In any case, the fact that their story still hasn’t been turned into a crazy clock-punk game or anime is a crime that we need to remedy right now.