File size: 9,347 Bytes
02bd2c6
 
 
acf53dd
02bd2c6
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
 
 
 
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
acf53dd
02bd2c6
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
{
  "edges": [
    {
      "id": "63a2f242-8e71-4098-a46a-459a76d538bd",
      "label": "",
      "source": "begin",
      "target": "answer:0"
    },
    {
      "id": "cc6dd8bb-e9dc-46e8-9009-5b96f98ae6c0",
      "label": "",
      "source": "generate:casual",
      "target": "answer:0"
    },
    {
      "id": "58dbf05a-07fc-4a0a-8c03-5f9117e48c35",
      "label": "",
      "source": "generate:answer",
      "target": "answer:0"
    },
    {
      "id": "dd0ff4f2-4d75-4e7d-a505-3e9533402823",
      "label": "",
      "source": "generate:complain",
      "target": "answer:0"
    },
    {
      "id": "3dc7a511-9cde-4080-a572-6b06a64e0458",
      "label": "",
      "source": "generate:ask_contact",
      "target": "answer:0"
    },
    {
      "id": "20e31fee-c392-4257-860a-5844d264198e",
      "label": "",
      "source": "message:get_contact",
      "target": "answer:0"
    },
    {
      "id": "104ac8bb-5d75-4eca-8065-1d8fc2805b8e",
      "label": "",
      "source": "answer:0",
      "target": "categorize:0"
    },
    {
      "id": "755864b5-9eef-44ec-a560-9a23b5a3f9ee",
      "label": "",
      "source": "categorize:0",
      "target": "retrieval:0",
      "sourceHandle": "product_related"
    },
    {
      "id": "7f68384d-3441-4bfa-bf13-69af67e857d2",
      "label": "",
      "source": "categorize:0",
      "target": "generate:casual",
      "sourceHandle": "casual"
    },
    {
      "id": "c9bf8e81-9345-4885-b565-be2f5b16f6ef",
      "label": "",
      "source": "categorize:0",
      "target": "generate:complain",
      "sourceHandle": "complain"
    },
    {
      "id": "2f326699-621b-4d28-ab98-70d99ad21add",
      "label": "",
      "source": "categorize:0",
      "target": "message:get_contact",
      "sourceHandle": "answer"
    },
    {
      "id": "03e45174-55df-47d6-8e5f-fbe2ffc148d7",
      "label": "",
      "source": "retrieval:0",
      "target": "relevant:0"
    },
    {
      "id": "a26027ac-e8a9-48e4-814c-3262b8d81913",
      "label": "",
      "source": "relevant:0",
      "target": "generate:answer"
    },
    {
      "id": "04d99dc7-6120-4169-98c6-7bc2813aa85b",
      "label": "",
      "source": "relevant:0",
      "target": "generate:ask_contact"
    }
  ],
  "nodes": [
    {
      "id": "begin",
      "type": "beginNode",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "label": "Begin",
        "name": "LegalPoetsAttack",
        "form": {
          "prologue": "Hi! How can I help you?"
        }
      },
      "sourcePosition": "left",
      "targetPosition": "right"
    },
    {
      "id": "answer:0",
      "type": "ragNode",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "label": "Answer",
        "name": "ThreeGeeseBehave",
        "form": {}
      },
      "sourcePosition": "left",
      "targetPosition": "right"
    },
    {
      "id": "categorize:0",
      "type": "categorizeNode",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "label": "Categorize",
        "name": "PublicComicsHammer",
        "form": {
          "llm_id": "deepseek-chat",
          "category_description": {
            "product_related": {
              "description": "The question is about the product usage, appearance and how it works.",
              "examples": "Why it always beaming?\nHow to install it onto the wall?\nIt leaks, what to do?\nException: Can't connect to ES cluster\nHow to build the RAGFlow image from scratch",
              "to": "retrieval:0"
            },
            "casual": {
              "description": "The question is not about the product usage, appearance and how it works. Just casual chat.",
              "examples": "How are you doing?\nWhat is your name?\nAre you a robot?\nWhat's the weather?\nWill it rain?",
              "to": "generate:casual"
            },
            "complain": {
              "description": "Complain even curse about the product or service you provide. But the comment is not specific enough.",
              "examples": "How bad is it.\nIt's really sucks.\nDamn, for God's sake, can it be more steady?\nShit, I just can't use this shit.\nI can't stand it anymore.",
              "to": "generate:complain"
            },
            "answer": {
              "description": "This answer provide a specific contact information, like e-mail, phone number, wechat number, line number, twitter, discord, etc,.",
              "examples": "My phone number is 203921\[email protected]\nThis is my discord number: johndowson_29384",
              "to": "message:get_contact"
            }
          },
          "message_history_window_size": 8
        }
      },
      "sourcePosition": "left",
      "targetPosition": "right"
    },
    {
      "id": "generate:casual",
      "type": "ragNode",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "label": "Generate",
        "name": "SourKnivesPay",
        "form": {
          "llm_id": "deepseek-chat",
          "prompt": "You are a customer support. But the customer wants to have a casual chat with you instead of consulting about the product. Be nice, funny, enthusiasm and concern.",
          "temperature": 0.9,
          "message_history_window_size": 12,
          "cite": false
        }
      },
      "sourcePosition": "left",
      "targetPosition": "right"
    },
    {
      "id": "generate:complain",
      "type": "ragNode",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "label": "Generate",
        "name": "TameLlamasSniff",
        "form": {
          "llm_id": "deepseek-chat",
          "prompt": "You are a customer support. the Customers complain even curse about the products but not specific enough. You need to ask him/her what's the specific problem with the product. Be nice, patient and concern to soothe your customers’ emotions at first place.",
          "temperature": 0.9,
          "message_history_window_size": 12,
          "cite": false
        }
      },
      "sourcePosition": "left",
      "targetPosition": "right"
    },
    {
      "id": "retrieval:0",
      "type": "ragNode",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "label": "Retrieval",
        "name": "ShinyPathsDraw",
        "form": {
          "similarity_threshold": 0.2,
          "keywords_similarity_weight": 0.3,
          "top_n": 6,
          "top_k": 1024,
          "rerank_id": "BAAI/bge-reranker-v2-m3",
          "kb_ids": ["869a236818b811ef91dffa163e197198"]
        }
      },
      "sourcePosition": "left",
      "targetPosition": "right"
    },
    {
      "id": "relevant:0",
      "type": "relevantNode",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "label": "Relevant",
        "name": "LegalPotsLick",
        "form": {
          "llm_id": "deepseek-chat",
          "temperature": 0.02,
          "yes": "generate:answer",
          "no": "generate:ask_contact"
        }
      },
      "sourcePosition": "left",
      "targetPosition": "right"
    },
    {
      "id": "generate:answer",
      "type": "ragNode",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "label": "Generate",
        "name": "YellowGamesReport",
        "form": {
          "llm_id": "deepseek-chat",
          "prompt": "You are an intelligent assistant. Please answer the question based on content of knowledge base. When all knowledge base content is irrelevant to the question, your answer must include the sentence \"The answer you are looking for is not found in the knowledge base!\". Answers need to consider chat history.\n      Knowledge base content is as following:\n      {input}\n      The above is the content of knowledge base.",
          "temperature": 0.02
        }
      },
      "sourcePosition": "left",
      "targetPosition": "right"
    },
    {
      "id": "generate:ask_contact",
      "type": "ragNode",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "label": "Generate",
        "name": "FamousChefsRetire",
        "form": {
          "llm_id": "deepseek-chat",
          "prompt": "You are a customer support. But you can't answer to customers' question. You need to request their contact like E-mail, phone number, Wechat number, LINE number, twitter, discord, etc,. Product experts will contact them later. Please do not ask the same question twice.",
          "temperature": 0.9,
          "message_history_window_size": 12,
          "cite": false
        }
      },
      "sourcePosition": "left",
      "targetPosition": "right"
    },
    {
      "id": "message:get_contact",
      "type": "ragNode",
      "position": {
        "x": 0,
        "y": 0
      },
      "data": {
        "label": "Message",
        "name": "BlueBooksTan",
        "form": {
          "messages": [
            "Okay, I've already write this down. What else I can do for you?",
            "Get it. What else I can do for you?",
            "Thanks for your trust! Our expert will contact ASAP. So, anything else I can do for you?",
            "Thanks! So, anything else I can do for you?"
          ]
        }
      },
      "sourcePosition": "left",
      "targetPosition": "right"
    }
  ]
}