1:1 mentoring with Big Tech AI engineers
System Design

Agent Tech Stack

The ten layers of a production agent stack — model access, gateway, orchestration, runtime, state, vector, queue, observability, evals, secrets — with the choice criterion for each, three fully costed reference stacks, and the four buy-vs-build calls that matter.

Last updated

Production25 min readFirst readDeploy Your First Agent

After this section you can

  • Name the ten layers of an agent stack and what each one is for in one sentence
  • Choose within each layer using a single decision criterion instead of a feature matrix
  • Map every layer onto AWS, GCP, Azure, or a no-big-three equivalent
  • Cost a weekend prototype, a Series-A SaaS, and a regulated enterprise stack line by line
  • Recognise the trigger that forces a jump to the next tier — and resist jumping early
  • Defend the four buy-vs-build calls that actually matter
SD-31

The Agent Production Tech Stack

Not a tool list — a decision document. Ten layers, the criterion that decides each one, and three reference stacks costed line by line.

“What’s your stack?” is the question you get from your CTO, your first platform hire, and every interviewer who wants to know whether you have shipped one of these. The bad answer is a list of nine product names. The good answer is ten layers, one sentence each about what the layer is for, one criterion that decides the choice, and the trigger that would make you change it. This section is built to be read in either direction: skim the plain-English lines to understand the map, or read the criteria to make real decisions. Every layer names the AWS, GCP, and Azure service that fills it — plus the option that avoids the big three entirely.

READ THIS FIRST: THE BORING STACK WINS

Nine out of ten agent systems in production are Postgres, one queue, one Redis, OpenTelemetry, a thin model gateway, and roughly 800 lines of your own orchestration code. The elaborate stacks are almost always a team that adopted a framework before they understood the problem, and is now debugging the framework instead of the agent. Treat every row below as guilty until proven necessary; the default column exists because it is usually right.

The one-screen answer

If you remember nothing else from this section, remember this table. It is a defensible production stack for the large majority of agent products, and every row is justified in detail below.

Ten layers, ten defaults — the whole section on one screen
MODELPATH01Model accesstokens out of a modelprovider API, one pinned version02Gatewayone choke point: keys, budgets, routing~200 lines of your ownTHEAGENT03Orchestrationrunning think → act → observea while loop you wrote04Runtimekeeping the process alive and scaledcontainer on a managed platformSTATE& WORK05Stateconversations, runs, steps, checkpointsPostgres06Knowledgeretrieving the right contextpgvector, that same Postgres07Queue / busbursts, long work, fan-outyour cloud’s managed queueKNOWINGIT WORKS08Observabilityanswering “why did it say that?”OTel + one trace viewer09Evalsknowing a change is safe to shipJSONL cases + a runner in CISHIPPING10Secrets & CI/CDshipping the seven artifactssecret store + the CI you haveTHE SANE DEFAULT FOR EACH LAYER — EVERY ROW JUSTIFIED BELOWSix of the ten defaults are things you already run. That is the entire argument of this section.

Related

More in System Design

Get full access to all 74+ sections with code examples, diagrams, and interactive animations.

Unlock Premium