a shippers field note

the production
stack

everything under the prompt. the part of ai engineering that is actually engineering.

prompt engineering is the tip you can see. this is the eight layers below the waterline that decide whether the thing survives a real user, a real tenant, and a real bill.
descend the stack

a good demo is one layer deep. a product that holds is eight.

the screenshots that started this were a list of the hard parts: batching and quantization, structured output and tool contracts, agent budgets, retrieval and reranking, evals, observability, cost attribution, multi-tenant isolation, failure modes. that list is not trivia. it is the job description for shipping ai that does not fall over. so here it is as a stack you descend, and at every layer, where it already lives in what you build.

01
the surface · closest to the user
agents & the loop

an agent without a stopping rule is a bug with a bill. guardrails are the gate, budgets are the closer, termination is the done-when. and when the good model is down, you route to a lesser one and degrade on purpose, instead of failing in the user's face.

agent guardrailsloop budgetstool budgetstermination conditionsmodel routinggraceful fallbackdegraded-mode ux
where it lives in your stack

this is the stratum the loop note already lives in. agent-stack encodes all of it: max_gate_failures is your closer, budget_cap and time_cap are your loop budgets, the coordinator routes and hands over. you shipped this layer.

learn → nothing new here. it is live. the gaps are further down.
02
the handshake · intent becomes action
structured output
& tool contracts

the model returns text. your system needs a contract. validate the shape, and when it is malformed, repair it by re-asking with the error before you ever fall back. idempotency means calling the same tool twice does not double-charge or double-send.

schema validationrepair loopsfallback chainsfunction-calling reliabilitytool contractsargument validationidempotency
where it lives in your stack

your agents emit a red-list as structured json. trademind certs must be schema-valid to BS 7671 or they are worthless paper. the outreach closer must be idempotent: one reply per inbound, never two.

wire → validate-then-repair on every structured output. an idempotency key on every side-effecting call.
03
the memory · how it knows things
retrieval & rag

retrieval is not a vector search, it is a pipeline: chunk well, embed, search hybrid, rerank, keep it fresh. then prove it. can you measure recall, is the answer grounded in what you pulled, do the citations point at the right span.

chunkingembeddingshybrid searchrerankingfreshnessrecall / precisiongroundingcitation quality
where it lives in your stack

evidence is this stratum: a sealed per-clinic rag with code-built pinpoint citations. agentdb is the memory tier under your agents. reasoningbank is retrieval over past experience.

wire → retrieval evals on evidence. a reranker on the hybrid search. treat stale retrieval as the failure it is.
04
the metal · the compute floor
inference & serving

this is the layer you mostly rent, not run, for now. but the tradeoffs are still yours. quantization buys speed and cheapness and can cost quality; latency, quality, cost and reliability move against each other and you pick the mix per feature.

continuous batchingpaged attentionspeculative decodingINT8 / INT4 / FP8AWQ / GPTQthroughputlatency budgets
where it lives in your stack

your version of this is model tiering. opus for judgement, sonnet mid, haiku for routine, fable only for the heavy agentic legs because it runs at roughly twice the cost. that is you managing the inference tradeoff without ever touching a gpu.

wire → a routing rule per task, not per app. know when you are paying fable rates for haiku work.
05
the proof · cross-cuts every layer
evaluation

if you cannot measure whether it got better or worse, you are not engineering, you are vibing. adversarial tests try to break it, an llm-as-judge scores at scale, a human checks the judge. the quiet killer is the silent regression: a change makes it worse and nothing tells you.

adversarial testsllm-as-judgehuman evalssilent regressionsacceptance criteria
where it lives in your stack

the logic-gap-harness is this stratum: an adversarial verifier that defaults to "not real" until it can confirm. verify_stack is the machine gate. you already build the eval before you trust the output.

wire → an eval that runs on every change to a prompt or a chain, so a regression is loud, not silent.
06
the instrument · you cannot fix the unseen
observability & cost

trace every call, span the steps, watch drift over time. and attribute cost where it is spent: per feature, per tenant, per journey. per-model spend hides the one number you need, which clinic is quietly burning your margin.

traces / spanstokenslatencyerrorsdriftcost per tenantcost per journey
where it lives in your stack

sentinel, rebuilt as the coordinator, is this stratum. it watches drift, runs the reconciler, reports the five dials. strydeos is multi-tenant, so cost per clinic is a real number you should be able to pull on demand.

wire → traces on the agent loops. cost attribution per clinic, not per model. drift on the reconciler.
07
the boundary · isolation is the product
safety & isolation

the moment you are multi-tenant, isolation stops being a feature and becomes the product. a prompt injection turns a helpful agent into an exfiltration tool. a shared cache leaks one user's context into another's. a missing boundary lets one tenant write another's data.

prompt injection defensedata leakage preventionpermission boundariesmulti-tenant isolationcache safetycross-user contamination
your sharpest live gap

the check-staleness path lets any admin write any clinic. that is a cross-tenant write, exactly this stratum's worst failure. the identity split and the reconciler sit here too. sentinel already watches for injection.

fix first → scope every write to the authed tenant. verify the token, never trust the claim. this outranks everything shiny.
08
the floor · what it all rests on
failure modes

everything above rests here. name the failure modes and engineer against each one by name. a hallucinated tool call needs a contract. malformed json needs validate-then-repair. stale retrieval needs freshness. a runaway agent needs the closer. a silent regression needs an eval. and know when your approach is the wrong tool: fine-tuning a model to fix a retrieval problem is the wrong tool.

hallucinated tool callsmalformed jsonstale retrievalrunaway agentssilent eval regressionsfine-tune vs rag vs distill
where it lives in your stack

you have the gate, the harness, the closer, the coordinator. the failure modes are already mapped to the layers that catch them. that mapping is what the stack is.

keep → every new failure gets assigned to the stratum that owns it.
this is the job. not the prompt, the stack under it.

and you are already standing in it. strydeos is a multi-tenant ai product. evidence is a rag system. the coordinator is agent engineering. the harness is your eval discipline. the loop note was one stratum. this is the eight it sits inside.

the one move

the boundary stratum has a live cross-tenant write. that is not a learning task, it is a fix, and it outranks every shiny layer below it. scope the write, ship the reconciler, then descend the rest at the pace the fleet lets you.

build it. ship it. move on.
shippers.
every layer here is a shippers original, top to floor.
field notes: loop engineering · leverage · shippers-tt