iMessage (well, Messages.app) is scriptable on the Mac via AppleScript (see https://github.com/lazerwalker/hubot-imessage). Figuring out how to scale it might be tricky, but for the time being they could be using some Mac scripts to intercept the iMessages, shoot them off to the appropriate assistant via some other interface, and then send the resulting iMessages back through the same Mac interface.