Find answers from the community

Updated 3 months ago

Don't know if this is the right channel

Don't know if this is the right channel for the below question

What is the idea behind BaseAgentRunner vs BaseAgentWorker?
Like in what scenario should one be chosen over the other?

cc
L
R
r
6 comments
The agent runner uses agent workers.

Basically, the runner holds all the state, and the workers are independent.

From a users point of view, you never see which one you are using. But you can also expose both of these pieces and run steps one at a time with stepwise execution, which gives you time to incorporate human feedback, correct steps, debug, etc.
https://docs.llamaindex.ai/en/stable/examples/agent/agent_runner/agent_runner.html


From a dev point of view, this allows for some complex implementations (i.e. parallel task execution, implementing various papers, etc.).
so basically runner is supposed to be an orchestrator of multiple workers and each worker is an orchestrator of what tools to use at what step?
yes! For example, you can have multiple BaseAgentWorker instances running in parallel, each handling a different task, while a single BaseAgentRunner manages the overall execution.
Got it. So the abstraction is tools -> worker->runner

What was the reason for having the distinction between runner and worker?

I mean tools handle the step execution and worker handles the task execution.

So in a way runner is handing multiple tasks? Why not have a single task and multiple steps (which can be run in a DAG if needed) instead of multiple tasks and each task with multiple steps

Trying to understand the design philosophy πŸ™‚
A runner creates tasks and schedules how they should be ran. A worker executes a single task (i.e. one unit of work)

Using a custom runner for example, you could execute any arbitrary DAG. For example, there is a parallel runner here
https://github.com/run-llama/llama_index/blob/main/llama_index/agent/runner/parallel.py
The motivation for this design is seperating out those two pieces. The workers are stateless, the runner has all the state. This makes both components flexible
Add a reply
Sign up and join the conversation on Discord