aryn-ai / conversational-opensearch

A plugin for OpenSearch implementing an API to do conversational search
Apache License 2.0
8 stars 1 forks source link

How can i create conversation based on pre-define flow to capture inputs from the user #9

Open ramda1234786 opened 9 months ago

ramda1234786 commented 9 months ago

Hi

I am trying to create a mini bot where the bot will ask question with the user like

user: can you create order in the system
bot: provide me which item and how much quantity
user: usb drive 64GB of Zebronics
bot: how much quantity
user: 2
bot: give me your bill to address
user : 1234, street, church street, selvia, spain
bot: give me ship to address
user: its same as bill to address
bot: we can deliver this you in 3 days, if you are okay i will book the order
.............

Can we achieve the above use case with the flow where bot is guiding the user to create a Order as complete sales order flow. Please let me know if such conversation is possible with conversational CRUD APIs

HenryL27 commented 9 months ago

hmm... the conversation memory APIs can support any "conversation" that consists of "input-output" pairs, so yes, this should work. technically the user would likely be the person giving "input"s and the bot gives the "response". So each interaction in your conversation would look something like {"input": , "response": }

If you're looking for something to drive the flow, the memory APIs will not do this (neither will the RAG processor - that's more of a search/research tool, although maybe you could prompt it into doing this). The memory APIs will also not structure the user's response in any way. So for example the user may enter their address (or even something completely tangential) in any number of formats. We just write down what the user wrote - any validation should be done by the service.

ramda1234786 commented 9 months ago

okay thats what i wonder. This use case is not even possible with langchain or lamaindex. I thought conversation search will store the conversation id and interaction id.

I am new to all this tool ... wondering where is AI in all this....

Just last que... what you mean by that's more of a search/research tool, although maybe you could prompt it into doing this).

Is this is something can be done with your tool.

Thanks for your response again

HenryL27 commented 9 months ago

Honestly, I probably wouldn't use AI at all in this. You seem to be describing a system that asks very specific questions trying to get very specific information from the user. I'd probably just hard-code the questions and focus on making sure that the user's inputs are useful (e.g. real address, real phone number, real payment info etc.). The one place I can see a chatbot being useful, is perhaps you can use it to rephrase your hardcoded questions in the context of the previous answers - but ultimately this would just make the interaction a little more dynamic and a lot slower, so I'm not sure it's worth it. i.e. something to the effect of

POST openai/chat/completions/v1
{
  "messages": [
    {"role": "system", "content": "You are a cashier taking an order of some product. You need to get the customer's address in this step"},
    {"role": "user", "content": "can you create an order in the system"},
    {"role": "assistant", "content": "provide me which item and how much quantity"},
    ...
    {"role": "user", "content": "1234, street, church street, selvia, spain"},
  ]
}

The search/research thing - RAG is a wrapper around search (take your top search results and use them to answer the user's question). That style of interaction doesn't really make sense in this context, since the flow is pre-defined.

ramda1234786 commented 9 months ago

okay. Thanks for your reply. Then i think the old age school tool like RASA will be helpful here. Thanks for your inputs.