Raven icon indicating copy to clipboard operation
Raven copied to clipboard

feat(ai): add send message raven ai function

Open prathameshkurunkar7 opened this issue 5 months ago • 1 comments

Add "Send Message" AI Function for Agent Communication

Overview

Introduces a new Send Message AI function that allows bots to send messages to users and channels mentioned in conversations.

Key Features

  • Message Targeting: Parses @username and #channel mentions from messages
  • Multi-format Support: Handles text content, file attachments, and document links
  • Auto-channel Creation: Creates DM channels for user mentions automatically
  • Validation: Ensures either content or file is provided

Technical Changes

  • Added send_message() function with mention parsing logic
  • Added extract_channel_mentions() method to RavenMessage class
  • Added current_message_id parameter passing in AI handler to let the bot know the current message which would contain the mentions.

Impact

  • Enables proactive bot communication workflows. In future we can use this function to handover tasks between agents.
  • Allows bots to notify relevant users about document updates, alerts, etc.
  • Supports multi-modal messaging (text, files, document links)

Video and Screenshots:

Expenso sends created expense claim to other user via mention(An example of us being able to send DocTypeLinks) -

https://github.com/user-attachments/assets/bbc525f7-4946-469d-9485-97bbb4d4d4a7

Report Wizard sends insights and charts generated to user and channel mentions -

CleanShot 2025-07-05 at 17 52 23@2x

CleanShot 2025-07-05 at 17 53 12@2x

CleanShot 2025-07-05 at 17 55 47@2x

CleanShot 2025-07-05 at 17 56 25@2x

prathameshkurunkar7 avatar Jul 04 '25 14:07 prathameshkurunkar7

This looks great.. Does this logic account for messages where the agent is explicitly mentioned (@agent_name) in channels?

mzndako avatar Sep 07 '25 23:09 mzndako