Skip to content

Repository files navigation

中文主页 | Tutorial | Roadmap | FAQ

AgentScope Logo

AgentScope: Agent-Oriented Programming for Building LLM Applications

arxivpypipypidocsworkstationlicense

modelscope%2Fagentscope | Trendshift

✨ Why AgentScope?

Easy for beginners, powerful for experts.

AgentScope Framework

  • Transparent to Developers: Transparent is our FIRST principle. Prompt engineering, API invocation, agent building, workflow orchestration, all are visible and controllable for developers. No deep encapsulation or implicit magic.
  • Realtime Steering: Native support for realtime interruption and customized handling.
  • More Agentic: Support agentic tools management, agentic long-term memory control and agentic RAG, etc.
  • Model Agnostic: Programming once, run with all models.
  • LEGO-style Agent Building: All components are modular and independent.
  • Multi-Agent Oriented: Designed for multi-agent, explicit message passing and workflow orchestration, NO deep encapsulation.
  • Highly Customizable: Tools, prompt, agent, workflow, third-party libs & visualization, customization is encouraged everywhere.

Quick overview of important features in AgentScope 1.0:

ModuleFeatureTutorial
modelSupport async invocationModel
Support reasoning model
Support streaming/non-streaming returns
toolSupport async/sync tool functionsTool
Support streaming/non-streaming returns
Support user interruption
Support post-processing
Support group-wise tools management
Support agentic tools management by meta tool
MCPSupport streamable HTTP/SSE/StdIO transportMCP
Support both stateful and stateless mode MCP Client
Support client- & function-level fine-grained control
agentSupport async execution
Support parallel tool calls
Support realtime steering interruption and customized handling
Support automatic state management
Support agent-controlled long-term memory
Support agent hooks
tracingSupport OpenTelemetry-based tracing in LLM, tools, agent and formatterTracing
Support connecting to third-party tracing platforms (e.g. Arize-Phoenix, Langfuse)
memorySupport long-term memoryMemory
sessionProvide session/application-level automatic state managementSession
evaluationProvide distributed and parallel evaluationEvaluation
formatterSupport multi-agent prompt formatting with tools APIPrompt Formatter
Support truncation-based formatter strategy
...

📢 News

  • [2025-09]AgentScope Studio is open-sourced now! Check out the GitHub repo.
  • [2025-08] The new tutorial of v1 is online now! Check out the tutorial for more details.
  • [2025-08] 🎉🎉 AgentScope v1 is released now! This version fully embraces the asynchronous execution, providing many new features and improvements. Check out changelog for detailed changes.

💬 Contact

Welcome to join our community on

DiscordDingTalk

📑 Table of Contents

🚀 Quickstart

💻 Installation

AgentScope requires Python 3.10 or higher.

🛠️ From source

# Pull the source code from GitHub
git clone -b main https://github.com/agentscope-ai/agentscope.git
# Install the package in editable modecd agentscope
pip install -e .

📦 From PyPi

pip install agentscope

📝 Example

👋 Hello AgentScope!

Start with a conversation between user and a ReAct agent 🤖 named "Friday"!

fromagentscope.agentimportReActAgent, UserAgentfromagentscope.modelimportDashScopeChatModelfromagentscope.formatterimportDashScopeChatFormatterfromagentscope.memoryimportInMemoryMemoryfromagentscope.toolimportToolkit, execute_python_code, execute_shell_commandimportos, asyncioasyncdefmain():
toolkit=Toolkit()
toolkit.register_tool_function(execute_python_code)
toolkit.register_tool_function(execute_shell_command)
agent=ReActAgent(
name="Friday",
sys_prompt="You're a helpful assistant named Friday.",
model=DashScopeChatModel(
model_name="qwen-max",
api_key=os.environ["DASHSCOPE_API_KEY"],
stream=True,
),
memory=InMemoryMemory(),
formatter=DashScopeChatFormatter(),
toolkit=toolkit,
)
user=UserAgent(name="user")
msg=NonewhileTrue:
msg=awaitagent(msg)
msg=awaituser(msg)
ifmsg.get_text_content() =="exit":
breakasyncio.run(main())

