Skip to content

Cookbooks

Six recipes for taking the substrate beyond a demo. Each maps to a workshop block.

The six recipes

Detailed write-ups

Each cookbook expands during workshop prep. Today’s stubs:

1 · Modify a guardrail agent

In LIFEOSAI UI: navigate to AI Guardrail Lab → Agents → Guardrail Designer. The right pane shows Skills (markdown files) and Instructions (the SOUL). Edit. Save. Trigger a re-run from an existing issue.

The change is live for the next wakeup. No deploy. No restart.

2 · Build your own front-end

The orchestration substrate exposes 17 HTTP routes. A minimal viable front-end needs three:

  • GET /api/agents/:companyId — list agents
  • GET /api/issues/:companyId — list issues (Kanban board)
  • POST /api/issues/:id/comment — drop a comment

A 200-line HTML file with fetch() calls is enough to replace the entire LIFEOSAI UI for read+comment workflows.

3 · Add a 10th agent in code

Terminal window
# 1. Create the SOUL
vim agents/10-watchdog.md # follow the Analyzer SOUL template
# 2. Wire it into orchestration
psql -c "INSERT INTO agents (id, name, role, adapter_type, company_id) VALUES (...)"
# 3. Create a routine
psql -c "INSERT INTO routines (agent_id, schedule) VALUES (..., '*/5 * * * *')"

That’s it. The watchdog runs every 5 minutes. Heartbeat picks it up.

4 · Philippines-IoT reframe

Current: 4–5 chief engineers read IoT alerts + manuals + circulars, write emails to superintendents.

Reframe:

  • Heartbeat agent watches IoT alert stream
  • 5 analyzers read each alert through Engineer · Class · Operator · Charterer · Owner lenses
  • Story-builder clusters per-vessel
  • Approval gate queues the draft email to superintendent — approved via WhatsApp
  • Sender dispatches on approval

Could scale 5/day → 50/day. Engineers shift from doing to reviewing.

5 · Spin up a new office

LIFEOSAI top-left dropdown → ”+ New company”. Name it, pick a baseline (Guardrail Lab, blank, IoT-watch). The DB schema isolates by company_id. The library is shared. Agents per-office.

Demo on Day 5: live-add NBS-Dev in front of the room. Single command.

6 · Wire a Claude hook

Terminal window
# Edit your global hooks
vim ~/.claude/hooks/SessionStart
# Hook receives JSON on stdin, can output context-injection JSON on stdout

The four hook points:

  • SessionStart — agent waking up · inject cold-start context here
  • UserPromptSubmit — user typed input · inject recent-act memory here
  • PreCompact — context about to compact · save state to leave-note
  • PostCompact — context just compacted · post recovery report