Azure-Samples / azure-search-openai-demo

A sample app for the Retrieval-Augmented Generation pattern running in Azure, using Azure AI Search for retrieval and Azure OpenAI large language models to power ChatGPT-style and Q&A experiences.
https://azure.microsoft.com/products/search
MIT License
5.63k stars 3.77k forks source link

What is the difference between Chat and Ask Question beside the UI interface? #583

Closed magedhelmy1 closed 10 months ago

magedhelmy1 commented 10 months ago

Please provide us with the following information:

This issue is for a: (mark with an x)

- [ ] bug report -> please search issues before submitting
- [ ] feature request
- [x] documentation issue or request
- [ ] regression (a behavior that used to work and stopped in a new release)

Minimal steps to reproduce

On the top bar, there is "Chat" and "Ask Question", what is the difference in those beside the fact that with chat you can ask a chain of questions while the other you can only ask one time.

Any log messages given by the failure

Expected/desired behavior

N/A

OS and Version?

Windows 7, 8 or 10. Linux (which distribution). macOS (Yosemite? El Capitan? Sierra?) N/A

azd version?

run azd version and copy paste here. N/A

Versions

N/A

Mention any other details that might be useful


Thanks! We'll be in touch soon.

pamelafox commented 10 months ago

Good question!

The /chat approach is programmed here: https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/app/backend/approaches/chatreadretrieveread.py

The default /ask approach is programmed here: https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/app/backend/approaches/retrievethenread.py

There are also two other /ask approaches with a slightly different approach, but they aren't currently working due to langchain compatibility issues.

magedhelmy1 commented 10 months ago

Dear Pamela,

I appreciate the clarity of your response. If it's not too much trouble and you have a moment, I have a couple of additional questions:

Thank you so much for your guidance. Have a great weekend.

pamelafox commented 10 months ago

The other two approaches are in this folder: https://github.com/Azure-Samples/azure-search-openai-demo/tree/main/app/backend/approaches You can read the code to see how they work. They don't currently function due to langchain issues.

Hybrid is reported to have the best results, see: https://techcommunity.microsoft.com/t5/azure-ai-services-blog/announcing-vector-search-in-azure-cognitive-search-public/ba-p/3872868

There's a bit more about these approaches here: https://techcommunity.microsoft.com/t5/azure-ai-services-blog/revolutionize-your-enterprise-data-with-chatgpt-next-gen-apps-w/ba-p/3762087

Generally you can search for "Retrieval Augmented Generation (RAG)" to learn more.