Rating Agent
Read-only review intelligence specialist that summarizes customer feedback over A2A gRPC and map-reduce workflows while leaving final quality tier classification to deterministic service logic.
Role & Autonomy Boundary
Rating Agent is the read-only review analysis and quality-signal specialist hosted inside Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs in the Reviews bounded context. It is triggered through two runtime paths: remote Agent-to-Agent (A2A) gRPC handoffs from Chat APIServicev1.0.0Chat APIInternal HTTP host for BookWorm's interactive multi-agent chat workflow, agent discovery, and session persistence. Ownerai-capabilities-teamDiagramRepositoryOpen docs (routed or handed off from Book AgentAgentv1.0.0Book AgentPrimary conversational book discovery and recommendation specialist that grounds catalog answers in read-only MCP lookup...PublishesAnalyzeText, AnonymizeTextOwnerai-capabilities-teamDiagramRepositoryOpen docs), and Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs‘s in-process map-reduce summarization pipeline backing Summarize feedbackQueryv1.0.0Summarize feedbackReturns a generated feedback summary, classification, rating metrics, evidence, and confidence for a book.Ownercatalog-experience-teamSchemaDiagramOpen docs.
Rating Agent never writes to Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs or Catalog DatabaseContainerv1.0.0Catalog DatabaseAuthoritative PostgreSQL system of record owned by the Catalog bounded context for books, authors, categories, publisher...Ownercatalog-experience-teamDiagramOpen docs, never executes destructive queries, and never assigns final quality tiers—classifications (No Data, Bad, Good, Top Rated) are computed deterministically by service code rather than the language model.
Agent Profile & Model Governance
| Property | Value |
|---|---|
| Bounded Context / Domain | Reviews (BookWormDomainv1.0.0BookWormCore e-commerce domain for the BookWorm online bookstore, coordinating catalog discovery, customer baskets, order fulfil...Ownerarchitecture-enabling-teamDiagramRepositoryOpen docs) |
| Owner Team | Catalog Experience TeamTeamCatalog Experience TeamStream-Aligned team owning BookWorm's product catalog, customer reviews, and storefront/backoffice discovery experience....Open docs, Catalog Experience TeamTeamCatalog Experience TeamStream-Aligned team owning BookWorm's product catalog, customer reviews, and storefront/backoffice discovery experience....Open docs |
| Hosting Service | Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs |
| LLM Provider & Model | Microsoft Foundry model-router (2025-11-18; temperature: 0.4, maxOutputTokens: 1500, reasoningEffort: medium) |
| Interaction Protocol | Remote A2A gRPC server (rating_read policy, Entra Agent Identity); in-process workflow invocation; MCP Streamable HTTP (outbound to MCP ServerServicev1.0.0MCP ServerInternal stateless Streamable HTTP MCP service that exposes read-only
Catalog lookup tools and reusable AI prompts.
PublishesListBooksGrpc, GetBookDetailsGrpc +2Ownerai-capabilities-teamDiagramRepositoryOpen docs) |
| Memory / Context Scope | Stateless per-request with four-stage context compaction; summarized results cached by Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs in Rating CacheContainerv1.0.0Rating CacheNon-authoritative FusionCache and Redis caching layer owned by the Reviews bounded context for AI-generated book feedbac...Ownercatalog-experience-teamDiagramOpen docs |
| Fallback Behavior | Re-runs reduction up to configured iteration limits when confidence is low; fails closed on PII or write-policy violations |
Tools & Capabilities
| Name | Type | Description | URL |
|---|---|---|---|
| GetCustomerReviews | function | Read-only in-process lookup returning raw customer reviews (review ID, rating, comment) for a book; rate-limited to 30 calls per minute. | |
| get_book | Retrieves catalog book metadata (title, authors, category, price, average rating, total reviews) from the MCP Server before fetching reviews. |
| Capability / Tool | Access Level | Target Resource | Guardrail / Constraint |
|---|---|---|---|
GetCustomerReviews | Read | Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs | Read-only partition query; rate-limited to 30/minute by governance policy |
get_book | Read | MCP ServerServicev1.0.0MCP ServerInternal stateless Streamable HTTP MCP service that exposes read-only Catalog lookup tools and reusable AI prompts. PublishesListBooksGrpc, GetBookDetailsGrpc +2Ownerai-capabilities-teamDiagramRepositoryOpen docs | Always invoked before GetCustomerReviews to refresh catalog metadata and review counts |
Data, Messaging & Handoff Boundaries
- Data Stores: Read-only consumer of Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs via
GetCustomerReviews. Generated summaries and quality signals are never persisted back to Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs by the agent; Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs caches Summarize feedbackQueryv1.0.0Summarize feedbackReturns a generated feedback summary, classification, rating metrics, evidence, and confidence for a book.Ownercatalog-experience-teamSchemaDiagramOpen docs outputs in Rating CacheContainerv1.0.0Rating CacheNon-authoritative FusionCache and Redis caching layer owned by the Reviews bounded context for AI-generated book feedbac...Ownercatalog-experience-teamDiagramOpen docs. - Messages: Screens all inputs and outputs via Presidio APIServicev1.0.0Presidio APIExternal HTTP sidecar API for detecting PII in text and anonymizing detected entities in the Chat and Rating AI agent pi...SubscribesAnalyzeText, AnonymizeText +3APIsOpenAPIOwnerplatform-engineering-teamDiagramOpen docs using Analyze textCommandv1.0.0Analyze textDetects PII entities in one text string or a batch, returning entity types, text offsets, confidence scores, and optiona...Ownerplatform-engineering-teamSchemaDiagramOpen docs and Anonymize textCommandv1.0.0Anonymize textReplaces or transforms detected PII in text using the supplied analysis results and configured anonymization operators.Ownerplatform-engineering-teamSchemaDiagramOpen docs. Stored customer reviews in Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs remain unmodified.
- Delegation & Handoffs: Receives remote A2A gRPC requests from Chat APIServicev1.0.0Chat APIInternal HTTP host for BookWorm's interactive multi-agent chat workflow, agent discovery, and session persistence. Ownerai-capabilities-teamDiagramRepositoryOpen docs (typically handed off by Book AgentAgentv1.0.0Book AgentPrimary conversational book discovery and recommendation specialist that grounds catalog answers in read-only MCP lookup...PublishesAnalyzeText, AnonymizeTextOwnerai-capabilities-teamDiagramRepositoryOpen docs after resolving a single book identifier). It never calls Chat APIServicev1.0.0Chat APIInternal HTTP host for BookWorm's interactive multi-agent chat workflow, agent discovery, and session persistence. Ownerai-capabilities-teamDiagramRepositoryOpen docs or peer conversational agents.
Partition and map review batches
For Summarize feedbackQueryv1.0.0Summarize feedbackReturns a generated feedback summary, classification, rating metrics, evidence, and confidence for a book.Ownercatalog-experience-teamSchemaDiagramOpen docs, the summarization workflow partitions customer reviews into bounded batches and fans out parallel structured summarization calls to Rating Agent.
Reduce and assess quality signals
A reduce stage merges batch outputs into unified sentiment, recurring themes, strengths, weaknesses, and confidence-scored quality signals, repeating reduction if confidence falls below threshold.
Apply deterministic tier classification
Deterministic service logic evaluates review count, average rating, and dominant negative pattern flags to assign
No Data,Bad,Good, orTop Rated—never delegated to the LLM.
Safety, Privacy & AI Governance
- Fail-Closed PII Redaction: Presidio APIServicev1.0.0Presidio APIExternal HTTP sidecar API for detecting PII in text and anonymizing detected
entities in the Chat and Rating AI agent pi...SubscribesAnalyzeText, AnonymizeText +3APIsOpenAPIOwnerplatform-engineering-teamDiagramOpen docs (
AnalyzeTextandAnonymizeText) screens model inputs and outputs alongside regex PII patterns (email,phone,credit_card), ensuring reviewer personal details are masked before reaching the model or caller. - Default-Deny & Write Protection: High-priority governance rules (
block-write-operations,block-destructive-sql) block all mutations and non-SELECTSQL patterns, while cappingGetCustomerReviewsat30/minute. - Dual Output Guardrails: Combines shared prompt/response guardrails with Rating-specific output checks across both buffered and streaming responses.
- Four-Stage Context Compaction: Applies tool-result compaction (
> 20messages), LLM summarization (> 3,000tokens), sliding window (> 12turns), and hard truncation (> 24,000tokens) to prevent context overflow on large review sets.
Rating Agent is explicitly instructed never to emit a final quality classification or equate review counts with sales volume. All write operations are denied by policy, and final quality tiers are always computed deterministically outside the model.
| Classification | Condition |
|---|---|
| No Data | Fewer than 3 reviews, or non-finite / out-of-range average rating |
| Bad | Average rating < 3.5, or a dominant negative pattern is detected |
| Top Rated | (averageRating >= 4.5 and reviewCount >= 50) or (averageRating >= 4.0 and reviewCount >= 200) |
| Good | Remaining books with reviewCount >= 3 and averageRating >= 3.5 without a dominant negative pattern |
- Low-Confidence Refinement: If parsed assessment confidence is below threshold, the workflow loops reduction up to its configured maximum iterations before deterministic classification.
Architecture Visualizations
Review Intelligence Invocation and Data Boundary
Loading graph...
Related Documentation
- Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs — Hosting service, Summarize feedbackQueryv1.0.0Summarize feedbackReturns a generated feedback summary, classification, rating metrics, evidence, and confidence for a book.Ownercatalog-experience-teamSchemaDiagramOpen docs endpoint, and A2A gRPC server.
- Rating DatabaseContainerv1.0.0Rating DatabaseAuthoritative Azure Cosmos DB system of record owned by the Reviews bounded context for customer feedback documents part...Ownercatalog-experience-teamDiagramOpen docs — Authoritative Azure Cosmos DB feedback store.
- Rating CacheContainerv1.0.0Rating CacheNon-authoritative FusionCache and Redis caching layer owned by the Reviews bounded context for AI-generated book feedbac...Ownercatalog-experience-teamDiagramOpen docs — Caching layer for Summarize feedbackQueryv1.0.0Summarize feedbackReturns a generated feedback summary, classification, rating metrics, evidence, and confidence for a book.Ownercatalog-experience-teamSchemaDiagramOpen docs results.
- Book AgentAgentv1.0.0Book AgentPrimary conversational book discovery and recommendation specialist that grounds catalog answers in read-only MCP lookup...PublishesAnalyzeText, AnonymizeTextOwnerai-capabilities-teamDiagramRepositoryOpen docs — Conversational specialist that resolves a book ID before A2A handoff.
- Chat Agent OrchestrationFlowv1.0.0Chat Agent OrchestrationA customer submits a conversational request through Storefront; Chat API screens input, routes via a non-LLM classifier ...Ownerai-capabilities-teamView flowOpen docs — Conversational workflow routing and A2A handoff flow.
- AI GovernanceCustom DocAI GovernanceInput screening, privacy middleware, policy enforcement, and tool boundaries for BookWorm's AI workflows.Ownerai-capabilities-teamOpen doc — Cross-cutting AI governance rules and standards.
- ADR-BW-014: Compose shared governance on each enabled AI pathDecision Recordv1.0.0ADR-BW-014: Compose shared governance on each enabled AI pathReuse privacy, guardrail, and policy mechanisms across Chat and Rating while verifying registration and permissions on e...Ownerai-capabilities-teamOpen docs — Shared governance composition across AI paths.
- ADR-004: Keep AI feedback summarization read-only and governedDecision Recordv1.0.0ADR-004: Keep AI feedback summarization read-only and governedRating generates feedback insights at read time with allow-listed read tools, PII redaction, and rate limits, without pe...Ownercatalog-experience-teamOpen docs — Read-only governed feedback summarization decision.