Delivery-ops accountability,
answered as graph traversals.
OpsGraph models a delivery operation — agents, closers, orders, flags, warnings, suspensions —
as an embedded Relate graph, so questions like "who is one flag from suspension, and who keeps assigning to them?"
are a single MATCH, not a spreadsheet.
The problem
A real accountability system, drowning in rows
Ishop, a Nigerian e-commerce logistics operation, is rolling out a points-and-flags accountability system between sales closers and delivery agents. The rules are precise — and every one of them is about relationships: who assigned what to whom, what it triggered, and who is allowed to undo it. Relational tables scatter those answers across joins. A graph keeps them one hop away.
The 1-hour window
A closer assigns an order; the agent must confirm within 1 hour — orders from 5pm get until 12pm next day — or the order bounces back for reassignment.
−15 points & a flag
Every missed window costs the agent 15 points and issues a red flag. Three flags and the agent loses the ability to collect orders entirely.
The 48-hour cadence
A payment due 48 hours earns a warning, then one every 24 hours. The third warning bans the agent from collecting any orders.
Only specific roles can undo
Only the Accountant lifts payment bans. Only the Head of Operations lifts delivery suspensions. HR handles closer bans and misconduct reports. Authority is a path, not a column.
Tiers: Beginner → Superstar
Closers climb tiers by confirmed orders — Beginner under 15, Standard 15–20, Superstar above 20 — and higher tiers receive more orders to close.
The 55% / 80% baselines
80% confirmation is the baseline. A new closer under 55% twice is banned from receiving orders. Underperformance compounds across the graph.
The graph
The whole operation, one hop at a time
Ten node types, sixteen relationship types — persisted in a single .rl file
that anyone can open, inspect, and serve over MCP, HTTP or Bolt.
MATCH (s:Suspension {active: true})-[:ON]->(x) MATCH (s)-[:LIFTABLE_BY]->(r:Role) RETURN s.kind AS kind, x.name AS who, r.name AS onlyRoleThatCanLift // → { kind: "delivery", who: "Seun Balogun", // onlyRoleThatCanLift: "HeadOfOperations" }
The payoff
Eight questions the operation actually asks
Each is a named traversal in the repo. Each maps to a person whose job depends on the answer.
Run it
Zero to answers in four commands
No server, no signup. Relate runs embedded — the database is a file in the repo.
Rebuilds data/opsgraph.rl deterministically — 48 nodes, 88 relationships.
Walks all eight accountability questions against the store.
Exposes the same graph over MCP (for AI agents), HTTP Query API and Bolt — from one file.