Introduction
In hourly workplaces like cafés, restaurants, and retail stores, shift-swap disputes are a constant headache for managers:
- "I covered your Sunday shift last month; you owe me two shifts back!"
- "We agreed verbally by the counter."
- "The 30-day return window passed, so my debt is wiped clean."
Traditional AI chatbots fail completely in this setting. Because stateless LLMs have no persistent institutional memory, they cannot recall past manager rulings, approved swap logs, or employee dispute history.
To solve this, we built Shyft Swap Mediator for the HackwithHyderabad Hackathon. It is an AI agent designed for Priya Nair, shift manager at Brewline Café, powered by Hindsight Cloud as persistent institutional memory.
Why Stateless LLMs Fail at Shift Mediation
When a vanilla LLM is asked:
"Kavya covered Rohan's festival-day Sunday shift last month. She says he owes her two shifts back, Rohan says one. Who is right?"
A standard LLM will decline to decide:
"I cannot determine who is right. I have no records of this swap. Please check the written contract."
Workplace dispute resolution requires:
- Historical Record Recall: Knowing who covered which shift, approved dates, and conditions.
- Precedent Enforcement: Applying prior manager rulings (e.g., festival shifts count as 2 regular shifts).
- Calendar Verification: Deterministically checking whether return windows are open or expired.
- Pattern Detection: Spotting repeat defaulters who repeatedly make unbacked verbal claims.
- Continuous Learning: Retaining new confirmed rulings so future disputes are adjudicated consistently.
Architecture: How Hindsight Cloud Powers Shyft
Shyft Swap Mediator couples Hindsight Cloud with fast inference (Groq) in a closed feedback loop:
-
Bank with a Mission:
The memory bank is configured with an explicit institutional mission:"I am the memory of Priya Nair, shift manager at Brewline Cafe. I keep track of shift-swap agreements, who covered whose shift, disputes between employees, Priya's rulings, and standing policy exceptions, so future disputes can be settled from the written record and consistently."
-
Multi-Query Routing & Round-Robin Deduplication:
Rather than issuing a single naive query, Shyft dispatches targeted semantic queries for each dispute:- The dispute text itself
- Standing store policies and exceptions
- Employee-specific queries (past disputes, unreturned or overdue swaps)
Results are round-robin merged and capped at the top 14 memories (
RECALL_CAP=14) for high signal and token efficiency.
Closing the Learning Loop:
When the manager confirms or edits a ruling in the Streamlit UI, it is retained back to Hindsight:
python
memory.retain(
f"Dispute on {today:%Y-%m-%d}: {message} Priya's ruling: {ruling}",
context="dispute ruling",
when=today
)
Top comments (0)