Conversational Book Discovery
Routing, grounding, privacy, and response generation for a chat turn.
Runtime Scenario
Chat API coordinates a synchronous, streaming conversation turn across routing, privacy, specialist agents, and read-only knowledge sources. It never mutates baskets or orders.
Purpose & Trigger
The flow helps a customer discover books, answer store questions, or summarize ratings. It starts when Storefront sends an authenticated chat turn.
Visual References
Conversational Book Discovery
Loading graph...
Step-by-Step Walkthrough
- Storefront sends the turn through API Gateway. Chat API validates the caller and rate limit, loads session state, and rejects unsafe or oversized input.
- Microsoft Foundry routing determines whether the request concerns a book, store policy, or rating and whether disambiguation is needed.
- When intent is unclear, Chat API pauses and asks Storefront to collect a clarification. Execution resumes after the customer chooses an intended route.
- For book or policy work, Chat API anonymizes outbound PII through Presidio and invokes the appropriate specialist and model.
- Book specialists synchronously query MCP Tools for read-only catalog facts. The tools return grounded data from Catalog API.
- Rating requests invoke the remote Rating API specialist synchronously over the agent interface.
- Chat API checks tool permissions and applies response safeguards, formats the result, and persists the updated session.
- The final response streams to Storefront over the conversation channel.
Error Handling & Edge Cases
- Prompt validation and routing rejection short-circuit unsafe or out-of-scope turns.
- A stalled disambiguation remains bounded by workflow timeouts and conversation limits.
- MCP Tools or Rating API failures return a bounded workflow error rather than a mutation or fallback write.
- Model and tool outputs are checked for privacy and policy compliance before delivery.
Quality & Consistency Notes
- Session data and conversation state are persisted separately from catalog and review state.
- Catalog and rating answers reflect live read boundaries at the time of the tool call.
- The flow is advisory: it cannot reserve inventory, change prices, or create commerce state.