Matrix Bot

Last modified by Michael Hamann on 2024/05/28 16:41

Description of the feature in the proposal:

An integration of the JavaScript API in Matrix as a plugin that will ease conversations with WAISE directly from this widely used Matrix chat UI and infrastructure.

The integration of WAISE capabilities directly into Matrix will bring productivity gains to users by allowing to interact with WAISE from a chat room to submit questions to a wiki and conversely for asking WAISE to summarize chat discussions and to store them in the wiki. Such usages are relevant only if each user can access in view/edit mode only the documents he's allowed to view or modify indeed, hence the need for integration between WAISE  and an Access Control API.

Authentication and Authorization

Interacting from Matrix with XWiki poses important questions regarding authentication and authorization. There are three use cases for authentication:

  • both matrix and XWiki users are authenticated against the same user provider such that a user @user:example.com corresponds to a user that is, e.g., authenticated in XWiki with an LDAP UID or OpenID Connect subject of the same name. These users are the primary/only users for the bot.
  • users individually connect their matrix and XWiki account using some login flow.
  • all users or a configured set of users use the same (single) XWiki account, or more precisely, it should be possible to configure several accounts and for which users/rooms they should be used.

The first one is the simplest one that gives you individual user accounts and is probably the most interesting for wikis similar to company intranets where a single sign-on solution exists. The second is the most flexible one but requires explicit interaction of the users and is probably more appropriate for public wikis where the main use case is not to get access to content but to, e.g., enforce rate limits for users and ensure that if we have any features that allow modifying the wiki, edits are properly attributed.

In any case, we also need a solution for non-private chats where several users are present or that are even public. For that use case, a generic fallback account would probably be required.

In any case, it would be preferable that users are authenticated in XWiki through the bot such that regular XWiki authorization features can be used.

To allow the bot to authenticate as existing users it could be an idea to extend the token-based authenticator for the LLM Application to allow this. There could be a flag to use the information stored, e.g., by the OIDC authenticator to match the user from the token. That way, the bot could generate valid tokens for any user with just private key. While this brings security concerns, if all users of the wiki shall use the bot, it doesn't seem that bad.

(To be continued...)

Get Connected