Best way to integrate an external AI chatbot with Rocket.Chat?

I’m building an external AI chatbot called Rizz AI chatbot, currently running on my website.

I want users to interact with the AI directly inside Rocket.Chat (DMs or channels) and receive real-time responses from the AI API.

My questions are:

  1. Is the recommended approach using the Apps Engine, REST API with a bot user, or outgoing webhooks?
  2. What’s the cleanest way to forward messages to an external AI and send responses back?
  3. Any scalability or security best practices I should be aware of?

Rocket.Chat setup: (self-hosted/cloud + version)
Backend stack: (Node.js / Python / etc.)

Thanks for any guidance.