Orchestration coordinates routing, retrieval, web search, and response generation into one end-to-end enterprise RAG workflow. A handler interprets the router result, bypasses retrieval for direct answers, branches to web search, or queries the route-specific vector collection. section 7.2.2
A practical orchestration flow performs these steps:
- Route the query and extract its action, reason, and optional short answer. section 7.2.2
- Return a router-provided answer immediately when available. section 7.2.2
- Send WEB_SEARCH requests to web search, then format the results as a response. section 7.2.2
- Embed internal-document queries, retrieve three points asynchronously from the mapped Qdrant collection, and generate a cited answer. section 7.2.2
Representative routing
An OpenAI Assistant question selects OPENAI_QUERY; Uber gross bookings selects 10K_DOCUMENT_QUERY; current open-source LLM trends select WEB_SEARCH. section 7.2.2
async def handle_query(user_query: str) -> str:
route_result = route_query(user_query) #A
action = route_result["action"]
reason = route_result["reason"]
short_answer = route_result.get("answer", "")
print(f"Route: {action}")
print(f"Reason: {reason}")
if short_answer: #B
return short_answer
if action == "WEB_SEARCH": #C
search_results = search_web(user_query)
return rag_formatted_response(user_query, search_results)
return await retrieve_and_response(user_query, action) #D
Inspect the central async handler that connects routing, short answers, web search, retrieval, and response generation. section 7.2.2


















