New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

agentscope

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

agentscope

AgentScope: A Flexible yet Robust Multi-Agent Platform.

  • 0.1.1
  • PyPI
  • Socket score

Maintainers
2

English | 中文 | 日本語

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
DiscordDingTalk

News

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

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

agentscope-logo agentscope-logo
  • new[2024-07-15] AgentScope has implemented the Mixture-of-Agents algorithm. Refer to our MoA example for more details.

  • [2024-06-14] A new prompt tuning module is available in AgentScope to help developers generate and optimize the agents' system prompts! Refer to our tutorial for more details!

  • [2024-06-11] The RAG functionality is available for agents in AgentScope now! A quick introduction to RAG in AgentScope can help you equip your agent with external knowledge!

  • [2024-06-09] We release AgentScope v0.0.5 now! In this new version, AgentScope Workstation (the online version is running on agentscope.io) is open-sourced with the refactored AgentScope Studio!

Full News

https://github.com/qbc2016/AgentScope/assets/22984042/22d45aee-3470-4923-850f-348a5b0faaa7

  • [2024-05-14] Dear AgentScope users, we are conducting a survey on AgentScope Workstation & Copilot user experience. We currently need your valuable feedback to help us improve the experience of AgentScope's Drag & Drop multi-agent application development and Copilot. Your feedback is valuable and the survey will take about 3~5 minutes. Please click URL to participate in questionnaire surveys. Thank you very much for your support and contribution!

  • [2024-05-14] AgentScope supports gpt-4o as well as other OpenAI vision models now! Try gpt-4o with its model configuration and new example Conversation with gpt-4o!

  • [2024-04-30] We release AgentScope v0.0.4 now!

  • [2024-04-27] AgentScope Workstation is now online! You are welcome to try building your multi-agent application simply with our drag-and-drop platform and ask our copilot questions about AgentScope!

  • [2024-04-19] AgentScope supports Llama3 now! We provide scripts and example model configuration for quick set-up. Feel free to try llama3 in our examples!

  • [2024-04-06] We release AgentScope v0.0.3 now!

  • [2024-04-06] New examples Gomoku, Conversation with ReAct Agent, Conversation with RAG Agent and Distributed Parallel Optimization are available now!

  • [2024-03-19] We release AgentScope v0.0.2 now! In this new version, AgentScope supports ollama(A local CPU inference engine), DashScope and Google Gemini APIs.

  • [2024-03-19] New examples "Autonomous Conversation with Mentions" and "Basic Conversation with LangChain library" are available now!

  • [2024-03-19] The Chinese tutorial of AgentScope is online now!

  • [2024-02-27] We release AgentScope v0.0.1 now, which is also available in PyPI!

  • [2024-02-14] We release our paper "AgentScope: A Flexible yet Robust Multi-Agent Platform" in arXiv now!


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.

APITaskModel WrapperConfigurationSome Supported Models
OpenAI APIChatOpenAIChatWrapperguidance
template
gpt-4o, gpt-4, gpt-3.5-turbo, ...
EmbeddingOpenAIEmbeddingWrapperguidance
template
text-embedding-ada-002, ...
DALL·EOpenAIDALLEWrapperguidance
template
dall-e-2, dall-e-3
DashScope APIChatDashScopeChatWrapperguidance
template
qwen-plus, qwen-max, ...
Image SynthesisDashScopeImageSynthesisWrapperguidance
template
wanx-v1
Text EmbeddingDashScopeTextEmbeddingWrapperguidance
template
text-embedding-v1, text-embedding-v2, ...
MultimodalDashScopeMultiModalWrapperguidance
template
qwen-vl-max, qwen-vl-chat-v1, qwen-audio-chat
Gemini APIChatGeminiChatWrapperguidance
template
gemini-pro, ...
EmbeddingGeminiEmbeddingWrapperguidance
template
models/embedding-001, ...
ZhipuAI APIChatZhipuAIChatWrapperguidance
template
glm-4, ...
EmbeddingZhipuAIEmbeddingWrapperguidance
template
embedding-2, ...
ollamaChatOllamaChatWrapperguidance
template
llama3, llama2, Mistral, ...
EmbeddingOllamaEmbeddingWrapperguidance
template
llama2, Mistral, ...
GenerationOllamaGenerationWrapperguidance
template
llama2, Mistral, ...
LiteLLM APIChatLiteLLMChatWrapperguidance
template
models supported by litellm...
Yi APIChatYiChatWrapperguidance
template
yi-large, yi-medium, ...
Post Request based API-PostAPIModelWrapperguidance
template
-

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

Tutorial

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},
    }
    

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc