Using variables in knowledge agent
# 🤝help
n
Hey I am making a chatbot for an ecommerce brand and they want to have the chatbot give ideas as to what clothes would suit the person. Part of that is picking a gender of clothing and I can't get the knowledge agent to determine the difference right now and was wondering if anyone could help. I can help give more detail if someone is willing to help. Thanks 🙂
a
Hey @narrow-apple-52361, this is a tricky question. The knowledge base only takes the last user input, which makes it hard to add context. I go over a couple workarounds in this post, but be warned: there is code involved https://discord.com/channels/1108396290624213082/1128625552354455562/1128657522258087976
n
Thanks for the reply @acceptable-kangaroo-64719 , definitely is a tricky one but i appreciate the help nonetheless 🙂
@acceptable-kangaroo-64719 What type of tasks instructions should i put to help get my desired result with the AI task. I basically just want it to take the info from my knowledge base and take the user input to create an idea back to them. Or should i be using something else and do i need to enable knowledge answering. Thanks for the help i really appreciate it
a
That's one way to do it, yeah. So you can take your KB answer, the user's question, and maybe the chat transcript as inputs. Then your prompt can describe what each of these are, explain the task, and remind GPT to pay attention to the details. Then save the output to a variable and it should be okay
n
You are amazing @acceptable-kangaroo-64719 thank you very much