Built on Relate by Neo4j

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.

Assignment

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.

Consequence

−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.

Payments

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.

Authority

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.

Incentive

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.

Quality

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.

SalesCloser ASSIGNED Order ASSIGNED_TO Agent GIVEN_TO ◂ Flag Flag ×3 ON ◂ Suspension Suspended
suspension-chain.cypher — who can lift what?
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" }
48
nodes in the demo store
88
relationships
8
accountability questions
1
file — the whole database
0
servers to deploy

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.

01Which agents are one red flag from suspension — and which closers keep assigning to them?Head of Ops
02Which agents are one payment warning from a ban?Accountant
03Which orders bounced back unconfirmed, and what did each miss cost?Sales closers
04Which closers are within 2 confirmed orders of the next tier?HR
05Who is suspended right now, and exactly which role can lift it?Head of Ops
06Confirmation rate per closer, against the 80% / 55% baselinesCEO
07The full accountability trail of a single bounced orderAnyone
08Everything that ever happened around one agentHR

Run it

Zero to answers in four commands

No server, no signup. Relate runs embedded — the database is a file in the repo.

1
git clone https://github.com/Mofe-Bankole/opsgraph && cd opsgraph && npm install
2
npm run seed

Rebuilds data/opsgraph.rl deterministically — 48 nodes, 88 relationships.

3
npm run ask -- --all

Walks all eight accountability questions against the store.

4
npm run serve

Exposes the same graph over MCP (for AI agents), HTTP Query API and Bolt — from one file.