Assistance Needed with Integrating Rasa Chatbot, Node-RED, and SQLite

Hello Node-RED Community,

I am currently working on a project that involves integrating a Rasa Chatbot with Node-RED for executing SQLite database queries. As I'm quite new to this, I've encountered some challenges and would greatly appreciate any guidance or advice from the community. Here's what I've done so far and where I'm facing issues:

  1. Project Setup:
  • I've created a Rasa Chatbot using the basic setup without any Python code, mainly using .yml files. The setup is based on the "Moodbot" example from Rasa.
  • In Node-RED, I'm using two plugins: node-red-contrib-rasa-actionserver to establish an interface between Node-RED and Rasa, and node-red-node-sqlite for performing simple queries on a local SQLite database.
  1. Current Status:
  • The SQLite query I intend to run is: SELECT * FROM DATA ORDER BY TIMESTAMP.
  • I'm struggling to set up the communication between the Rasa Chatbot and Node-RED correctly, particularly with configuring the HTTP nodes (http in and http response) in Node-RED and ensuring they work seamlessly with Rasa actions.
  1. Specific Challenges:
  • I'm unsure how to correctly define and use the http in and http response nodes in Node-RED to handle requests from the Rasa chatbot.
  • I've also encountered a validation error in Rasa stating "Project validation completed with errors," and I'm struggling to pinpoint the exact issue.
  • I'm having a issue with understanding how the custom actions work and how I integrate them into my .yml file. Especially when it comes to where do i invoice that class from my custom action? I tried to connect via that custom action to Node-Red, but didnt work

I'm seeking advice on the following:

  • Detailed steps for configuring Node-RED nodes, especially the HTTP nodes, to work with Rasa.
  • Insights into troubleshooting the Rasa validation error.
  • Any best practices or tips for beginners in integrating Rasa with Node-RED and SQLite.

I uploaded the .yml files and the actions.py files that I changed

Any help or suggestions would be highly appreciated. I'm eager to learn and make progress in this exciting project.

Thank you in advance!

Hi @Heezed !
Welcome to this forum!

Well. You posted nothing (in the sense of 'no flow data') here - but described an interesting challenge.
I'm sure, people would try to support once you show what you've setup so far...
You may export your flow via a function in the hamburger menu (top right corner). Remember to fence your .json data with backticks when you post it here!

```
your code goes here
```

Thanks for your answer @ralphwetzel !

Surely im posting my flow here:

[
    {
        "id": "b96b5846f72f9b2f",
        "type": "tab",
        "label": "Flow 8",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "5a33369f07b87655",
        "type": "http in",
        "z": "b96b5846f72f9b2f",
        "name": "",
        "url": "/actionserverdb",
        "method": "post",
        "upload": false,
        "swaggerDoc": "",
        "x": 160,
        "y": 100,
        "wires": [
            [
                "892ceae22d77436b",
                "e4a589abd979e416"
            ]
        ]
    },
    {
        "id": "ab035e54d3080df3",
        "type": "sqlite",
        "z": "b96b5846f72f9b2f",
        "mydb": "229a148799475e20",
        "sqlquery": "msg.topic",
        "sql": "",
        "name": "",
        "x": 790,
        "y": 100,
        "wires": [
            [
                "1b3be995b7ca8856",
                "548c43ccc468353c"
            ]
        ]
    },
    {
        "id": "892ceae22d77436b",
        "type": "function",
        "z": "b96b5846f72f9b2f",
        "name": "function 2",
        "func": "\nmsg.topic = \"SELECT * FROM DATA ORDER BY TIMESTAMP\";\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 360,
        "y": 100,
        "wires": [
            [
                "ab035e54d3080df3"
            ]
        ]
    },
    {
        "id": "a447b11f7eca77c3",
        "type": "http response",
        "z": "b96b5846f72f9b2f",
        "name": "",
        "statusCode": "",
        "headers": {},
        "x": 1390,
        "y": 100,
        "wires": []
    },
    {
        "id": "e4a589abd979e416",
        "type": "debug",
        "z": "b96b5846f72f9b2f",
        "name": "debug 19",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 260,
        "y": 260,
        "wires": []
    },
    {
        "id": "1b3be995b7ca8856",
        "type": "debug",
        "z": "b96b5846f72f9b2f",
        "name": "debug 20",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1140,
        "y": 300,
        "wires": []
    },
    {
        "id": "548c43ccc468353c",
        "type": "function",
        "z": "b96b5846f72f9b2f",
        "name": "function 3",
        "func": "let queryResults = msg.payload; // Annahme: payload enthält die Ergebnisse der Abfrage\nlet responseText = \"Hier sind die Daten: \\n\";\n\n// Konvertiere das gesamte Array in einen String\nresponseText += JSON.stringify(queryResults, null, 2); // Der zweite Parameter sorgt für eine schön formatierte Ausgabe\n\nmsg.payload = {\n    responses: [\n        { \"text\": responseText }\n    ]\n};\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1220,
        "y": 100,
        "wires": [
            [
                "d9bf0f288c7e3429",
                "a447b11f7eca77c3"
            ]
        ]
    },
    {
        "id": "d9bf0f288c7e3429",
        "type": "debug",
        "z": "b96b5846f72f9b2f",
        "name": "debug 21",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1360,
        "y": 300,
        "wires": []
    },
    {
        "id": "229a148799475e20",
        "type": "sqlitedb",
        "db": "C:\\Users\\Fabian Stok\\sqlite\\sqlite-tools-win-x64-3440200\\onlineshoptest.sqlite",
        "mode": "RWC"
    }
]

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.