KB and AI Loop Workflow
# 🤝help
p
I feel like I'm probably missing something basic but after watching multiple KB and AI Task Videos I am still running into issues and running out of ideas of how to make it work. The idea: Have the user be able to chat with the bot but have the bot check the KB for answers before dropping down to the AI Task My Layout How I have it: 1. User Inputs Raw text 2. Bot checks if knowledge base can answer the raw input or not 3a. If it can be answered by Knowledge base it goes to KB_Answer_Found node 3.b If an answer is not found in Knowledge base it goes to the No_KB_Found_Ask_AI node 3. Then the one (3a or 3b who has the answer) loops back to the beginning to continue the conversation the variable worflow.aiResponse. Everything works well until step 4 the Loopback to allow user to continue the chat then responses start doubling Attached is a screen shot of flow and responses from emulator, notice the second time I ask the question it doubles and shows the question. Logs from second question
Copy code
16:03:57
info
dm
Message of type text received from user-25 on webchat
16:03:59
info
KnowledgeAgent
hook
Extracted 1 questions from user message
16:04:01
debug
KnowledgeAgent
hook
Generating answer based on 51 results
16:04:02
debug
KnowledgeAgent
hook
Answer directly sent to the user
16:04:02
debug
dm
Sending Message. Type: text. Text: The MainWP Dashboard plugin uses port 80 for HTTP connections and port 443 for HTTPS connections.
16:04:02
debug
dm
[Capture] Capture is a raw listen, so we are skipping the cognitive extraction
16:04:02
debug
dm
[Capture] Field validation successful! Extracted: "What Port does mainwp use?". Input: What Port does mainwp use?
16:04:02
debug
dm
[Capture] Prompt success
16:04:02
debug
dm
Execute transition "If KB found an answer"
16:04:02
debug
dm
Transition from (flow:Main) [node:KB_Loop_AI_Test] to [node:KB_Answer_Found]
16:04:02
debug
dm
Sending Message. Type: text. Text: The MainWP Dashboard plugin uses port 80 for HTTP connections and port 443 for HTTPS connections.
16:04:02
debug
dm
Transition from (flow:Main) [node:KB_Answer_Found] to [node:KB_Loop_AI_Test]
16:04:02
debug
dm
[Capture] Start information capture
16:04:02
debug
dm
Sending Message. Type: text. Text: What Port does mainwp use?
16:04:02
debug
dm
Waiting for user input
16:04:02
debug
SummaryAgent
hook
Last 100 transcript messages available --> {{conversation.SummaryAgent.transcript}}
16:04:05
debug
SummaryAgent
hook
Summary updated based on 4 new messages --> {{conversation.SummaryAgent.summary}}
16:04:05
debug
dm
Stack trace for event
16:04:05
debug
dm
Billed Tokens: 12,534 | Total Tokens: 12,534 | Cost: $0.0065 | Cache Savings: 0%
Thanks https://cdn.discordapp.com/attachments/1238583326487478402/1238583326739140700/2024-05-10_16-01-45.png?ex=663fd01c&is=663e7e9c&hm=de70ee85933fba897f6f7c877c9574c65a03e19b86cb4acdfb6744bc497398bd& https://cdn.discordapp.com/attachments/1238583326487478402/1238583327007707330/2024-05-10_16-05-23.png?ex=663fd01c&is=663e7e9c&hm=b4c9323b02b035d6e3a189d5325a844242f18c36a23e6ff12d8fa81e954316a8& https://cdn.discordapp.com/attachments/1238583326487478402/1238583327372476508/2024-05-10_16-05-23.png?ex=663fd01d&is=663e7e9d&hm=2776ab14e8010eccf92ebaa3fb30ccac33fe601c016f02fe4fae2f13ae26d621&
c
show how you wrote the conditions
ah wait, why do you have 'aiResponse' listen for input card in No KB answer node
p
If KB Found an answer
Copy code
{{turn.KnowledgeAgent.answer != null}}
and if KB did not find answer
Copy code
{{turn.KnowledgeAgent.answer == null}}
Basically trying to use these two videos to get there

https://www.youtube.com/watch?v=LpUIYC7uw94

https://www.youtube.com/watch?v=z4dLcUfF8d0

I thought the "Integrate AI Task and Knowledge Base" video would do it but the Pastbin code may be out of date or I'm not using it correctly
8 Views