MODULE 7 DEEP DIVE  ·  CONTAINERS FOR GENAI & AGENTIC AI

The four knobs nobody explained

crew.py ran end to end in the lab — this deck opens it up and asks why

Gourav Shah  ·  School of DevOps & AI  ·  Deep Dive (Part 2)

M7-DD·01

Four themes, one file — crew.py opened up

Temperature, iteration, delegation, gates: all four live in run().

temperature per agent, not per crew iteration no loop, no retry delegation a plain string baton gates code, not a prompt what crew.py actually does
M7-DD·02

Low temperature plays the melody exactly as written, every time

Low temperature: reads the score exactly. High: improvises, sometimes off-key.

sheet music temp = 0 reads the score exactly ♪ ♫ ♪ ♪ temp = 0.9 improvises, notes scatter
M7-DD·03

Three of four agents pin temperature=0 on purpose

crew.py's four llm() call sites, read directly — one exception stands out

T I F R Triage — temp 0 one correct AREA/SEV label exists; no benefit to variety Investigator gate — temp 0 yes/no safety decision feeds an if — variety means flaky gating Fixer — temp 0.2 (default, unset) phrases prose around a fact; the command still must come verbatim from the runbook Reviewer — temp 0 APPROVED/REJECTED is binary; the code branches on it directly
M7-DD·04

Raising a classifier's temperature removes repeatability, not adds creativity

More temperature on a classifier isn't more capable — it's less repeatable

Triage temp=0 Investigator gate temp=0 Fixer temp=0.2 (default) Reviewer temp=0 raise this to 0.9 → §6 measures it
M7-DD·05

Someone who never stops re-googling the same question

No rule saying "three tries" — the loop can keep going indefinitely

search: "fix 503..." "fix 503 error" "503 checkout bug" "why 503 all users" "checkout down fix" discarded attempts, no stopping rule
M7-DD·06

A ReAct loop can cycle back to "reason" again — until something stops it

The reason-call-observe-decide loop this crew deliberately isn't

reason call tool observe good enough to answer? final answer yes no — try again iteration cap (if none: runs until timeout)
M7-DD·07

This crew costs exactly 5 model calls, always

retrieve() runs once — run() has no while loop and no retry branch

1 2 3 4 5 Triage retrieval relevance gate Fixer (0/1) Reviewer (0/1) predictable p99 cost & latency no code path runs 10× instead of 1×
M7-DD·08

A relay race passes the baton, not the runner's whole race so far

Each runner gets only the baton — not the whole race behind them

runner 1 runner 2 runner 3 baton = one string baton = one string
M7-DD·09

Triage's classification is printed for you — and thrown away by the code

retrieve() uses the raw incident string — never Triage's classification

incident raw string argument Triage → AREA/SEV printed only — a dead end Investigator retrieve(incident) console output for a human the actual query
M7-DD·10

Fixed order sidesteps two failure modes a dynamic router doesn't

A hard-coded run() order sidesteps both failure modes below

context dilution growing shared history (most of it irrelevant to this agent) agent spends attention parsing it instead of doing its one task error cascade manager re-summarizes a finding early mistake gets smoothed over invisible to everything downstream every hop is another LLM call: 5 per run here, dynamic routing adds more
M7-DD·11

Two gates, two Python string checks, zero follow-up prompts

Two deterministic string checks — not a second model policing the first

relevance gate .upper().startswith("YES") on the Investigator's answer deterministic — not a 2nd model call reviewer gate .upper().startswith("APPROVED") on the Reviewer's verdict deterministic — not a 2nd model call a model that ignores think:false prints reasoning first and breaks startswith("YES")
M7-DD·12

Gate 1 sits after the tool call, Gate 2 sits at final-answer time

Where the two real gates physically sit in the pipeline

retrieval relevance gate 1 Fixer reviewer gate 2 OUTCOME after tool call, before Fixer acts before a human sees it gate 3: before a tool call not needed — query is never LLM-chosen next layers: input validation before Triage, an output schema for the Reviewer's verdict
M7-DD·13

No debug flag — read the profile file and the f-string instead

No DEBUG flag — read the profile file plus run()'s f-string instead

1 2 3 docker compose run prints [TRIAGE] [INVESTIGATOR] [FIXER] [REVIEWER] OUTCOME: — outputs only cat crew/profiles/investigator.md the full system prompt each agent is built from profile + f-string = the complete prompt nothing else gets concatenated in — no hidden step
M7-DD·14

Same incident, three knob variants, always run one at a time

Sequential only — parallel runs would hide a knob change inside ordinary noise

1 2 3 baseline — unmodified crew.py the lab's own run, sequential, never parallel Variant A — Triage temp 0 → 0.9, ×3 repeats sequential, never parallel Variant B — relevance gate bypassed sequential, never parallel
M7-DD·15

At 0.9 the outcome held, the label drifted

Three repeats at temp 0.9: same format, different severity

run 1 SEV2 terse AREA | SEV line baseline said SEV1 run 2 SEV1 + an invented cause "Payment gateway outage" never in the incident run 3 SEV2 terse AREA | SEV line same format, new label OUTCOME: APPROVED — all 3 runs
M7-DD·16

Bypass one gate and the crew approves the wrong runbook's command

Gate bypassed: wrong runbook, its command, approved anyway

payments runbook (wrong section — incident is Kafka) APPROVED the wrong runbook's command, approved anyway
M7-DD·17

The gate decides — remove it and APPROVED certifies a mismatch

Wrong runbook, APPROVED every run — the gate, not temperature, decides

1 2 3 baseline — APPROVED, 5 calls the reference run, nothing changed Variant A — APPROVED ×3 Triage severity and cause drifted; outcome did not Variant B — gate removed, wrong runbook every run but Reviewer APPROVED it 6 of 6 runs — confidently wrong
M7-DD·18

MODULE 7 DEEP DIVE  ·  TAKEAWAYS

Pin the gates, bound the loop, check what really crosses each hop

! 1 2 3 4 small-model variance: the label drifts at high temperature; the gate pins the outcome temperature is a per-agent-role decision — pin classification and safety gates at 0 a bounded pipeline trades self-correction for a predictable cost and latency SLO delegation is only as safe as what crosses each hop — check what's really passed a code-level gate beats a follow-up prompt — it can't be talked out of its answer

Next: apply these levers to a real crew.  ·  Gourav Shah  ·  School of DevOps & AI

M7-DD·19