I'm looking for guidance on optimizing our current RAG (Retrieval Augmented Generation) workflow using Azure AI Search. Right now, our system processes a user query by generating search parameters, retrieving context from Azure AI Search, and then combining that with the query to generate a final answer. While this works for some queries, it doesn't fully accommodate the diverse nature of user questions.
For example:
- Internal Knowledge Only: A query like "What creative strategies can we explore for a new product launch?" might be answered solely by the model’s internal knowledge.
Company-Specific Data: A query such as "What are the current trends in our industry based on internal performance data?" should tap into a vector database containing company-specific insights.
External Web Search: A question like "What are the latest market trends in healthcare technology?" requires the most current external data from a web search.
Integrated Business Strategy: For a more complex case, consider a query like "Based on the XY business model, how can we create a comprehensive business strategy or marketing campaign?" This would require the model to understand the business model, consider company-specific data, and integrate external insights to deliver a tailored strategy.
My thought is to enhance the current RAG setup by first breaking down the query into subtasks—where the model generates an initial answer, then enriches that answer by retrieving additional context from the most appropriate data source (whether internal, company-specific, or external), and finally synthesizes a richer final output.
I’m considering two approaches:
Multiple Agents: Each specialized in a different part of the process.
Dynamic Routing in Code: Using an LLM to analyze and decompose the query, decide on the optimal data source, and orchestrate the retrieval and synthesis steps.
Has anyone implemented a similar multi-faceted workflow? What strategies or architectural patterns would you recommend for dynamically routing user queries to the right data source, ensuring that the final answer meets the user’s expectations? Any best practices or lessons learned would be greatly appreciated.I'm looking for guidance on optimizing our current RAG (Retrieval Augmented Generation) workflow using Azure AI Search. Right now, our system processes a user query by generating search parameters, retrieving context from Azure AI Search, and then combining that with the query to generate a final answer. While this works for some queries, it doesn't fully accommodate the diverse nature of user questions.
For example:
Internal Knowledge Only: A query like "What creative strategies can we explore for a new product launch?" might be answered solely by the model’s internal knowledge.
Company-Specific Data: A query such as "What are the current trends in our industry based on internal performance data?" should tap into a vector database containing company-specific insights.
External Web Search: A question like "What are the latest market trends in healthcare technology?" requires the most current external data from a web search.
Integrated Business Strategy: For a more complex case, consider a query like "Based on the XY business model, how can we create a comprehensive business strategy or marketing campaign?" This would require the model to understand the business model, consider company-specific data, and integrate external insights to deliver a tailored strategy.
My thought is to enhance the current RAG setup by first breaking down the query into subtasks—where the model generates an initial answer, then enriches that answer by retrieving additional context from the most appropriate data source (whether internal, company-specific, or external), and finally synthesizes a richer final output.
I’m considering two approaches:
Multiple Agents: Each specialized in a different part of the process.
Dynamic Routing in Code: Using an LLM to analyze and decompose the query, decide on the optimal data source, and orchestrate the retrieval and synthesis steps.
Has anyone implemented a similar multi-faceted workflow? What strategies or architectural patterns would you recommend for dynamically routing user queries to the right data source, ensuring that the final answer meets the user’s expectations? Any best practices or lessons learned would be greatly appreciated.