Chatbot History is Shared Between Different Assistants

Created on 6 December 2024, 13 days ago

Let me first say that I love the history feature, and I think its an excellent addition. I am looking forward to the upcoming database history feature.

My chatbots are all sharing the same history and conversations. I have 2 different examples of how mixing the history between bots is causing a conflict, that are easy to reproduce on my site. If these should be separate issues please let me know and I can split them. But they seem like part of the same issue so I will let someone else judge.
-------------------------------------------------
1. When changing pages
- Interact with any AI assistant placed in a block on a page.
- Go to a different page with a different AI assistant.
- The chat from the first bot appears in the history, and the second bot responds as though it engaged in the first conversation.

2. With 2 chatbots on the same page
- Place 2 different AI assistants in blocks on the same page.
- Force relative positioning with CSS so both assistants can be displayed in a block region, side-by-side.
- Interact with one bot
- The second bot tracks all of the interactions, but only one of the bots is able to answer questions.
- The bot that answers sometimes follows the instructions for the other bot.

🐛 Bug report
Status

Active

Version

1.0

Component

AI Assistants API

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @jbuttler
  • 🇩🇪Germany marcus_johansson

    This is a pretty glaring bug now that I see it. Just to verify - your issue is that you setup two chatbots and they share the history, correct? The session is at the Assistant API level at the moment, however I think they share the temp session id.

    So just to be clear - setting up two chatbots with the same assistant will have the same effect on purpose, however setting up two chatbots with different assistants would be buggy currently.

  • 🇩🇪Germany marcus_johansson

    You are clear in your comment title, sorry. Will work on this.

  • 🇩🇪Germany marcus_johansson

    There is a fix on dev for the first case, which is the bug part and is part of the assistants api. Please recheck on the latest dev release @jbuttler and set this to fixed if it works. Thanks.

    The 2nd case is not a bug per sé, it is how the chatbot was working - thats why its fixed to one location.

    Since we most likely will switch this to something we don't have to maintain ourselves and move the current one into a contrib module if someone has interest in maintaining it, just the first case is fixed in this issue. The second case can be fixed if it becomes a contrib module and someone is interested in fixing this.

    See: https://www.drupal.org/project/ai/issues/3492048 🌱 Implement a proper javascript framework based Chatbot. Active

  • I tried the dev version, and everything seems to be working properly. Each assistant remembers their own session history and it is not shared with other assistants. Issue #1 is resolved for me!

    I am still experiencing the same issue for number 2. I realize there are probably not a lot of use cases for most people. Thanks for the speedy fix!

Production build 0.71.5 2024