Skip to main content

AgentScope: A Flexible yet Robust Multi-Agent Platform.

Project description

English | 中文 | 日本語

modelscope%2Fagentscope | Trendshift

AgentScope

agentscope-logo

Start building LLM-empowered multi-agent applications in an easier way.

  • If you find our work helpful, please kindly cite our paper.

  • Visit our workstation to build multi-agent applications with dragging-and-dropping.

agentscope-workstation
  • Welcome to join our community on
Discord DingTalk

News

  • new[2025-03-21] AgentScope supports hooks functions now. Refer to our tutorial for more details.

  • new[2025-03-19] AgentScope supports tools API now. Refer to our tutorial.

  • new[2025-03-20] Agentscope now supports MCP Server! You can learn how to use it by following this tutorial.

  • new[2025-03-05] Our multi-source RAG Application (the chatbot used in our Q&A DingTalk group) is open-source now!

  • new[2025-02-24] Chinese version tutorial is online now!

  • new[2025-02-13] We have release the technical report of our solution in SWE-Bench(Verified)!

  • new[2025-02-07] 🎉 AgentScope has achieved a 63.4% resolve rate in SWE-Bench(Verified). More details about our solution are coming soon!

  • new[2025-01-04] AgentScope supports Anthropic API now.

  • new[2024-12-12] We have updated the roadmap of AgentScope.

  • [2024-09-06] AgentScope version 0.1.0 is released now.

  • [2024-09-03] AgentScope supports Web Browser Control now! Refer to our example for more details.

For older news and updates, check our Old News


What's AgentScope?

AgentScope is an innovative multi-agent platform designed to empower developers to build multi-agent applications with large-scale models. It features three high-level capabilities:

  • 🤝 Easy-to-Use: Designed for developers, with fruitful components, comprehensive documentation, and broad compatibility. Besides, AgentScope Workstation provides a drag-and-drop programming platform and a copilot for beginners of AgentScope!

  • High Robustness: Supporting customized fault-tolerance controls and retry mechanisms to enhance application stability.

  • 🚀 Actor-Based Distribution: Building distributed multi-agent applications in a centralized programming manner for streamlined development.

Supported Model Libraries

AgentScope provides a list of ModelWrapper to support both local model services and third-party model APIs.

API Task Model Wrapper Configuration Some Supported Models
OpenAI API Chat OpenAIChatWrapper template gpt-4o, gpt-4, gpt-3.5-turbo, ...
Embedding OpenAIEmbeddingWrapper template text-embedding-ada-002, ...
DALL·E OpenAIDALLEWrapper template dall-e-2, dall-e-3
DashScope API Chat DashScopeChatWrapper template qwen-plus, qwen-max, ...
Image Synthesis DashScopeImageSynthesisWrapper template wanx-v1
Text Embedding DashScopeTextEmbeddingWrapper template text-embedding-v1, text-embedding-v2, ...
Multimodal DashScopeMultiModalWrapper template qwen-vl-max, qwen-vl-chat-v1, qwen-audio-chat
Gemini API Chat GeminiChatWrapper template gemini-pro, ...
Embedding GeminiEmbeddingWrapper template models/embedding-001, ...
ZhipuAI API Chat ZhipuAIChatWrapper template glm-4, ...
Embedding ZhipuAIEmbeddingWrapper template embedding-2, ...
ollama Chat OllamaChatWrapper template llama3, llama2, Mistral, ...
Embedding OllamaEmbeddingWrapper template llama2, Mistral, ...
Generation OllamaGenerationWrapper template llama2, Mistral, ...
LiteLLM API Chat LiteLLMChatWrapper template models supported by litellm...
Yi API Chat YiChatWrapper template yi-large, yi-medium, ...
Post Request based API - PostAPIModelWrapper template -
Anthropic API Chat AnthropicChatWrapper template claude-3-5-sonnet-20241022, ...

Supported Local Model Deployment

AgentScope enables developers to rapidly deploy local model services using the following libraries.

Supported Services

  • Web Search
  • Data Query
  • Retrieval
  • Code Execution
  • File Operation
  • Text Processing
  • Multi Modality
  • Wikipedia Search and Retrieval
  • TripAdvisor Search
  • Web Browser Control

Example Applications

More models, services and examples are coming soon!

Installation

AgentScope requires Python 3.9 or higher.

Note: This project is currently in active development, it's recommended to install AgentScope from source.

From source

  • Install AgentScope in editable mode:
# Pull the source code from GitHub
git clone https://github.com/modelscope/agentscope.git

# Install the package in editable mode
cd agentscope
pip install -e .

Using pip

  • Install AgentScope from pip:
pip install agentscope

Extra Dependencies

To support different deployment scenarios, AgentScope provides several optional dependencies. Full list of optional dependencies refers to tutorial Taking distribution mode as an example, you can install its dependencies as follows:

On Windows

# From source
pip install -e .[distribute]
# From pypi
pip install agentscope[distribute]

