The Run

Challenge

A work order just opened: events/wo-2026-0117.json - a 2020 Falcon, VIN CM-FAL-2020-0451, flashing check-engine light, code P0301. Dani’s bay.

Your agent handles it end to end: decide the repair, catch the recall, order the part, and leave an auditable trail in the graph. Nobody asks it a question.

The action tools

Judgment is agentic - the agent writes the SQL. The two actions have fixed contracts, so they ship as tools in skill/scripts/ (your agent calls them):

  • order_part.py <wo_id> <part_number> [qty] - places the order through the AutoFix parts API (the one running on port 8800); a 409 response means the part is superseded, and the API names the replacement

  • write_recommendation.py - records the decision: the work order from the event, a Recommendation node with its action and summary, and relationships to the recommended Part, any bundled RecallNotice, the GROUNDED_IN sections, and the placed PartsOrder

The recommendation is the agent’s signature on its decision - every claim in it points at graph evidence. Open either file if you want to see the contract; the agent runs them as the playbook directs.

Hand the event to your agent

The skill’s Handling an event section is the playbook. Tell your agent:

text
The whole instruction
Work order event: events/wo-2026-0117.json. Handle it per the skill.

Watch the policy fire in order: ground (applicable docs for P0301), judge (the revised coil, five repairs, zero comebacks), check exposure (this VIN has the open coil recall - bundle it), act (order IC-2042-B, write the recommendation).

One thing worth trying before or after: order the original coil yourself -

shell
python skill/scripts/order_part.py WO-2026-0117 IC-2042-A

The parts API rejects it: superseded by IC-2042-B, the same answer the graph’s SUPERSEDED_BY chain gives. Real systems push back; agents must handle it.

Inspect the decision trail

The recommendation is graph data - look at it in the sandbox window:

cypher
The audit trail
MATCH (v:Vehicle)-[:HAS_WORK_ORDER]->(w:WorkOrder {id: 'WO-2026-0117'})
      -[:HAS_RECOMMENDATION]->(r:Recommendation)
OPTIONAL MATCH (r)-[rel]->(target)
RETURN v, w, r, rel, target

One picture: the vehicle, the work order, the decision, the part it recommends, the recall it bundles, the sections that justify it, and the order it placed. That is what "decisions you can trust" looks like - not a confident paragraph, but a trail you can traverse.

The one it should not solve

Now the trust test - the second event:

text
Work order event: events/wo-2026-0118.json. Handle it per the skill.

A Heron with U0121. Check it yourself with python solutions/scripts/what_fixed_this.py CM-HER-2024-1450 U0121: no part has comeback-free evidence. Policy rule 5 says do not guess - the agent should write an escalate recommendation citing TSB-20-087’s "do not replace the ABS module" guidance, and order nothing.

An agent that knows when not to act is the difference between a demo and something Morgan can deploy. (There is a third event - a brake judder with no trouble code at all - if you finish early.)

Validate the Decision

Once your agent has handled the first event, click the Check Database button to verify the trail it left.

Hint

The check looks for the complete trail on WO-2026-0117: a repair recommendation for the revised coil, the bundled recall, and at least one grounding section.

Check:

  • Your agent ran write_recommendation.py (the graph is the audit log - policy rule 6)

  • It passed --recall RC-2021-04 and --grounding with section URIs (copied from outline or recall_exposure output, never fabricated)

Solution

Run the full sequence with the solution scripts:

shell
python solutions/scripts/order_part.py WO-2026-0117 IC-2042-B 4
python solutions/scripts/write_recommendation.py events/wo-2026-0117.json \
  repair "Replace coils with IC-2042-B per TSB-21-114; bundle recall RC-2021-04" \
  --part IC-2042-B --recall RC-2021-04 \
  --grounding 'technical-library/bulletins/tsb-21-114.pdf#repair-procedure,technical-library/recalls/rc-2021-04.pdf#remedy' --order-id PO-0001

Then inspect the trail:

cypher
MATCH (w:WorkOrder {id: 'WO-2026-0117'})-[:HAS_RECOMMENDATION]->(r)
OPTIONAL MATCH (r)-[rel]->(t)
RETURN w, r, rel, t

If verification fails:

  • Compare your write_recommendation.py against the spec in skill/SKILL.md - the relationship types and the part number matter

  • The parts API must be running for order_part.py: uvicorn api.parts_api:app --port 8800

Summary

Your agent handled live work orders:

  • Decided from evidence - the revised coil, grounded in bulletin and recall sections

  • Caught the recall - the misfire and the open recall were the same story all along

  • Acted - ordered the part through the API, wrote the auditable recommendation

  • Escalated when the evidence was thin, instead of guessing

In the final module: what it takes to run this pattern on your own lakehouse.

Chatbot

How can I help you today?

Data Model

Your data model will appear here.