You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -48,7 +48,7 @@ limitations under the License.
48
48
## ✨ Key Features
49
49
50
50
- 🛠️ **Building Agents**: Accelerate your agent development with tools that make it easier to get your agent into production.
51
-
- 🧩 [**Framework Agnostic:**](./docs/source/components/integrations/frameworks.md) Work side-by-side with agentic frameworks to add the instrumentation necessary for observing, profiling, and optimizing your agents. Use the toolkit with popular frameworks such as [LangChain](https://www.langchain.com/), [LlamaIndex](https://www.llamaindex.ai/), [CrewAI](https://www.crewai.com/), [AG2](https://docs.ag2.ai), [Microsoft Semantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel/), and [Google ADK](https://google.github.io/adk-docs/), as well as custom enterprise agentic frameworks and simple Python agents.
51
+
- 🧩 [**Framework Agnostic:**](./docs/source/components/integrations/frameworks.md) Work side-by-side with agentic frameworks to add the instrumentation necessary for observing, profiling, and optimizing your agents. Use the toolkit with popular frameworks such as [LangChain](https://www.langchain.com/), [LlamaIndex](https://www.llamaindex.ai/), [CrewAI](https://www.crewai.com/), [Microsoft Semantic Kernel](https://learn.microsoft.com/en-us/semantic-kernel/), and [Google ADK](https://google.github.io/adk-docs/), as well as custom enterprise agentic frameworks and simple Python agents.
52
52
- 🔁 [**Reusability:**](./docs/source/components/sharing-components.md) Build components once and use them multiple times to maximize the value from development effort.
53
53
- ⚡ [**Customization:**](docs/source/get-started/tutorials/customize-a-workflow.md) Start with a pre-built agent, tool, or workflow, and customize it to your needs.
54
54
- 💬 [**Built-In User Interface:**](./docs/source/run-workflows/launching-ui.md) Use the NeMo Agent Toolkit UI chat interface to interact with your agents, visualize output, and debug workflows.
-**AG2 Framework Integration:** Demonstrates NVIDIA NeMo Agent Toolkit support for AG2 (formerly AutoGen) alongside other frameworks like LangChain/LangGraph and Semantic Kernel.
55
+
-**Native Async Support:** All workflows use AG2's `a_initiate_group_chat` for non-blocking async execution, with tools awaited natively via `async`/`await`.
51
56
-**Multi-Agent Collaboration:** Shows two specialized agents working together — a TrafficAgent for data retrieval and a FinalResponseAgent for response formatting.
52
57
-**Time-Aware Traffic Status:** Provides realistic traffic information that varies based on time of day (morning rush, evening rush, off-peak hours).
53
58
-**Unified Tool Integration:** Uses the unified abstraction provided by the toolkit to integrate both local tools (traffic status) and MCP tools (time service) without framework-specific code.
54
-
-**AutoPattern Group Chat:** Uses AG2's `ConversableAgent` with `AutoPattern` and `initiate_group_chat` for structured agent communication.
59
+
-**AutoPattern Group Chat:** Uses AG2's `ConversableAgent` with `AutoPattern` and `a_initiate_group_chat` for structured agent communication.
55
60
56
61
## Prerequisites
57
62
@@ -126,6 +131,28 @@ Workflow Result:
126
131
["The current traffic conditions on the 405 South are as follows:\n\n* Segment: Mulholland Drive to LAX\n* Traffic Conditions: Light\n\nIt appears that traffic is relatively clear on the 405 South.\n\nAPPROVE"]
127
132
```
128
133
134
+
## Async Workflow
135
+
136
+
The `config-async.yml` config demonstrates the same traffic workflow using a dedicated async workflow type (`ag2_async_team`). This config is functionally identical to the default but uses a separate workflow registration to clearly distinguish the async execution path:
137
+
138
+
```bash
139
+
nat run --config_file examples/frameworks/nat_ag2_demo/configs/config-async.yml \
140
+
--input "What is the current traffic on the 405 South?"
141
+
```
142
+
143
+
Both `config.yml` and `config-async.yml` use AG2's `a_initiate_group_chat` for async execution. The async config exists as an explicit example of the async pattern for reference.
144
+
145
+
## Research Team Example
146
+
147
+
The `config-research.yml` config demonstrates a different agent pattern — a researcher and writer agent collaborate to produce a structured research summary:
148
+
149
+
```bash
150
+
nat run --config_file examples/frameworks/nat_ag2_demo/configs/config-research.yml \
151
+
--input "What are the latest advances in quantum computing?"
152
+
```
153
+
154
+
This config uses the `ag2_research_team` workflow type which wraps the AG2 research agents as a NAT tool, invoked by a `react_agent` orchestrator.
155
+
129
156
## Observability with Phoenix
130
157
131
158
This section demonstrates how to enable distributed tracing using Phoenix to monitor and analyze the AG2 workflow execution.
@@ -222,7 +249,17 @@ The AG2 workflow consists of two main agents:
222
249
- Provides clear, concise answers to user queries
223
250
- Terminates the conversation with "APPROVE"
224
251
225
-
The agents communicate through AG2's `AutoPattern` with `initiate_group_chat`. A `ConversableAgent` with `human_input_mode="NEVER"` serves as both the user initiator and tool executor — tool calls from TrafficAgent are routed to it for execution, keeping the group chat flow self-contained.
252
+
The agents communicate through AG2's `AutoPattern` with `a_initiate_group_chat`. A `ConversableAgent` with `human_input_mode="NEVER"` serves as both the user initiator and tool executor — tool calls from TrafficAgent are routed to it for execution, keeping the group chat flow self-contained.
253
+
254
+
### Async Execution
255
+
256
+
All AG2 demo workflows use native async execution:
257
+
258
+
-**`a_initiate_group_chat`** orchestrates agent turns without blocking the event loop
259
+
-**Tool functions** are async coroutines (`await fn.acall_invoke(...)`) executed natively by AG2's `a_execute_function`, which checks `is_coroutine_callable(func)` and awaits the result
260
+
-**Streaming tools** collect results into a single response since AG2 tools return a single value
261
+
262
+
This replaces the previous approach of running async tool calls through a `ThreadPoolExecutor`, eliminating unnecessary thread overhead.
226
263
227
264
### Tool Integration
228
265
@@ -232,3 +269,12 @@ This example demonstrates the unified approach to tool integration provided by N
232
269
-**MCP tools** (like `current_datetime`) are configured in YAML using the `mcp_client` function group provided by the toolkit
233
270
234
271
Both types of tools are passed to AG2 agents through the `builder.get_tools()` method, which automatically wraps them for the AG2 framework. This eliminates the need for framework-specific MCP integration code and provides a consistent interface across all supported frameworks (AG2, AutoGen, LangChain, Semantic Kernel, and others).
272
+
273
+
## Available Configs
274
+
275
+
| Config | Workflow Type | Description |
276
+
|--------|--------------|-------------|
277
+
|`config.yml`|`ag2_team`| Default traffic workflow with async group chat |
278
+
|`config-async.yml`|`ag2_async_team`| Explicit async variant of the traffic workflow |
279
+
|`config-research.yml`|`ag2_research_team`| Research team with researcher + writer agents |
280
+
|`config-eval.yml`|`ag2_team`| Traffic workflow with Phoenix tracing and evaluation |
0 commit comments