On Mac & Linux

# From source
pip install -e .\[distribute\]
# From pypi
pip install agentscope\[distribute\]

Quick Start

Configuration

In AgentScope, the model deployment and invocation are decoupled by ModelWrapper.

To use these model wrappers, you need to prepare a model config file as follows.

model_config = {
    # The identifies of your config and used model wrapper
    "config_name": "{your_config_name}",          # The name to identify the config
    "model_type": "{model_type}",                 # The type to identify the model wrapper

    # Detailed parameters into initialize the model wrapper
    # ...
}

Taking OpenAI Chat API as an example, the model configuration is as follows:

openai_model_config = {
    "config_name": "my_openai_config",             # The name to identify the config
    "model_type": "openai_chat",                   # The type to identify the model wrapper

    # Detailed parameters into initialize the model wrapper
    "model_name": "gpt-4",                         # The used model in openai API, e.g. gpt-4, gpt-3.5-turbo, etc.
    "api_key": "xxx",                              # The API key for OpenAI API. If not set, env
                                                   # variable OPENAI_API_KEY will be used.
    "organization": "xxx",                         # The organization for OpenAI API. If not set, env
                                                   # variable OPENAI_ORGANIZATION will be used.
}

More details about how to set up local model services and prepare model configurations is in our tutorial.

Create Agents

Create built-in user and assistant agents as follows.

from agentscope.agents import DialogAgent, UserAgent
import agentscope

# Load model configs
agentscope.init(model_configs="./model_configs.json")

# Create a dialog agent and a user agent
dialog_agent = DialogAgent(name="assistant",
                           model_config_name="my_openai_config")
user_agent = UserAgent()

Construct Conversation

In AgentScope, message is the bridge among agents, which is a dict that contains two necessary fields name and content and an optional field url to local files (image, video or audio) or website.

from agentscope.message import Msg

x = Msg(name="Alice", content="Hi!")
x = Msg("Bob", "What about this picture I took?", url="/path/to/picture.jpg")

Start a conversation between two agents (e.g. dialog_agent and user_agent) with the following code:

x = None
while True:
    x = dialog_agent(x)
    x = user_agent(x)
    if x.content == "exit":  # user input "exit" to exit the conversation_basic
        break

AgentScope Studio

AgentScope provides an easy-to-use runtime user interface capable of displaying multimodal output on the front end, including text, images, audio and video.

Refer to our tutorial for more details.

agentscope-logo

License

AgentScope is released under Apache License 2.0.

Contributing

Contributions are always welcomed!

We provide a developer version with additional pre-commit hooks to perform checks compared to the official version:

# For windows
pip install -e .[dev]
# For mac
pip install -e .\[dev\]

# Install pre-commit hooks
pre-commit install

Please refer to our Contribution Guide for more details.

Publications

If you find our work helpful for your research or application, please cite our papers.

  1. AgentScope: A Flexible yet Robust Multi-Agent Platform

    @article{agentscope,
        author  = {Dawei Gao and
                   Zitao Li and
                   Xuchen Pan and
                   Weirui Kuang and
                   Zhijian Ma and
                   Bingchen Qian and
                   Fei Wei and
                   Wenhao Zhang and
                   Yuexiang Xie and
                   Daoyuan Chen and
                   Liuyi Yao and
                   Hongyi Peng and
                   Ze Yu Zhang and
                   Lin Zhu and
                   Chen Cheng and
                   Hongzhu Shi and
                   Yaliang Li and
                   Bolin Ding and
                   Jingren Zhou}
        title   = {AgentScope: A Flexible yet Robust Multi-Agent Platform},
        journal = {CoRR},
        volume  = {abs/2402.14034},
        year    = {2024},
    }
    

Contributors ✨

All thanks to our contributors:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

agentscope-0.1.4.tar.gz (859.1 kB view details)

Uploaded Source

Built Distribution

agentscope-0.1.4-py3-none-any.whl (967.1 kB view details)

Uploaded Python 3

File details

Details for the file agentscope-0.1.4.tar.gz.

File metadata

  • Download URL: agentscope-0.1.4.tar.gz
  • Upload date:
  • Size: 859.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for agentscope-0.1.4.tar.gz
Algorithm Hash digest
SHA256 c89da1e812457501c3dc0886db33ce05eb73dce3e75a199e4fd4c94cca0239d3
MD5 68cb659488b9a660c0970e5a82f9b8aa
BLAKE2b-256 089b5af516ce142dab4af881c5ab4ecb5a9ec620f48c3c3506fb126bcb08ee47

See more details on using hashes here.

File details

Details for the file agentscope-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: agentscope-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 967.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for agentscope-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 2ceca725f4e950373ae840a3d781b93a79be32931f95af7ed50e98aaf623ec8c
MD5 0aee9575b50b91e34637af474349b1db
BLAKE2b-256 6606039f33f33b8960c364190ce9083fa82e8d5821ebe14fb9a42c28273e5821

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page