How does LlamaIndex AgentRunner add structure over a bare ReAct loop?
Same topic, related formats. Practice these next.
Same topic, related formats. Practice these next.
AgentWorker decides one step; AgentRunner owns the Task, persists state between steps, and exposes pause resume inspect controls a bare ReAct while-loop cannot offer.
Imagine a chess engine and a chess clock. The engine knows how to pick the next move given the current board. The clock knows whose turn it is, when to pause, and how to resume a game from a saved position. If you smash both into one program, you have a chess bot that always plays start to finish in one go. You cannot stop it mid-game, you cannot review the moves before the next one, and you cannot swap in a different engine without rewriting the clock. LlamaIndex's AgentWorker is the engine; AgentRunner is the clock plus the saved-game folder. Keeping them separate lets you do things a bot smashed into one program cannot.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example. Click to expand.
Everything you need to truly understand this topic: intuition, mechanics, step by step explanation, code, formulas, and worked example.
Everything important, quickly.
7 min: worker role, runner role, four capabilities the split unlocks, durable Task ids, parallel with LangGraph executor/node, generalisation in Workflows.
from llama_index.core.agent import ReActAgentWorker, AgentRunner
from llama_index.llms.openai import OpenAI
worker = ReActAgentWorker.from_tools(tools, llm=OpenAI(model="gpt-5.5"))
runner = AgentRunner(worker)
# Create the task; do not drive to completion yet
task = runner.create_task("Research X, draft a one-page brief.")
# Advance one step at a time, interleaving human review
step_output = runner.run_step(task.task_id)
print("after step:", runner.get_completed_steps(task.task_id))
if user_approves(step_output):
while not step_output.is_last:
step_output = runner.run_step(task.task_id)
result = runner.finalize_response(task.task_id)
Real products, models, and research that use this idea.
What an interviewer would ask next. Try answering before peeking at the approach.
Red flags and common mistakes that signal junior thinking. Click to expand.
Treating AgentRunner as 'just a wrapper around the worker'. The real value is the Task abstraction with pause resume inspect on persisted state, which a bare while-loop cannot offer.
The night-before-the-interview bullets. Scan these on the way to the call.
Primary sources. Skim if you want the original framing.