An Azure search service with built-in artificial intelligence capabilities that enrich information to help identify and explore relevant content at scale.
Hi Power Automate,
Thanks for sharing your setup and use case and this is a great example of how to combine Azure OpenAI and Azure AI Search to streamline customer service workflows.
What you're trying to achieve is known as the "Retrieve-then-Generate" (RAG) pattern, where relevant content is first retrieved from a knowledge base (in your case, via Azure AI Search), and then GPT-4o uses that content to generate a well-written response. While the Azure OpenAI Playground handles this integration behind the scenes, doing it outside, such as in Power Automate which requires connecting the pieces manually.
To replicate this in Power Automate, you can add an HTTP action to first query Azure AI Search using the incoming email content as the search term. Then, take the top results and construct a prompt by embedding that content along with the original email. Finally, send this constructed prompt to the Azure OpenAI API (chat completions endpoint) and save the response as your draft reply.
Here’s a helpful Microsoft guide that explains how to use your own data with Azure OpenAI:
Use your data with Azure OpenAI
And for detailed API integration, refer to:
Azure AI Search REST API and Azure OpenAI REST reference
I hope this helps! Thank you
If this answers your query, please do click on 'Accept answer' and 'upvote.