Replies: 1 comment 4 replies
-
|
Hi @samushi, very interesting question. I'm quite sure about the need to separate your agents based on the macro tasks they are delegated to do. The more tools you attach to the agents, the higher the chance it makes a mistake. This probability increase even more when your tools refer to completely different domains. I see more specialized agents the way to go. The basic strategy to connect multiple agents one another is always based on tools. Just as an inspiration you could take a look at this article that shows an example of how a multi-agent cooperation can be organized: https://valentinaalto.medium.com/modularity-and-abstraction-in-multi-agent-applications-c566a510f142 At the current stage of Neuron, you can basically have a top level agent with other specialized agents attached as tools. class SupervisorAgent
{
public function provider(): AIProviderInterface
{
...
}
public function tools(): array
{
return [
Tool::make(
'get_product recommendation',
'Get products recommendation based on user preferences.'
)->addProperty(
new ToolProperty(
name: 'preferences',
type: 'string',
description: 'A description of what user loves.',
required: true
);
)->setCallable(function (string $preferences) {
$response = ProductAgent::make()->chat(new UserMessage($preferences));
return $response->getContent();
}),
Tool::make(
'order_agent',
'Manage orders.'
)->addProperty(
new ToolProperty(
name: 'product',
type: 'integer',
description: 'The ID of the product to order.',
required: true
);
)->setCallable(function (string $product) {
$response = OrderAgent::make()->chat(new UserMessage("I want to order the product with ID: {$product}"));
return $response->getContent();
}),
];
}
}Ask directly to the supervisor: $response = SupervisorAgent::make()->chat(new UserMessage('I love skiing, but I'm a beginner. What skis do you recommend?'));
echo $response->getContent();
$response = SupervisorAgent::make()->chat(new UserMessage('I would like to by the blue one.'));
echo $response->getContent();Don't take this example too literally. It needs highly curated prompts and system instructions. It can give you just an idea. Always consider that LLM based interactions is a relatively new product experience. There are not well known patterns to follow. We have to experiment to innovate. Facilitate the orchestration of multiple agents is in our roadmap but nothing implemented for now. If you have any resource, or if you want to share here the result of your next experiments is really appreciated. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
With Agentic, is it enough to create a single Agent class and then define many tools within that agent? Or is it better to separate concerns into multiple agents for example, a SeoAgent, an OrderAgent, and a ProductAgent?
If we go with the multi-agent approach, how would we implement it in a way that still understands and responds correctly to a client’s question that might touch multiple domains?
Beta Was this translation helpful? Give feedback.
All reactions