Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Chatbot database RAG
#1
I am currently developing a chatbot to interact with an already existing database that is coded in MySql. As for the framework, I am using django and trying to implement async functionalities. I am stuck in a part of the code that handles the RAG request. The specific part is down below: Reference code.

Open the image in a new tab, in order to be able to zoom. The code is pretty extensive.

The problem is that when finishing the sql_database function and returning it to the load_process_database function, I get the error of:
Error:
Unexpected error during vectorstore initialization: DatabaseWrapper objects created in a thread can only be used in that same thread. The object with alias 'default' was created in thread id 23796 and this is thread id 28192. Error type: <class 'django.db.utils.DatabaseError'> Error args: ("DatabaseWrapper objects created in a thread can only be used in that same thread. The object with alias 'default' was created in thread id 23796 and this is thread id 28192.",)


Just so you know, this error was customised by me. That is why is says that the is an error during the vectorstore initialization.

The full file code is attached.
.txt   full_code.txt (Size: 19.76 KB / Downloads: 1)

Thank you in advance
Larz60+ write Mar-04-2025, 06:12 AM:
Rather than using attachments or external links, please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Reply
#2
Not sure if mysql supports vectors. Can you try with Postgre sql. It has vector support
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  building a chatbot that fetches data from mongodb using RAG saisankalpj 0 897 Jul-10-2024, 04:49 PM
Last Post: saisankalpj
  Chatbot AI mmagner2022 1 2,095 Jan-20-2022, 08:26 AM
Last Post: ibreeden
  Hi, I need some guidance with the dialogue for my chatbot aaron10500 0 1,802 Jun-22-2021, 02:38 PM
Last Post: aaron10500
  Chatbot metro17 1 2,204 Sep-27-2019, 01:02 PM
Last Post: Malt
  Chatbot with word2vec maik282 0 2,502 Apr-30-2019, 01:49 PM
Last Post: maik282

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020