Skip to main content

Warehouse Ops Agent

Study project

This documentation site is an educational Domain-Driven Design exercise. It follows real industry-standard patterns and terminology, but it is not a production system and is not affiliated with, endorsed by, or representative of any real-world company.

Warehouse Ops Agent is the fleet's agentic layer: the "AI teammate that sees, analyzes, and recommends" over the warehouse-systems bounded contexts — originally five (inventory-storage, wes-work-planning, fulfillment-execution, workforce-management, facility-layout), plus two second-wave MCP clients (labor-performance, order-management; see ADR 0007), plus warehouse-planning (read tools only, ADR 0013), plus product-master (read-only, ADR 0020), plus inbound-receiving (read-only, ADR 0021), plus network-inventory-planning (read tools only, ADR 0019), plus slotting-optimization (read tools only, ADR 0024). The process-path-management client was removed (ADR 0024): catalogue configuration is not an ops signal. It is a Customer of those contexts' published MCP Open Host Services — it owns no aggregate, enforces no new business invariant, and persists no domain state. Its "domain" layer is decision policy: pure correlation rules over facts read from those contexts.

What it is not​

It is not a sixth bounded context in the domain sense. See ADR 0001 for the full placement reasoning: there is no aggregate or invariant for this repo to own, so calling it a "context" would be a domain in name only.

The see → analyze → act surface it consumes​

