The-Commit-Company / raven

Simple, open source team messaging platform
https://www.ravenchat.ai/
GNU Affero General Public License v3.0
319 stars 132 forks source link

Proposal to Implement Matrix Conduit backend in Raven Chat #585

Closed blaggacao closed 8 months ago

blaggacao commented 11 months ago

Dear Team,

I would like to propose the adoption of a Matrix implementation, specifically reliable Conduit, as chat backend for the Raven Chat Frappe App. Matrix is an open standard for interoperable, real-time communication over IP, and Conduit is a popular Matrix homeserver written in reliable Rust. Here are several reasons why this implementation would be beneficial for your project, particularly in terms of maturity and the ecosystem of clients for desktop and mobile:

  1. Maturity and Ecosystem: Matrix has evolved into a mature communication protocol with a rich ecosystem of clients for desktop and mobile. This means that by using Conduit for Matrix, we can leverage a well-established and diverse set of applications that support the Matrix protocol. This includes a variety of feature-rich clients for different platforms, providing a seamless and consistent user experience across devices. (For free, such as e.g. fluffychat)

  2. Interoperability: Matrix provides interoperability between different chat platforms, allowing users to communicate across various services. By adopting Conduit for Matrix, we can ensure that Raven Chat is compatible with a wide range of existing Matrix clients, enhancing its usability and accessibility for our users. (e.g. a Whatsapp, telegram, signal, and other bridges exist)

  3. Community Support: Matrix has a thriving open-source community with active development and support. By leveraging Conduit, we can benefit from the ongoing improvements and security enhancements driven by the Matrix community, ensuring that Raven Chat remains robust and up-to-date. (see various home server implementations)

  4. Customization: Conduit, being an open-source Matrix server, allows for customization and integration with widely deployed, existing infrastructure. This would give us the flexibility to tailor the solution to the specific needs of a business and integrate it seamlessly with the Frappe App, while also benefiting from the broader Matrix ecosystem. (for example developing bots with a well-documented bot framework — e.g. a devops bot)

I believe that adopting Conduit for Matrix in Raven Chat would not only align with the project's need for a mature and well-supported communication solution but also position the Raven Chat App as part of a larger, interconnected communication ecosystem. Many open source mobile and desktops apps are available bringing these value proposition faster to your user while not precluding releasing a dedicated app in the future.

Having a company-wide home server running in production for our chat needs, I look forward to discussing this proposal further and am open to addressing any concerns or questions regarding the integration of Matrix into Raven Chat.

Cheers!

nikkothari22 commented 11 months ago

Hey @blaggacao

Thank you for the suggestion!

We are currently working on a tight integration with other Frappe apps - and we want this (at least in the near term) to be a chat app for the workplace (like Slack or Teams) rather than for personal use or running communities (great apps like WhatsApp, Telegram and Discord exist for those use cases). So this is not currently in our plan, but we can explore this at a later stage for sure.

blaggacao commented 11 months ago

Thanks for your reply!

I can see where you're coming from and where you're heading! That sounds like an exciting direction, tight integration with other Frappe apps in particular.

I may provide some additional thoughts about some of the premises you mentioned above:

  1. For Workplace - In fact Matrix is being used by many companies (including ours and promiently the german & other europan military). So in a sense, the protocol is very suited to be run within the context of a workplace and does not need to be open to the world. For example, our own deployment only allows active Frappe users to log in via SSO (while still chatting to clients via the WhatsApp bridge in our B2C case, btw).

  2. Viability - Matrix, in reality, is just a fully developed chat protocol that has well-specified message types and primitives for almost any chat need, such as editing, and many more. So leveraging it could reduce the effort of reinventing these primitives on a as-needed basis, but without compromising the current integration approach into Frappe.

  3. Ecosystem Tools - Conduit is a very specific personal suggestion of mine, knowing that ecosystem. But, as described in the previous point, by no means would it be necessary to run a "foreign" back-end implementation like Conduit, while still being able to leverage the Matrix specification (or parts thereof). Should you nonetheless want to explore such integration with foreign components, I believe that the Virtual Doctype could be an excellent approach to reach a very tight integration to configure / puppet and manage a compliant open source Matrix server. Examples could include to configure the matrix server via Frappe Doctypes, have a message log mirrored into frappe for admin work, manage and puppet the life-cycle of chat bots and similar.

I understand that such a suggestion may be quite tangential to the current flow and direction of the development. I don't want to convince you to take a different approach because it may be even unfeasible at this point in time. But I want to prompt you to the alternatives that exist and to ways how you could significantly leap-frog the development of Raven App and position it very attractively in the Workplace Chat App space.

Anecdotally, from a previous company where I worked: Had we had something like Raven (resembling Slack), the company would have quite likely taken the decision to roll out Matrix as a Slack substitute across the entire organization. :rocket: (but neither Raven nor Matrix on it's own; the lack of intersection / amalgamation herein proposed was a critical decision blocker for Matrix while Raven wouldn't have been mature enough on it's own)

nikkothari22 commented 11 months ago

I think the integration with the Matrix protocol could be done in parallel (or a separate module altogether), but we just don't have the bandwidth to work on it now. Someone could potentially take that up I guess.

Most of the requirements that we get now is tight support with Frappe and specifically ERPNext where we want users to be able to chat within the Desk interface and regular users to be able to design workflows etc with Frappe doctypes. That's our current focus.

Having said that, Raven isn't mature enough yet - but thanks for bringing this up. I haven't looked at Matrix in depth yet. I will and I think that'll help us in planning new features on Raven better.

blaggacao commented 11 months ago

I currently can't afford to give it a try myself, short term. But if I would, I'd be looking at converging the message data formats somehow. I think with messages roughly of a similar shape, then the next steps could come more intuitively. Imagine if messages already align, then simply swapping them for a Virtual DocType against a CRUD interface towards a matrix home server. Then take it from there. I wish I had more time LOL :smile:

nikkothari22 commented 8 months ago

Closing this for now.