Ramakrishna is a poet and scholar in Telugu and Sanskrit whose talents go unrecognized in his hometown. To earn a living, he travels to Hampi with his wife Kamala and their son Madhava. On the way, he stops at a Kali temple. The goddess’ idol unsettles him, and the ritual of animal sacrifices unsettles him further. That night, Kali appears and offers a boon: he must choose between wisdom or wealth. He longs for both, and Kali warns that he might become a Vikatakavi, a jester whose wisdom serves only entertainment. He accepts this as a blessing and pleads with Kali to shield him from future dangers before she disappears.
Ramakrishna reaches Hampi and seeks an audience with Tathacharya, the royal priest, to win a place in the court of Krishnadevaraya. They do not help him at first, and he leaves discouraged. Yet a chance arises when the king cannot divide 17 elephants among three brothers as dictated by their father’s will. Ramakrishna solves the puzzle and earns a position in the royal retinue. His wit and loyalty quickly earn him the respect of most courtiers, except Tatacharya, who views him as a problem to be managed.
The Deccan sultanates—Berar, Ahmednagar, Bidar, Bijapur, and Golconda—unite to wage war on Vijayanagara. They dispatch Kanakaraju, a spy and Ramakrishna’s distant relative, to Hampi. A few days later, Kanakaraju attempts to assassinate Krishnadevaraya, and Tatacharya uses the crisis to accuse Ramakrishna of harboring a spy. As Ramakrishna stands on the verge of execution, he overhears a private exchange between another spy and the court astrologer. The spy bribes the astrologer to persuade Krishnadevaraya to postpone the war with Bijapur, giving the sultanates time to prepare. Ramakrishna escapes and seeks help from Prime Minister Timmarusu, who helps reveal the astrologer’s trick. The astrologer is killed, and Tatacharya, who had trusted him, is blamed for treachery. Ramakrishna intervenes to save Tatacharya, mending their strained relationship.
The Bahmani Sultanate then sends the courtesan Krishnasani to Hampi. With her celebrated dancing skills, she captivates the king, who becomes consumed by her wit and sensual charm. He orders that anyone who enters his private chamber will be beheaded, and he spends months entangled with Krishnasani. Realizing the danger, Timmarusu and Ramakrishna uncover the sultanate’s plan to exploit the king’s isolation. Ramakrishna attempts to intervene, but is dismissed when the king perceives him as a rival. Meanwhile, Tirumala Devi, Krishnadevaraya’s wife, falls gravely ill, prompting the king to reassess his mistakes. Ramakrishna eventually enters Krishnasani’s chamber again, this time in the guise of a saint, and catches her red-handed with her spies. She kills herself, choosing a dignified death over capture. Ramakrishna then travels to Delhi to persuade Emperor Babur not to send his elephants to support the Sultanate.
In Delhi, Ramakrishna presents himself as an aging fakir and flatters Babur, ultimately depleting the emperor’s gold coins. Babur invites him to the palace and learns that this simple citizen of Vijayanagara would suffer if Babur’s forces joined the unjust war. Moved, Babur withdraws his elephants. The sultanates scramble to adjust, and Krishnadevaraya learns of Ramakrishna’s decisive actions from Timmarusu. Remorseful for his earlier judgments, Krishnadevaraya invites Ramakrishna back to the court, and the poet-loyalist accepts, ready to serve once more with the wisdom and wit that had both challenged and saved the empire.