Each upstream context already exposes a curated, intent-level MCP read surface (the fleet's MCP Governance Charter). This agent's outbound adapters (internal/adapters/outbound/mcpclient/) are thin, schema-typed clients over exactly those tools — never a Go import of any sibling's internal packages:

Upstream contextRead tools the client implementsConsumed today by
wes-work-planningget_backlog_telemetry, get_rebalance_recommendationdaily brief, flow balance
fulfillment-executionget_queue_status, diagnose_stuck_tasksdaily brief, flow balance
workforce-managementget_staffing_gapdaily brief, flow balance (get_staffing_gap)
facility-layoutlist_sites, estimate_travel_distancedaily brief (list_sites), explain travel factor
inventory-storagecheck_availability, get_bin_occupancyE2 stranded reservation (MCP tool detect_stranded_reservation)
labor-performanceget_task_type_utilizationflow-balance utilization overlay (get_task_type_utilization, ADR 0008)
order-managementget_promise_healthdaily brief promiseHealth section (today so far; ADR 0024); get_order stays published but unwired
slotting-optimizationget_slot_plan, list_slot_plans (two of its four published read tools)daily brief slotPlanWatch section: Approved plans with unexecuted moves after SLOT_PLAN_STALE_AGE (ADR 0024); get_forward_slots and get_sku_velocity deliberately unwired
warehouse-planningget_process_path_capacity (read tool only; its write tools are never called)daily brief capacity outlook (get_process_path_capacity, ADR 0013)
product-masterlist_products (one of its six read tools; its two pack-level write tools are never called)master-data gaps report (list_products, GET /master-data-gaps / find_master_data_gaps, ADR 0020). Switched on in the kind cluster (warehouse-infra sets PRODUCT_MASTER_MCP_ENDPOINT)
inbound-receivinglist_asns, list_appointments, list_receipts (three of its seven read-only tools)inbound outlook (list_asns, list_appointments, list_receipts; GET /inbound-outlook / get_inbound_outlook, ADR 0021). Off until INBOUND_RECEIVING_MCP_ENDPOINT is set
network-inventory-planningget_transfer, find_stuck_transfers, simulate_transfer_options (read tools only)transfer watch (/transfer-watch/*, triage_stuck_transfers, get_transfer_status, explain_network_imbalance, ADR 0019)
returns-processingget_return, list_returns_by_order, get_disposition_policy (its three read-only tools)none yet: the client is wired but no use case consumes it. Off until RETURNS_PROCESSING_MCP_ENDPOINT is set
exception-managementlist_open_exceptions, get_exception, get_exception_policies, get_sla_report (its four read-only tools)none yet: the client is wired but no use case consumes it. Off until EXCEPTION_MANAGEMENT_MCP_ENDPOINT is set

| customer-ordering | get_order, get_order_tracking, get_ship_to (its three read-only tools) | none yet: the client is wired but no use case consumes it. Off until CUSTOMER_ORDERING_MCP_ENDPOINT is set (ADR 0025) | | delivery-promise | get_current_policy, get_delivery_offer, get_promise, list_promise_books, list_promises_by_order (its five read-only tools) | none yet: the client is wired but no use case consumes it. Off until DELIVERY_PROMISE_MCP_ENDPOINT is set (ADR 0025) | | last-mile-delivery | list_waves, get_wave_stops, get_route (its three read-only tools) | none yet: the client is wired but no use case consumes it. Off until LAST_MILE_DELIVERY_MCP_ENDPOINT is set (ADR 0025) | | linehaul-transportation | get_departure, list_departures (its two read-only tools) | none yet: the client is wired but no use case consumes it. Off until LINEHAUL_TRANSPORTATION_MCP_ENDPOINT is set (ADR 0025) | | node-performance | get_scorecard, list_scorecards_by_grade (its two read-only tools) | none yet: the client is wired but no use case consumes it. Off until NODE_PERFORMANCE_MCP_ENDPOINT is set (ADR 0025) | | node-topology | get_node, get_region, list_nodes, list_regions, list_lanes, resolve_service_area (its six read-only tools) | none yet: the client is wired but no use case consumes it. Off until NODE_TOPOLOGY_MCP_ENDPOINT is set (ADR 0025) | | offer-availability | browse_catalog, get_catalog_item, list_listings, get_inventory_feed (its four read-only tools) | none yet: the client is wired but no use case consumes it. Off until OFFER_AVAILABILITY_MCP_ENDPOINT is set (ADR 0025) | | order-sourcing | get_assignment, list_assignments (its two read-only tools) | none yet: the client is wired but no use case consumes it. Off until ORDER_SOURCING_MCP_ENDPOINT is set (ADR 0025) | | shipping-and-tracking | get_journey (its one read-only tool) | none yet: the client is wired but no use case consumes it. Off until SHIPPING_AND_TRACKING_MCP_ENDPOINT is set (ADR 0025) | | seller-inbound | get_seller_scorecard, get_inbound_plan, get_shipment_labels, get_inbound_shipment (its four read-only tools) | none yet: the client is wired but no use case consumes it. Off until SELLER_INBOUND_MCP_ENDPOINT is set (ADR 0027) | | vendor-connectivity | get_vendor, get_vendor_node, list_vendor_nodes, get_purchase_order, poll_purchase_orders, get_inbound_shipment, poll_inbound_shipments, get_transaction, get_node_scorecard (its nine read-only tools) | none yet: the client is wired but no use case consumes it. Off until VENDOR_CONNECTIVITY_MCP_ENDPOINT is set (ADR 0025) | | task-interleaving | get_hint, get_site_policy, get_station, list_hints (its four read-only tools) | none yet: the client is wired but no use case consumes it. Off until TASK_INTERLEAVING_MCP_ENDPOINT is set (ADR 0025) | | pick-face-replenishment | get_policy, list_policies, get_replenishment, list_replenishments, list_pick_faces (its five read-only tools) | none yet: the client is wired but no use case consumes it. Off until PICK_FACE_REPLENISHMENT_MCP_ENDPOINT is set (ADR 0025) |

Beyond MCP, the agent also reads Prometheus and Loki for its runtime-signals report, and fans out over plain REST for the console-bff routes (see the context map).

"Analyze" is the pure internal/domain/policy correlation layer described below. "Act" is deliberately not built yet — see Governance note.

The three exceptions​

ExceptionWhat it correlatesRecommended action
E1 — FlowBalanceExceptionwes's rebalance recommendation + workforce-management's staffing gap + fulfillment-execution's stuck-task diagnostic, for one process pathassign_labor, release_next_work, or hold
E2 — StrandedReservationfulfillment-execution's expired/expiring task leases + inventory-storage's usable-stock shortfall for the affected SKUrevoke_reservation (with a mandatory blast-radius readout) or hold
E3 — DailyBriefbacklog telemetry, staffing gap, queue depth, and stuck-task counts across every monitored path, grouped by facility-layout siteflags a path an open exception only when two or more independent signals correlate — never a single metric alone

Every decision this agent returns carries its full evidence trail (which upstream tool reading drove the call) and degrades to a conservative hold — never a guess — whenever a signal it needs is unavailable. See Domain vision for why that degrade-to-hold discipline is the whole point of the design.

Where to go next​

Disclaimer

This project is a domain-driven design study. It is not associated with, endorsed by or affiliated with any company, and it uses no company's code, data, logos or trademarks. All names, figures and examples are illustrative or synthetic.