Files
codex-bot a64378956a
Some checks failed
Pre-commit / run (ubuntu-latest) (push) Has been cancelled
Deploy Sphinx documentation to Pages / build_en (ubuntu-latest, 3.10) (push) Has been cancelled
Deploy Sphinx documentation to Pages / build_zh (ubuntu-latest, 3.10) (push) Has been cancelled
Python Unittest Coverage / test (macos-15, 3.10) (push) Has been cancelled
Python Unittest Coverage / test (macos-15, 3.11) (push) Has been cancelled
Python Unittest Coverage / test (macos-15, 3.12) (push) Has been cancelled
Python Unittest Coverage / test (ubuntu-latest, 3.10) (push) Has been cancelled
Python Unittest Coverage / test (ubuntu-latest, 3.11) (push) Has been cancelled
Python Unittest Coverage / test (ubuntu-latest, 3.12) (push) Has been cancelled
Python Unittest Coverage / test (windows-latest, 3.10) (push) Has been cancelled
Python Unittest Coverage / test (windows-latest, 3.11) (push) Has been cancelled
Python Unittest Coverage / test (windows-latest, 3.12) (push) Has been cancelled
chore: initialize sandbox and overwrite remote content
2026-03-02 22:32:27 +08:00
..

MultiAgent Conversation

This example demonstrates how to build a multi-agent conversation workflow using MsgHub in AgentScope, where multiple agents broadcast messages to each other in a shared conversation space.

Setup

The example is built upon the DashScope LLM API in main.py. You can switch to other LLMs by modifying the model and formatter parameters in the code.

To run the example, first install the latest version of AgentScope, then run:

python examples/workflows/multiagent_conversation/main.py

Main Workflow

  • Create multiple participant agents with different attributes (e.g., Alice, Bob, Charlie).
  • Agents introduce themselves and interact in the message hub.
  • Supports dynamic addition and removal of agents, as well as broadcasting messages.

Note: The example is built with DashScope chat model. If you want to change the model in this example, don't forget to change the formatter at the same time! The corresponding relationship between built-in models and formatters are list in our tutorial