Verses such as Devarim 28;9, and you shall walk in His ways, led Rambam to codify a Biblical obligation referred to as imitatio Dei, imitating Gd. Of course, human beings cannot imitate Gd, leading Rambam and others to explain the mitzvah as being to imitate the ways Gd is described. Just as Gd is rahum, for the example we’ll consider here, we are to be rahum.
Sources such as Sotah 14a speak of imitating actions, e.g., just as Gd visits the ill we should visit the ill, that might have led us to think the mitzvah is all about action. Rambam in the first chapter of Hilkhot De’ot, Laws of Character, made clear his (I think generally accepted view) the mitzvah involves developing traits of character. If Gd is referred to as rahum, the Torah means we should strive to be rahum. Part why Scripture describes Gd in such ways is to teach us to develop ourselves in those directions.
I have refrained from translating rahum so far because I think the dominant translations are misleading. We use words like compassionate or merciful, where many traditional readers understood the word differently (but not all; Maharal, for example, seems to read rahum in line with our general English language version of mercy or compassion).
There may be other good reasons for compassion and mercy in their plain senses, including Jewish ones. For this mitzvah, the goal is to become similar to the character Gd is described as evincing in His interactions with the world, making it vital to know the exact meaning of adjectives applied to Gd in Scripture.
In Guide for the Perplexed I;54, Rambam says Gd is referred to as rahum because Gd fosters conception, helps fetuses grow, protects them from damage, as a father is rahum to his children. In this version, a Jew working to be more similar to Gd’s being called rahum would help others come into being (parenting children him/herself, perhaps also help population initiatives or attempts to address infertility), succor them to adulthood, protect them enough to develop, bring them to self-sufficiency and successful launch. It might extend beyond one’s own children, perhaps even to animals. But, any other expressions of compassion seem outside the purview of rahum as a way to emulate Gd.
R. Hirsch also sees rahum as a matter of child-rearing. He says Gd never abandons the works of His hands, after endowing them with power and movement. Gd guards them lovingly, creation itself an expression of love.
Away from children but still fairly specific, a gloss printed on the side of Tosafot Rosh HaShanah 17b defines rahamim as caring to avert trouble before it comes. It adds that rahum is where the recipient deserves it (hanun expresses Gd’s “inability” to see and ignore suffering, a trait I am leaving for another time).
Radak to Tehillim consistently (86;15, 145;8, and 150;8) casts rahum as protection. R. Obadiah Sforno, the early to mid-sixteenth century Italian rabbi and Bible commentator, read rahum to mean Gd has compassion to lighten the punishment of the guilty who pray to Gd, and sees the troubles of the downtrodden. To prove the point, he cites Gd’s telling Moshe He had seen the pressure the Egyptians placed on the Jews. In both cases, the people in need called out before receiving the rahamim. Radak’s rahum is a matter of ameliorating others’ troubles when they ask for help.
Ta’anit 8a adds an element of the communal. The Gemara wonders at the contrast between R. Ami, who thought prayer must involve the supplicant’s whole and sincere effort, and Shemuel, who said Gd has rahamim despite prayers being offered insincerely and inattentively. It resolves the contradiction by saying Shemuel referred to a community, where R. Ami noted an individual’s higher bar to a good answer. Whatever eases a community’s way to Gd’s rahamim, it is a response to requests, not freely given kindness, mercy, or compassion.
There’s more; I am not here to be exhaustive or definitive. I only suggest we begin to realize we know less about what it means to be Gdly, in the halakhically important sense of fulfilling this mitzvah, than we think. Ordinary compassion or mercy may be good and laudable, but few of the commentators pointed to it as what it means to emulate Hashem’s being rahum. For we who wish to fulfill mah hu nikra rahum, af ata hevei rahum, just as He is called rahum, you be rahum, we have work to do.