Create reasoner.py
Browse files- agents/reasoner.py +73 -0
agents/reasoner.py
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import pandas as pd
|
| 2 |
+
|
| 3 |
+
# ---------------------------------------------------------
|
| 4 |
+
# GENERATE CONSULTING-STYLE REPORT (McKinsey Format)
|
| 5 |
+
# ---------------------------------------------------------
|
| 6 |
+
def generate_consulting_report(task, slotting=None, picking=None, heatmap=False, insights=None):
|
| 7 |
+
|
| 8 |
+
report = f"""
|
| 9 |
+
# π§ Procelevate Operational Analysis
|
| 10 |
+
### Task Performed: **{task}**
|
| 11 |
+
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
"""
|
| 15 |
+
|
| 16 |
+
# ---------------------------------------------------------
|
| 17 |
+
# SLOTING RESULTS SECTION
|
| 18 |
+
# ---------------------------------------------------------
|
| 19 |
+
if slotting is not None:
|
| 20 |
+
report += "## π¦ Slotting Optimization Summary\n"
|
| 21 |
+
report += "The following SKU placement adjustments were generated:\n\n"
|
| 22 |
+
|
| 23 |
+
for _, row in slotting.iterrows():
|
| 24 |
+
report += f"- **SKU {row['SKU']} ({row['Velocity']})** β Aisle **{row['Suggested Aisle']}**, Rack **{row['Suggested Rack']}**\n"
|
| 25 |
+
|
| 26 |
+
report += "\n### Procelevate Insight\n"
|
| 27 |
+
report += "- Fast movers are placed in forward pick zones to minimize travel distance.\n"
|
| 28 |
+
report += "- Medium movers are positioned in mid-frequency zones for easy access.\n"
|
| 29 |
+
report += "- Slow movers are placed in rear zones to reduce aisle congestion.\n\n"
|
| 30 |
+
|
| 31 |
+
# ---------------------------------------------------------
|
| 32 |
+
# PICKING RESULTS SECTION
|
| 33 |
+
# ---------------------------------------------------------
|
| 34 |
+
if picking is not None:
|
| 35 |
+
report += "## πΆ Optimized Picking Route\n"
|
| 36 |
+
report += "The picking path has been optimized to reduce travel distance and minimize aisle switching.\n\n"
|
| 37 |
+
report += "### Route Sequence (Aisle β Rack):\n"
|
| 38 |
+
for idx, row in picking.iterrows():
|
| 39 |
+
report += f"- **Aisle {row['Aisle']}**, Rack {row['Rack']}\n"
|
| 40 |
+
|
| 41 |
+
report += "\n### Procelevate Insight\n"
|
| 42 |
+
report += "- The route reduces zig-zag patterns and groups picks by proximity.\n"
|
| 43 |
+
report += "- This improves picker throughput and reduces fatigue.\n\n"
|
| 44 |
+
|
| 45 |
+
# ---------------------------------------------------------
|
| 46 |
+
# HEATMAP SECTION
|
| 47 |
+
# ---------------------------------------------------------
|
| 48 |
+
if heatmap:
|
| 49 |
+
report += "## π₯ Heatmap Generated\n"
|
| 50 |
+
report += "A visualization has been produced to highlight SKU density across aisles.\n\n"
|
| 51 |
+
|
| 52 |
+
# ---------------------------------------------------------
|
| 53 |
+
# INSIGHTS SECTION
|
| 54 |
+
# ---------------------------------------------------------
|
| 55 |
+
if insights is not None:
|
| 56 |
+
report += "## π Additional Warehouse Insights\n"
|
| 57 |
+
report += insights
|
| 58 |
+
report += "\n"
|
| 59 |
+
|
| 60 |
+
# ---------------------------------------------------------
|
| 61 |
+
# ENDING SIGNATURE
|
| 62 |
+
# ---------------------------------------------------------
|
| 63 |
+
report += """
|
| 64 |
+
---
|
| 65 |
+
|
| 66 |
+
### π§ Procelevate Recommendation
|
| 67 |
+
The adjustments above are expected to reduce picker travel time, improve outbound throughput,
|
| 68 |
+
and balance aisle congestion β supporting more efficient daily warehouse operations.
|
| 69 |
+
|
| 70 |
+
_This analysis was generated by Procelevate's Autonomous Warehouse Operator Agent._
|
| 71 |
+
"""
|
| 72 |
+
|
| 73 |
+
return report
|