Skip to main content
AGR-03 · Agriculture & Food

Supply and Demand Planning Copilot

Outcome​

Give the demand planner a consensus planning surface that reconciles statistical forecast, promotion lifts, open orders and weather-sensitive demand at the item-location level, explains every override, and routes exception-level changes for commercial sign-off.

Portfolio attributeValue
Primary personaPlanner
Primary aggregatePlanningUnitForecast
Cosmos DB containers1
Grounding dataforecasts, orders, inventory, promotions, weather
Development estimateUSD 60-220 monthly dev estimate
Runtime optionsPython FastAPI and C# ASP.NET Core

Productivity hypothesis​

These measures reflect the workflow, evidence, decision boundary, and industry risk for this use case.

Impact typeMeasureConservative internal assumptionCustomer measurement
ProductivityPlanning cycle time10-18% reduction(baseline median planning minutes - assisted median planning minutes) / baseline median planning minutes * 100
Quality or riskFirst-pass plan acceptance5-10 percentage-point improvementassisted percentage of plans accepted without material rework - baseline percentage

Important: Conservative internal pilot assumptions only; not public benchmarks, commitments, or expected customer results. Validate against a comparable baseline or matched control cohort with mandatory human review.

Rationale: Forecast, order, inventory, promotion, and weather evidence can accelerate draft-plan preparation and reduce revision loops.

Pilot guardrail: Expose forecast conflicts and uncertainty; planners retain inventory and allocation authority.

Customer validation plan​

  1. Baseline the current workflow with representative users and tasks.
  2. Run the accelerator on the same task mix with human review retained.
  3. Measure planning cycle time and first-pass plan acceptance with the documented formulas.
  4. Replace internal assumptions with customer-observed results before a business case.

Why Azure Cosmos DB​

This AI solution needs an operational data plane, not only a vector index:

  • Hybrid vector and full-text retrieval combines semantic recall with exact identifiers, codes, names, and domain language.
  • Hierarchical partition keys and metadata predicates keep tenant and domain boundaries in the normal query path.
  • Operational JSON, source chunks, workflow and agent state, feedback, and audit records remain together for low-latency reads and governed writes.
  • Change feed reacts to source and operational updates without polling.
  • Autoscale throughput, configurable consistency, and multi-region distribution support variable demand and enterprise availability.

Domain workflow​

Domain workflow

StageActorInput → outputApproval
1. Statistical baseline generationForecast engineDemandSignal → ForecastVersionPolicy controlled
2. Promotion and event nettingSupply and demand planning copilotPromotionPlan → adjustedForecastVersionPolicy controlled
3. Exception detection and explanationSupply and demand planning copilotadjustedForecastVersion → ForecastOverridePolicy controlled
4. Consensus review with commercial teamsPlanner, sales and marketingForecastOverride → consensusDecisionHuman required
5. Consensus lock and supply handoffDemand plannerconsensusDecision → lockedForecastVersionHuman required

Technical architecture​

Technical architecture

Cosmos DB data model​

ContainerHierarchical partition keyDocumentsSearch paths
planningUnitForecasts/tenantId, /planningUnitIdPlanningUnit, ForecastVersion, PromotionPlan, DemandSignal, PlanningNarrativeChunk, ForecastOverride/chunkVectorEmbedding, /rationaleVectorEmbedding, /chunkVector, /rationaleVector

Query contract​

QueryContainerScopePurpose
ExceptionPlanningUnitsplanningUnitForecastssingle-partitionEvaluate whether one item-location planning unit exceeds the forecast-error review threshold for this cycle. The complete tenantId and planningUnitId hierarchical partition key routes the query to one logical partition.
ForecastVersionComparisonplanningUnitForecastssingle-partitionCompare statistical, promotion-adjusted and consensus versions across buckets for one planning unit.
OverlappingPromotionWindowsplanningUnitForecastssingle-partitionDetect promotions whose windows overlap so their lifts are netted rather than additively stacked.
OverrideJustificationRetrievalplanningUnitForecastssingle-partitionRetrieve prior consensus minutes and advisories that support or contradict a proposed override.

Python and C# services route each document type to its declared container and hierarchical partition key. ETag-based writes protect mutable aggregates, while append-only records and bounded cross-partition queries preserve scale.

Azure deployment​

Azure deployment

Clone the source repository, authenticate with Azure, and run:

Set-Location accelerators/agriculture-food/supply-and-demand-planning-copilot
az login
./Deploy.ps1 -Runtime python -Location eastus2

Change python to csharp to deploy the .NET implementation.

Explore the implementation​

Return to all accelerators