Agent Executors
info
To make agents more powerful we need to make them iterative, ie. call the model multiple times until they arrive at the final answer. That's the job of the AgentExecutor.
class AgentExecutor {
// a simplified implementation
run(inputs: object) {
const steps = [];
while (true) {
const step = await this.agent.plan(steps, inputs);
if (step instanceof AgentFinish) {
return step.returnValues;
}
steps.push(step);
}
}
}
📄️ Getting Started
Agents use an LLM to determine which actions to take and in what order. An action can either be using a tool and observing its output, or returning to the user.