Turlutte - Hi Team, I am trying to build a chat...
Hi Team, I am trying to build a chatbot that must be able to [A] Entertain the conversation for the user to share information, and once the conversation is considered finished: Summarize it, Send for embedding, Add a new record in a database (including summary and embedding), and when a question is asked [B] Retrieve information from the builship database.
I am currently using one assistant with the instruction to detect if a question is asked. However, I'm having issue regarding the summarization of the conversation to be sent to the embedding node. How can I detect the end of an exchange?
I'm not sure if I shouldnt have multiple agents linked to a main chatbot while using a switch node?
Any advice would be greatly appreciated!
Solution:Jump to solution
And here for example how it saves the answers of the questions and the summary
Particularly I predefined that it must get the name of the user and what they liked the most of the product...
11 Replies
Hey , we have a workflow that performs this scenario, you can get some time in my calendar to talk about it https://cal.com/geserra/generate-with-ai
Where can I find this workflow? or a picture of it?
You have two alternatives
- option a. Ask the assistant to do it everytime a question is answered
- option b. ask the assistant to call a tool named 'Generate summary' when it considers that all the information needed is submitted. Then the agent will use this tool to create the summary for you.
In my experience it works better when it uses a tool
Indeed, option B seems better.
This is where I am conceptually. As you mentioned, using 2 tools on the main assistant: Read node to a Buildship table, and an OpenAi assistant 'Summarizer'. I believe treating the summary would not end of the conversation / thread. However, using it this way, will it slow down the system dramatically for the user? Should it be a separate workflow hapenning behind the scene?
How can I pass the Summarizer's answer to the next node in the switch case?
Also, I cannot find a "Insert data into a Buildship table" pre-existing node, does it exist?
Thanks a lot for your time!
Hey, here is my current structure
Solution
And here for example how it saves the answers of the questions and the summary
Particularly I predefined that it must get the name of the user and what they liked the most of the product
Here is the instructions for the Assistant
The GPT is designed as a conversational assistant that keeps asking questions until it considers that the information to be captured is given by the user. It should immerse users in a dialogue that feels natural and intuitive, asking questions to gather user perspectives on a series of predefined topics. It will use its judgment to decide when to move on to the next topic based on the user's responses or delve deeper with follow-up questions if the conversation warrants it. If the question is not answered properly with all the context pre-defined it will not pass to the next question. The assistant aims to make the data collection process more engaging and less tedious, encouraging honest and thoughtful answers from users. When needing more information to understand the user's response better, it will make an educated guess based on the context rather than asking for clarification directly.
Each user has an ID, you should remember it.
The information to get from the user is the following.
Information to obtain
${ctx["root"]["05af796d-a718-4963-be97-87f993070c19"]}
Ask follow-up questions to make them be detailed on providing feedback. Never ask two questions at once.
Finish the conversation only if you feel that you have enough context for all questions
When you are given tools to use, you must use them following the guidelines for each tool.
Guidelines:
When you get answers for one of the initial given questions you are asked, you must use 'updateDatabase' tool to save the information you captured. Make sure to save all the context related to that given question or topic
When all answers are responded, you must use 'saveConversation' tool to save a summary of the conversation. Make sure to save all the context related to that conversation
UserID: ${ctx["root"]["e6866f91-cf15-4066-92cf-2e7da0a477de"]}
Your initial message should be the following:
${ctx["root"]["4b1c024b-7420-4cff-bad5-632bd6591c0e"]}
Here an example of the conversation
Happy to jump to a call and discuss more
Amazing, I'll try this out and let you know! The summarization will require some NLP capabilities and, therefore will take a few seconds to happen. How does that node work? I assume the task has to be completed before continuing the thread with the user?
How can I join you in a call? That will be easier to explain my usecase I think
You can schedule a meeting here - https://discord.com/channels/853498675484819476/1229497013725302865/1229505372562391091 with Gerard.