Inspiration

Wacky Wheels Co. builds just-in-time and keeps no parts inventory. One late battery shipment, one plant going dark for a few days, or one bad lot of brake calipers spreads into hundreds of production slots, dealer orders, loaner cars and owners. In a real control tower, people handle this today by reading messy emails and chat messages ("the Huntsville line is waiting on battery packs, carrier says next Friday now") and working through spreadsheets.

Hitachi's Hack the Highway challenge asked whether a team of AI agents could do that job, and do it the way a careful human operator would: act on every affected record, touch nothing else, ignore noise, and escalate rumors instead of acting on them. We were especially interested in a question that applies to many industries: how far can a small, local language model go when it is surrounded by the right structure?

What it does

hitachihack is an event-driven, multi-agent operations control tower that runs entirely on a laptop.

  • Reads a feed of free-text operational events. These include shipment notices, plant alerts, quality bulletins, daily digests, chat messages, brochure questions and rumors. It handles nicknames ("the Huntsville line"), relative dates ("next Wednesday") and multi-incident messages.
  • Classifies each incident as Supplier Delay, Plant Outage, Quality Hold, Noise, Unconfirmed Report or Compound.
  • Finds everything the event touches by walking an ontology-backed knowledge graph, for example Shipment → Part → Model (BOM) → ProductionOrder → CustomerOrder → Dealer / Customer.
  • Takes the corrective actions through MCP-style enterprise tools, following the policy handbook rule by rule:
    • Supply Chain Planner: reschedules affected builds to the earliest feasible slot on one shared, capacity-aware slot ledger, and transfers a build to another plant when its home plant is full.
    • Dealer & Customer Care: sends one notice per dealer listing only that dealer's affected orders, ranks and assigns loaners within each dealer's pool limits, and contacts owners.
    • Quality Manager: holds the defective lot, traces it to the builds and vehicles that used it, stops sale of unsold vehicles at their dealers, and hands sold vehicles to Customer Care for owner outreach.
    • Coordinator: sends unconfirmed or unclear reports to a human with exactly one escalate call, and makes zero calls on noise.
  • Explains every event. Each one gets a graph path, a reasoning trace that cites the handbook rule for each step, a summary, and a "what did not change" list (builds that don't use the delayed part, models outside the recall, Standard-tier customers without loaners).
  • Provides a business-friendly dashboard with the event feed, graph visualization, slot reasoning, actions, audit trail and ontology view. It is a single HTML file that works offline.

Results on the 15-event feed: 902 tool calls with 0 failed and 0 blocked. Those calls include 45 reschedules plus 5 transfers, 192 dealer notices, 103 loaners, 3 lot holds, 98 stop-sales and 320 owner contacts. Noise events got 0 calls, and each rumor got exactly one escalation. The whole run takes 73 seconds end to end at $0 API cost.

How we built it

  • Model: Qwen2.5-3B-Instruct (qwen2.5:3b, Q4_K_M, about 1.9 GB) via Ollama on a laptop GPU. It runs at temperature 0 with JSON-schema-constrained output and makes one LLM call per event (about 1.8k tokens, about 4.8 s).
  • Stack: Python 3.10 standard library only. No pip installs, no frameworks, no cloud.
  • Split of responsibilities between the LLM and code:
    • The LLM does the language work: it splits digests into incidents, classifies them, and copies plant, part and supplier names and date phrases verbatim.
    • Plain code does everything that must be exact: resolving names to IDs through an alias table and master data, turning date phrases into ISO dates with a working calendar, graph traversal, slot planning, loaner ranking and tool arguments.
  • Knowledge graph: 12 classes (Supplier, Part, Model, Plant, WorkDay, Shipment, ProductionOrder, CustomerOrder, Customer, Dealer, Lot, Vehicle) and 21 typed relations. Every edge is validated against the ontology when it is inserted, giving 17,009 nodes and 28,833 edges. The graph is exported as OWL/Turtle (aliases as skos:altLabel), Mermaid, SVG and GraphML.
  • Agents: one Coordinator and three specialists with disjoint tool permissions, enforced by the tool gateway (least privilege). Hand-offs between agents are logged messages.
  • Guardrails:
    • A deterministic regex and lexicon reader gives a second opinion on every message. When the two readers disagree, the LLM re-reads just the disputed segment.
    • Anti-hallucination check: any value the LLM copies must actually appear in the message.
    • Grounding checks: the supplier really ships that part to that plant, the weekday matches the date, exactly one lot matches.
    • Tool arguments are validated against the tool schema before sending.
    • The whole write plan is pre-flighted in a sandbox copy of the enterprise server. If a write fails, the system re-plans once and then escalates.
  • An MCP server (JSON-RPC over stdio) exposes the same tools, so other agents can use them.

Challenges we ran into

  • Relative dates are ambiguous. Does "next Friday", said on a Monday, mean four days away or eleven? The feed settled it for us: in one digest, a chip shipment "can't make it next Monday; carrier says next Friday now", which only reads as a delay if it means the Friday of the following calendar week. That interpretation also changed the date range of the outage in the same message.
  • Compound events with shared resources. When one digest has both an outage and a supplier delay, both incidents compete for the same free slots and the same loaner pools. We had to plan on a single shared ledger in build-date order, give each dealer one combined notice and one loaner ranking, and still avoid contradictions.
  • Small models occasionally slip. In stress testing, the 3B model once invented a date. Instead of switching to a bigger model, we made sure a slip could never become an action: the hallucinated value is dropped, the second reader catches it, and the re-read fixes it.
  • Restraint is harder than action. Noise messages sometimes contain operational words (a weather item that mentions a plant, a price-list notice), and rumors sound urgent. Getting exactly zero calls on noise and exactly one escalation on rumors took careful classification and coverage checks.
  • Proving correctness without an answer key. The expected answers were not shared, so we had to build our own ways of checking the results (see below).

Accomplishments that we're proud of

  • The model's own reading was correct on 15/15 events, in every repeated evaluation run, with 0 re-reads needed on the submitted run, using a 3-billion-parameter model on a laptop.
  • The run matches three independent auditors exactly. Three separate agents with no access to our code worked out the expected outcome of all 15 events from the policy handbook alone. Our replayed final state matched all three on every move, notice, loaner, lot, VIN, owner and escalation.
  • 902 tool calls, 0 failed, and no write on any unaffected record. The 134 reads each confirm live state right before the write that depends on it.
  • A self-check replays the action log on a fresh world and compares it against a separate, direct implementation of the handbook rules, plus invariant checks (no earlier slot skipped, transfers only when the home plant is full, one notice per dealer, pools respected).
  • An adversarial code review by three reviewers plus a verifier found 31 defects on inputs outside the feed. All are fixed and covered by 49 unit and scenario tests.
  • Explanations a business user can read: every action traces back to a graph path and a quoted handbook rule.

What we learned

  • A small model is enough when it only reads. Restricting the LLM to language work and giving every exact decision to code made a 3B model as accurate as we needed. A bigger model would only have added latency and memory.
  • A knowledge graph makes explainability come almost for free. Because every impact question is answered by walking typed edges, the graph path is the explanation, and the "what did not change" list falls out of the same traversal.
  • Two readers beat one big reader. Pairing an LLM with a deterministic reader, and re-reading only the parts where they disagree, is cheap and catches the errors that matter.
  • Pre-flight before you write. Simulating the whole write plan in a sandbox before touching the real systems removed a whole class of partial-failure problems.
  • Write down judgment calls. Ambiguities like "next Friday" or transfer tie-breaking are policy decisions. Recording them and having independent auditors confirm them was as important as the code.

What's next for hitachihack

  • Calibrated confidence, with a second LLM vote only when the readers disagree.
  • Learning from humans: turning resolved escalations into new alias variants and rules, so the system needs to escalate less over time.
  • Smarter transfers that weigh plant proximity and part supply at the receiving plant once the data includes them.
  • A live, streaming dashboard that updates as events arrive instead of after the run.
  • A persistent graph store for multi-day state, so the tower can track incidents that develop over a week, not just a single feed.
  • Taking the pattern beyond automotive: the same reader, knowledge graph, specialist agents and guardrails design fits any just-in-time operation, such as rail, energy or logistics.

Built With

Share this project:

Updates

Submission history