Three intelligence endpoints correspond to modules M6, M7, and M8 of the Anaquel Inteligente 3B pipeline. M6 predicts when each product will run out of stock using exponential smoothing over the removal event history. M7 aggregates slot interactions into a time-windowed activity heatmap. M8 surfaces auto-generated human-readable narrative messages in Spanish that describe events, trends, and alerts as they occur.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/elzackarias/Hackaton3B-Reto1/llms.txt
Use this file to discover all available pages before exploring further.
GET /api/predictions
Returns aStockPrediction object for every tracked SKU. Predictions are generated by PredictionEngine (M6) using exponential smoothing (alpha=0.3) over the timestamps of recorded removal events. A minimum of 2 removal events per SKU is required before a meaningful depletion estimate can be computed; products with fewer events return null for estimated_depletion and minutes_remaining.
StockPrediction Object
Unique SKU identifier.
Human-readable product name.
Units currently on the shelf at the time of prediction.
Smoothed removal rate in units per hour, derived from the inter-event timestamps using exponential smoothing.
ISO 8601 datetime when the product is predicted to reach zero stock, or
null if insufficient event data exists (fewer than 2 retiro events).Minutes from now until estimated depletion, or
null if insufficient data.Direction of the removal rate over recent events:
"acelerando"— removal pace is increasing (stock depleting faster)"estable"— removal pace is roughly constant"desacelerando"— removal pace is decreasing
Reliability of the prediction based on the number of data points:
"alta"— high confidence (sufficient event history)"media"— medium confidence"baja"— low confidence (minimal event history)
Predictions are recomputed on every request from the current event history. Use
POST /api/events or POST /api/mock/event to generate removal events and observe the predictions evolve in real time.GET /api/heatmap
Returns a structured heatmap of shelf slot activity within a configurable time window. Activity is recorded byHeatmapEngine (M7) each time any InventoryEvent is processed. The response contains a slots array ordered by descending intensity (the most active slot has intensity = 1.0), the window duration, and a timestamp.
Time window in seconds over which to aggregate slot interactions. Minimum
10, maximum 3600 (1 hour).Heatmap Response Fields
Array of slot objects sorted by
intensity descending. Each object contains:slot_id(integer) — physical shelf slot numbersku_id(string) — SKU occupying that slotactivity_count(integer) — number of interactions recorded within the windowintensity(float) — normalized activity score; the busiest slot has1.0, others are proportional
The time window used to filter interactions, as passed in the
window query parameter.ISO 8601 datetime when the heatmap was computed.
GET /api/narratives
Returns the most recentNarrativeMessage records generated by NarrativeEngine (M8) in reverse chronological order. Narratives are produced automatically in Spanish whenever significant events occur: product removals, returns, alert threshold crossings, and stock depletion predictions. A 30-second cooldown per SKU prevents message flooding.
Maximum number of narrative messages to return. Minimum
1, maximum 100.NarrativeMessage Object
12-character lowercase hex string uniquely identifying this narrative message (first 12 hex digits of a UUID v4).
Severity level of the message:
"info"— informational (e.g., a product was returned to the shelf)"warning"— requires attention (e.g., stock is running low)"critical"— immediate action needed (e.g., stock has crossed the alert threshold)
Human-readable narrative in Spanish describing the event or condition.
SKU identifier of the product this message relates to, or
null for system-wide messages.ISO 8601 datetime when this narrative was generated.
Emoji icon associated with the message severity or event type.