Using AI chat bots with Weavy

Weavy has built-in support for AI chat bots. This allows users to engage with an AI in real-time, making Weavy not just a platform for human-to-human interaction, but also a comprehensive tool for information retrieval, task automation, and learning.

Configure Weavy

Before communicating with AI bots through Weavy it is essential to configure Weavy with an API key for the AI platform you want to utilize. See steps below for instructions:

Google Gemini
  1. Sign in to your account on https://ai.google.dev/
  2. Click Get API key
  3. Create a new API key and copy the result.
  4. Sign in to the Weavy account portal and configure the Gemini API key on your Weavy environment.
OpenAI
  1. Sign in to your account on https://platform.openai.com
  2. Click on API keys.
  3. Create a new secret key and copy the result.
  4. Sign in to the Weavy account portal and configure the OpenAI API key on your Weavy environment.

Create bot

Next you need to create a dedicated bot user. This step ensures that the AI bot operates as a recognized entity, distinct from human users. You create a bot with a call to the Users API as seen below:

curl https://{WEAVY-SERVER}/api/users
-H "Authorization: Bearer {API-KEY}"
--json "{ 'uid': 'clark', 'name': 'Clark', is_bot: true, 'metadata': {'family': 'OpenAI'} }"
  • uid: The unique identifier of the bot user.
  • name: The name of the bot. This is the name your users will use when @mentioning the bot.
  • is_bot: Must be set to true to indicate that this is a bot and not a human user.
  • metadata.family: Specifies the AI platform for the bot. Must be either OpenAI or Gemini.

Interact with bot

To effectively utilize a bot in Weavy, the bot must first be notified that its presence is required. To engage the bot within a comment, post or message, users must mention the bot by typing @ followed by the bot's name.

The need to mention the bot for activation allows for a controlled use of the bot's capabilities, making it an efficient participant in discussions where its input is relevant.

One exception exists, in a private chat with a bot, a user can engage directly with the bot without mentioning it. This is akin to chatting with another person, where messages are exchanged seamlessly between the user and the bot. The direct nature of this interaction allows for a more personalized experience, enabling the bot to provide tailored responses, support, and assistance based on the user's immediate needs and queries.

Use single bot mode in Messenger

The messenger can be used in a mode tailored for one-to-one chats with a bot. This limits the user to only create new conversations with the specified bot. This is a great way to keep track of AI conversations. You need to create a bot user and optionally link it to AI, then just specify the name of the bot to use the bot mode.

<wy-messenger bot="clark"></wy-messenger>

Troubleshooting

If your interactions with the bot is not working it usually comes down to one of these things:

  1. To use the Weavy chat bot integration, you need the Pro version of the building block you're adding it to.
  2. You haven't configured Weavy with a valid API key for the AI platform.
  3. The bot user was configured with an unsupported metadata.family or you forgot to set the is_bot property.
  4. The bot does not have permission to respond. This can happen if the bot user does not have write access in the app where you interacted. See apps and permissions.