How LLMs use tools, carry state and complete multi-step work
A model call embedded in software that can execute and repeat steps.
Tool calls and results become part of the next model call.
Separate contexts support parallel work and create summary handoffs.
Repeat the task, measure the distribution and enforce limits in code.
The application calls the LLM, runs approved tools and adds each result to the next model call.
Ask: “Why did demo portfolio’s reported exposure double overnight?”
Suggests a SQL query to compare the position snapshots.
Copy the query and run it against the database.
Paste the returned row counts into the chat.
Suggests the next check: inspect the overnight load history.
Supplies the investigation task once.
Builds the model input and calls the LLM.
Returns a structured request for a tool.
Validates the request, runs the tool and records the result.
Calls the LLM again with the updated transcript.
For this talk: an LLM agent is a software system in which an LLM can select tools, inspect their results and continue until the task finishes or the harness stops the run.
Developer-supplied text that frames the task and the model’s role.
Function names, descriptions and argument schemas describing the operations the LLM may request.
The ordered user, assistant, tool-call and tool-result history from the current run.
{
"name": "run_query",
"description": "Run read-only SQL",
"parameters": {
"sql": "string"
}
}{
"call_id": "call_17",
"name": "run_query",
"arguments": {
"sql": "SELECT ..."
}
}name + arguments
permissions + schema
function or adapter
returned to the loop
tools = [run_query, read_job_log, ...]
messages = [user_task]
while True:
reply = llm(messages, tools)
messages.append(reply)
if not reply.tool_call:
break
result = run_tool(reply.tool_call)
messages.append(result)
This is the mental model for the rest of the talk: call, act, observe, repeat.
tools = [menu...]messages = [user_task] while True: reply = llm(messages, tools) messages.append(reply) if not reply.tool_call: break result = run_tool(reply.tool_call) messages.append(result)
The next step was only as useful as the evidence returned by the environment.
The complete input and generated output must fit within the model’s token limit. Longer histories cost more and can make relevant details harder to retrieve.
Providers may reuse computation for an unchanged prefix. Appending new records preserves it; changing earlier content can reduce the reusable portion.
A failing assertion identifies a concrete condition. The loop can inspect it, modify the code and rerun the same check.
The loop can collect facts and citations. Whether those facts support the conclusion often still requires judgement.
The environment determines which mistakes the loop can detect and correct.
Take software tasks estimated to require a skilled human about 30 minutes. At this horizon, the agent completes roughly half of them successfully.
Across the historical data, this 50% horizon doubled roughly every seven months.
A lead assigns separate investigations to workers with their own transcripts, then combines the reports.
A test, reconciliation service, independent source or person may provide the checker.
This determines whether the loop can detect and correct errors.
Consider reversibility, financial impact, regulation and the time available to intervene.
This determines permissions, approvals and deterministic limits.
Refactors, migrations, test generation and backtest plumbing can run against regression suites and known invariants.
Tests, compilation, benchmark outputs and invariant checks.
The agent can inspect trades, compare snapshots and read job logs before proposing a remediation.
Read operations run directly; state-changing writes wait for approval.
Retrieve: overnight news, portfolio and calendar.
Produce: a concise team briefing with source links.
Review: material claims and audience relevance.
Retrieve: transcripts, estimates and prior guidance.
Produce: surprises, changes and cited excerpts.
Review: interpretation and analytical relevance.
system prompt · tools · state construction · parsers · retries · dispatch logic
Meta-Harness is one recent research system that searches over the code controlling what an LLM stores, retrieves and sees.
Revise the current answer.
Change stored state, prompts or tools.
Search over workflows and scaffolds.
Train parameters from task feedback.
Use improved systems to produce further improvements.
1What is an LLM agent?An LLM operating inside a software loop with tools.
2How does it continue?The harness records tool calls and results in the transcript.
3Why multiple agents?Separate contexts support parallel work and introduce lossy handoffs.
4How should we use them?Attach verifiers, repeat evaluations and enforce limits in code.
While generating one response, the inference engine stores key/value representations for preceding tokens so it does not recompute the full sequence for every new token.
Across agent-loop calls, a provider may reuse computation for an unchanged prompt prefix. Tools, system content and earlier messages must match the provider’s rules.
The worker’s answer to its assigned subtask.
Facts and qualifiers that could change the conclusion.
Citations, document IDs or retrieval handles.
Open questions, confidence and conflicting evidence.
Workflows, agents and common implementation patterns.
anthropic.com/engineering/building-effective-agentsState, retrieval, compaction and long-running tasks.
anthropic.com/engineering/effective-context-engineering-for-ai-agentsLead-worker architecture, evaluation results and token costs.
anthropic.com/engineering/multi-agent-research-system