🎯 Realtime Steering

Natively support realtime interruption in ReActAgent with robust memory preservation, and convert interruption into an observable event for agent to seamlessly resume conversations.

Realtime SteeringRealtime Steering

🛠️ Fine-Grained MCP Control

Developers can obtain the MCP tool as a local callable function, and use it anywhere (e.g. call directly, pass to agent, wrap into a more complex tool, etc.)

fromagentscope.mcpimportHttpStatelessClientfromagentscope.toolimportToolkitimportosasyncdeffine_grained_mcp_control():
# Initialize the MCP clientclient=HttpStatelessClient(
name="gaode_mcp",
transport="streamable_http",
url=f"https://mcp.amap.com/mcp?key={os.environ['GAODE_API_KEY']}",
)
# Obtain the MCP tool as a **local callable function**, and use it anywherefunc=awaitclient.get_callable_function(func_name="maps_geo")
# Option 1: Call directlyawaitfunc(address="Tiananmen Square", city="Beijing")
# Option 2: Pass to agent as a tooltoolkit=Toolkit()
toolkit.register_tool_function(func)
# ...# Option 3: Wrap into a more complex tool# ...

🧑‍🤝‍🧑 Multi-Agent Conversation

AgentScope provides MsgHub and pipelines to streamline multi-agent conversations, offering efficient message routing and seamless information sharing

fromagentscope.pipelineimportMsgHub, sequential_pipelinefromagentscope.messageimportMsgimportasyncioasyncdefmulti_agent_conversation():
# Create agentsagent1= ...
agent2= ...
agent3= ...
agent4= ...
# Create a message hub to manage multi-agent conversationasyncwithMsgHub(
participants=[agent1, agent2, agent3],
announcement=Msg("Host", "Introduce yourselves.", "assistant")
) ashub:
# Speak in a sequential mannerawaitsequential_pipeline([agent1, agent2, agent3])
# Dynamic manage the participantshub.add(agent4)
hub.delete(agent3)
awaithub.broadcast(Msg("Host", "Goodbye!", "assistant"))
asyncio.run(multi_agent_conversation())

💻 AgentScope Studio

Use the following command to install and start AgentScope Studio, to trace and visualize your agent application.

npm install -g @agentscope/studio
as_studio

homeprojectsruntimefriday

📖 Documentation

⚖️ License

AgentScope is released under Apache License 2.0.

📚 Publications

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

@article{agentscope_v1,
author = {
Dawei Gao,
Zitao Li,
Yuexiang Xie,
Weirui Kuang,
Liuyi Yao,
Bingchen Qian,
Zhijian Ma,
Yue Cui,
Haohao Luo,
Shen Li,
Lu Yi,
Yi Yu,
Shiqi He,
Zhiling Luo,
Wenmeng Zhou,
Zhicheng Zhang,
Xuguang He,
Ziqian Chen,
Weikai Liao,
Farruh Isakulovich Kushnazarov,
Yaliang Li,
Bolin Ding,
Jingren Zhou}
title = {AgentScope 1.0: A Developer-Centric Framework for Building Agentic Applications},
journal = {CoRR},
volume = {abs/2508.16279},
year = {2025},
}
@article{agentscope,
author = {
Dawei Gao,
Zitao Li,
Xuchen Pan,
Weirui Kuang,
Zhijian Ma,
Bingchen Qian,
Fei Wei,
Wenhao Zhang,
Yuexiang Xie,
Daoyuan Chen,
Liuyi Yao,
Hongyi Peng,
Zeyu Zhang,
Lin Zhu,
Chen Cheng,
Hongzhu Shi,
Yaliang Li,
Bolin Ding,
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:

About

AgentScope: Agent-Oriented Programming for Building LLM Applications

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages