Learn › Agent Harness, the big picture › Stop 7 › What a harness must do

Stop 7 of 9 · Pages

Think: run the loop and call the model

The part people picture when they say "agent": the loop, the model, and what the model is given to work with.

Requirement 6 of 33

Run the loop

Also called: Orchestration, the agent loop

What drives the turns, and when does it stop?

A requestThe loopask the model, act,repeat, with a limitAn answeror an honesthand-over
The loop from stop 4, as a requirement.

Why

Something has to send each request, read each response, run each tool and decide when enough is enough. The model does none of that.

Without it

The loop runs until someone notices the bill.

Think about

  • Single call, workflow or agent: the simplest kind that does the job
  • The limit on turns, on time and on spend
  • One agent, or a router that hands work to several

In the big picture: Orchestration, the band above the agents

Requirement 7 of 33

Call the model, reliably

Also called: Model gateway

How does every agent reach a model, and what if the model is slow or down?

The loopneeds a decisionModel gatewayone way in, with timelimits and retriesModelsa first choice,then a fallback
One door to every model, shared by every agent.

Why

Model services slow down, fail and change. If each agent calls a model its own way, each one has to solve that again.

Without it

One outage at a model provider stops every agent at once.

Think about

  • Which model for which job: a small fast one, or a strong one
  • How long to wait, how often to retry, and what to fall back to
  • Keys in one place, and tokens counted in one place

In the big picture: Model gateway, in the Think family

Requirement 8 of 33

Give the model the right context

Also called: Context building, retrieval, prompts

What exactly does the model get to see on each turn?

Instructionsthe job, the rules+Knowledgefetched when needed+Messagesso farThe modelknows onlywhat we send
The model knows nothing except what is in the request.

Why

Stop 4 showed that our code sends everything on every turn. Choosing what goes in is the strongest control we have over what comes out.

Without it

The model answers from general knowledge, confidently and wrongly.

Think about

  • What is always sent, and what is fetched only when needed
  • The order, and a size budget, because every word costs money and attention
  • What must be kept out, because this person may not see it

In the big picture: Knowledge, in the Think family

Requirement 9 of 33

Remember

Also called: Memory and state

What does it remember within a conversation, and across them?

The loopturn after turnA state storemessages, steps taken,facts worth keepingNext weekit picks up whereit left off
The model forgets everything. The harness remembers for it.

Why

Between turns and between days, the model holds nothing. Anything that should last has to be written down by our code and sent back in.

Without it

Every conversation starts from zero, or sends so much that it becomes slow and costly.

Think about

  • Within one conversation, and across conversations: two different stores
  • Who may read a memory, and for how long it is kept
  • What to drop when the conversation grows too long to send

In the big picture: Memory and state, in the Think family

← Receive the requestAct →