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.94k stars 4.08k forks source link

Simplification Quest #1839

Closed thracian2015 closed 2 months ago

thracian2015 commented 2 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

Thank you for this sample. I'm new to LLM and RAG. I'm learning and have a few questions to understand tradeoffs if I am to simplify the architecture:

  1. Why do we need to prep the documents using custom code (paging, sectioning, Document Intelligence) instead of using the import wizard in AI Search, which also can be scheduled to crawl the content?
  2. If we are to prep documents, what features does Document Intelligence have compared to for example Python PDFReader?
  3. Why do we use the LLM embedding model instead of Semantic Ranker in AI Search to find document similarity?

Any log messages given by the failure

Expected/desired behavior

OS and Version?

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

azd version?

run azd version and copy paste here.

Versions

Mention any other details that might be useful


Thanks! We'll be in touch soon.

pamelafox commented 2 months ago
  1. This repository also supports integrated vectorization, which may be what that wizard uses (I'm not sure). The code in this repository is more customized, and more customizable, so it also includes features like including the page number of parsed PDF chunks, and being able to parse more types of documents. If the wizard works fine for you, then you can use it, but you'd need to make sure the search fields matched what the search function uses here.
  2. Document Intelligence can also OCR images, not sure that the Python reader can do it. It also affects a wide range of document types now, like docx and ppts. If you haven't read it yet, the data ingestion guide has more info: https://github.com/Azure-Samples/azure-search-openai-demo/blob/main/docs/data_ingestion.md
  3. We use embedding models for embedding, and we use semantic ranker for re-ranking once we get best search results (it's also called an "L2 ranker" because it only ranks once given a list and a query).

My talk here might help: https://youtube.com/live/vuOA13Y_Qzk?feature=share

thracian2015 commented 2 months ago

Thank you, Pamela. Yes, I've watched your videos and thank you so much for sharing knowledge!

My research shows that the new Import and Vectorize Wizard can save tons of code to:

  1. Extract and chunk text.
  2. Process documents of different types stored in the same folder.
  3. Generate embedding vectors by integrating with Azure OpenAI embedding model, such as text-embedding-ada-002.
  4. Refresh the index on schedule.

I'll be great if you could evaluate the wizard and share your insights in another video. A low(er) code approach would be appreciated by many for sure. I'd love to also see a better integration between Azure AI Search and Azure OpenAI, such as you just submit the questions to Azure AI Search and you get the Azure OpenAI responses by integrating with Azure OpenAI text deployment and thus avoiding the two-step custom code (similar to what the wizard does with embeddings).