Skip to content

Commit 12cf331

Browse files
ekzhujackgerrits
andauthored
Add tool_agent_caller_loop and group chat notebook. (#405)
* Add tool_agent_caller_loop and group chat notebook. * Fix types * fix ref --------- Co-authored-by: Jack Gerrits <[email protected]>
1 parent c8f6f3b commit 12cf331

File tree

9 files changed

+924
-354
lines changed

9 files changed

+924
-354
lines changed

python/docs/src/core-concepts/overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ implementation of the contracts determines how agents handle messages.
116116
The behavior contract is sometimes referred to as the message protocol.
117117
It is the developer's responsibility to implement the behavior contract.
118118
Multi-agent patterns are design patterns that emerge from behavior contracts
119-
(see [Multi-Agent Design Patterns](../getting-started/multi-agent-design-patterns.ipynb)).
119+
(see [Multi-Agent Design Patterns](../getting-started/multi-agent-design-patterns.md)).
120120

121121
### An Example Application
122122

python/docs/src/getting-started/group-chat.ipynb

+399
Large diffs are not rendered by default.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Multi-Agent Design Patterns
2+
3+
Agents can work together in a variety of ways to solve problems.
4+
Research works like [AutoGen](https://aka.ms/autogen-paper),
5+
[MetaGPT](https://arxiv.org/abs/2308.00352)
6+
and [ChatDev](https://arxiv.org/abs/2307.07924) have shown
7+
multi-agent systems out-performing single agent systems at complex tasks
8+
like software development.
9+
10+
A multi-agent design pattern is a structure that emerges from message protocols:
11+
it describes how agents interact with each other to solve problems.
12+
For example, the [tool-equiped agent](./tools.ipynb#tool-equipped-agent) in
13+
the previous section employs a design pattern called ReAct,
14+
which involves an agent interacting with tools.
15+
16+
You can implement any multi-agent design pattern using AGNext agents.
17+
In the next two sections, we will discuss two common design patterns:
18+
group chat for task decomposition, and reflection for robustness.

python/docs/src/getting-started/multi-agent-design-patterns.ipynb renamed to python/docs/src/getting-started/reflection.ipynb

+5-28
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,7 @@
44
"cell_type": "markdown",
55
"metadata": {},
66
"source": [
7-
"# Multi-Agent Design Patterns\n",
8-
"\n",
9-
"Agents can work together in a variety of ways to solve problems.\n",
10-
"Research works like [AutoGen](https://aka.ms/autogen-paper),\n",
11-
"[MetaGPT](https://arxiv.org/abs/2308.00352)\n",
12-
"and [ChatDev](https://arxiv.org/abs/2307.07924) have shown\n",
13-
"multi-agent systems out-performing single agent systems at complex tasks\n",
14-
"like software development.\n",
15-
"\n",
16-
"A multi-agent design pattern is a structure that emerges from message protocols:\n",
17-
"it describes how agents interact with each other to solve problems.\n",
18-
"For example, the [tool-equiped agent](./tools.ipynb#tool-equipped-agent) in\n",
19-
"the previous section employs a design pattern called ReAct,\n",
20-
"which involves an agent interacting with tools.\n",
21-
"\n",
22-
"You can implement any multi-agent design pattern using AGNext agents.\n",
23-
"In this section, we use the reflection pattern as an example."
24-
]
25-
},
26-
{
27-
"cell_type": "markdown",
28-
"metadata": {},
29-
"source": [
30-
"## Reflection\n",
7+
"# Reflection\n",
318
"\n",
329
"Reflection is a design pattern where an LLM generation is followed by a reflection,\n",
3310
"which in itself is another LLM generation conditioned on the output of the first one.\n",
@@ -50,7 +27,7 @@
5027
"will generate a code snippet, and the reviewer agent will generate a critique\n",
5128
"of the code snippet.\n",
5229
"\n",
53-
"### Message Protocol\n",
30+
"## Message Protocol\n",
5431
"\n",
5532
"Before we define the agents, we need to first define the message protocol for the agents."
5633
]
@@ -107,7 +84,7 @@
10784
"\n",
10885
"![coder-reviewer data flow](coder-reviewer-data-flow.svg)\n",
10986
"\n",
110-
"### Agents\n",
87+
"## Agents\n",
11188
"\n",
11289
"Now, let's define the agents for the reflection design pattern."
11390
]
@@ -376,7 +353,7 @@
376353
"cell_type": "markdown",
377354
"metadata": {},
378355
"source": [
379-
"### Logging\n",
356+
"## Logging\n",
380357
"\n",
381358
"Turn on logging to see the messages exchanged between the agents."
382359
]
@@ -397,7 +374,7 @@
397374
"cell_type": "markdown",
398375
"metadata": {},
399376
"source": [
400-
"### Running the Design Pattern\n",
377+
"## Running the Design Pattern\n",
401378
"\n",
402379
"Let's test the design pattern with a coding task."
403380
]

0 commit comments

Comments
 (0)