Flowise Database - Use MySQL and SQLite to export Flowise Messages to Excel for FREE

8.67k views1439 WordsCopy TextShare
AI Agents by BUSINESS24 AI
Flowise supports SQLite, MySQL/MariaDB and PostgreSQL to store the data. In this Tutorial we use SQL...
Video Transcript:
in this tutorial we have two instances of flow wise running on the same machine one on Port 3000 with an sqlite database and one on Port 3001 with a Maria DB database in this databases we see all of the user messages and the API messages and can create views filter and Export the data when we use the flow wise chat box the user prompt and the answer from the llm are stored in the database for more information navigate to the flow wise docs and to the database section flow wise supports SQL light MySQL or Maria
DB and postgress SQL using type orm in this tutorial we use the default sqlite database and Maria DB Maria DB is similar to mySQL but not the same to use marad DB directly with flow wise you need to do some adjustments and change the collation watch till the end of this tutorial to be able to use flow wise with the Maria DB included and shipped with zamp there are many database tools here we use the free portable version of Heidi SQL but feel free to choose your favorite database tool when we open hsql for the
first time we have to create a new session or database connection first we want to set up the SQL light session we name the session flow wise SQL light and choose SQL light from the dropdown of supported databases next we select the database file which is located in the root folder of the current user in theflow Wise folder with the name database.sql light we save the configuration and open the session let's explore the stored data by flow wise in the database first we have chat uncore flow table where we can see the name of our
chat flows and some UI configurations then we have chatore message table where we can see the role of the message and the content then we have the credential and migration table and finally the tool table here we see the name of the tool the description and the Sha and even the defined JavaScript function if our needed information is stored on multiple tables we can easily create a view and join the tables for example if we want to see the name of the chat flow beside the message role and content we can easily create a view
we name it view chatore flowcore message and start creating with a symol select statement then we choose CF as Alias for the chatore flow table and select only the name fied from CF next We join CF with chatore message alas cm and choose the role field and the content field from the CM and Save The View when we go to the data tab we see the information the way we want it to have if you want you can set a filter on The View for example to show all of the messages containing the word alarm
after the data is filtered we can select the rows and if we like export them as a CSV file to the desktop and open it later using using Excel to analyze the data further to have a better understanding of the data stored in the database you can start flow wise and see the configuration in the flow wise UI in the UI you can find the four chat flows stored in the chatore flow table in the database some of them have custom tools and you can see all of them in the tools menu the information of
the tools shown in the UI comes from the tool table Square light is the default database but you can use other databases like MySQL or Maria DB or postgress SQL zamp in the past had MySQL as the database but in the recent versions Maria DB is used instead of MySQL the setup of Maria DB is out of the scope of this tutorial but after installing examp you can set up a user in Maria DB for flow wise in our case we set up the user uncore flow wise the next step is to clone flow wise
get the address from the repository on GitHub and clone it to the folder flow wi- db- MySQL we change to the new folder and from within the folder we start Visual Studio code in Visual Studio code we navigate to packages server and copy and paste. nf. example and rename it to NF here we Define another Port like 3001 and enter our MySQL or Maria DB configuration use the userflow wise for database user and flow wise for database name if you check the the database migration for MySQL we see that utf8 mb4900 aici is used as
collation this collation exist in MySQL but it doesn't exist in Maria DB so we must adjust it later but first we need to install the packages we go to the root of our project and type yarn install this takes some time when all of the packages are installed the prompt comes back and we can clear the screen before we use yarn build we need to set up our database otherwise we get some errors when we start flow wise so we open hsql again and this time we create a new session to our Maria DB database
we save and open the connection we create a database and give it the name flow wise just like our configuration if you use MySQL you can choose the collation utf8 m4900 C AI as used in the migration script but if you use Maria DB this colation does not exist and we need to choose utf8 M4 Unicode 520 C instead and create the database back in visual Studio code we search for utf8 mb4900 C aai and see it is used four times in one file we open the file and use contrl D to select all four
accur and change all of them together to the new collation we used in Maria DB and save now you can use yarn build and wait till the build process is finished after the build is finished and the prompt comes back you can clear the screen and type yarn start please notice that this instance of flow wise listens to Port 3001 and uses Maria DB as database instead of the default SQL light when you navigate to Local Host Port 3001 you see the flow wise UI with no chat flows whereas if you open ol host 3000
you see the othered instance of flow wise with four chat flows in our new flow wise installation we go ahead and create a simple conversation chain after adjusting the components on the canvas we enter our open AI API key in the chat open Ai and reduce the temperature to 0.2 to be more deterministic when we are done with the configuration we save the chat flow and give it a name like flow wi- db- MySQL now we can test our chat flow and ask what is a collation in myql and get back some information from chat
GPT about collation and why and how we use them next we ask the differences between utf8 mb4 900 Cai and utf8 mb4 unicode 520 C and again Chad GPT patiently explains us the differences and when and how to use them now that we have a chat flow and some messages on the new flow wise installation on Port 30001 it's time to check the databases and compare the tables we can first open our session to the SQL light database and then add the session to our Maria database in the same window so that we can easily
compare them together in the Maria DB database we have only one chat flow whereas in the SQL light database we have four chat flows there are a lot of messages in SQL light database and in the Mario DB database we only see four messages about collations to wrap it up flow wise stores the data used in the web UI in a database it can store this data in different kinds of databases using type orm the default database is SQL light located in the root of the current user in a folder called dot flow wise you
can simultaneously run multiple flow wise instances with different databases you can create views query filter and Export flow wise messages without using any tokens this will help you debok and monitor your chat flows for free good luck
Copyright © 2024. Made with ♥ in London by YTScribe.com