MS-Agent: Lightweight Framework for Empowering Agents with Autonomous Exploration
Homepage | MCP Playground | Paper | Documentation | 中文文档
👋 Introduction
MS-Agent is a modular, extensible open-source agent framework built for complex, long-running tasks. Combine models, tools, skills, and sub-agents with a customizable harness to build a productivity assistant tailored to your work. The harness manages planning, context, permissions, and execution feedback, while project memory and autonomous scheduling help the assistant keep complex tasks moving forward.
A shared Python SDK handles execution and management for the CLI, TUI, and WebUI, so you can reuse agent logic and extensions across terminals, browser workspaces, and business applications with less integration and maintenance work.
Features · Installation · Applications · Documentation
Join the community and share feedback: Discord · GitHub Issues
WeChat and Discord QR codes
| Discord | |
|---|---|
For earlier demos and documentation, see ModelScope-Agent 0.8.0 and earlier.
🎉 News
- 🚀 Nov 26, 2026: MS-Agent v1.7.0 is released — upgrading the multi-surface workspace and customizable Agent Harness for controllable, extensible long-horizon execution. Published on PyPI and Docker, and available to explore online in ModelScope Agent Playground (Release Notes):
- Redesigned WebUI Workspace & Native TUI: Rebuilt the browser workspace (
ms-agent ui) and introduced a default terminal interface (ms-agent) on one shared SDK runtime, delivering end-to-end execution visibility, mid-run steering and interactive decision-making, multi-branch session exploration, and inline workspace file collaboration for local projects. WebUI guide · TUI guide - Multi-Layer Context & Memory Architecture: Decouples immutable session history, active model context, and persistent cross-session memory—combining composable context pruning and auto/manual compaction strategies, a pluggable unified memory layer (from local files to adapters such as ReMe and mem0), and native compatibility with standard workspace instruction and prompt templates (such as
AGENTS.md) for resilient long-horizon execution and recovery. Context · Memory - Fine-Grained Execution Control & Production Security: Introduces scriptable lifecycle Hooks, execution feedback controls, and Cron scheduling to precisely customize agent boundaries and recurring automation; adds layered permission approvals, encryption at rest for managed credentials, optional single-user WebUI authentication, and fault-isolated MCP startup for reliable local and remote deployments. Permissions · Hooks · Credentials
- Skill Lifecycle Governance & Evaluation-Driven Evolution: Streamlines Skill installation and maintenance with pre-update diff review and version rollback, turning skills into auditable engineering assets; supports the Skill Evolution workflow to iteratively refine skills from execution traces, automated evaluations, and reflection feedback, comparing candidates on a validation set. Skill management · Skill Evolution
- Open Protocols & Cross-Framework Ecosystem: Natively reuses community plugins across formats such as Claude Code, Codex, and OpenClaw, supports migrating and synchronizing instructions, skills, and memory across frameworks via Agent Hub, and connects editors, interactive clients, and remote agents through ACP and A2A. Plugins · Agent Hub · ACP · A2A
- Redesigned WebUI Workspace & Native TUI: Rebuilt the browser workspace (
-
🚀 Jul 13, 2026: Added Agent Hub support for managing agent workspace files locally and in remote ModelScope repositories with
ms-agent agent. Features include uploads and downloads, background sync (watch), conversion between frameworks, status checks, backups, and restoration forqoder,qwenpaw,openclaw,hermes,nanobot,openhuman, andms-agent. -
🏆 Apr 09, 2026: Agentic Insight v2 is now #2 Open-Source (#5 Overall) on DeepResearch Bench — scoring 55.31 with the submitted version (Qwen3.5-Plus + GPT 5.2). Leaderboard | Agentic Insight v2.
-
🚀 Mar 23, 2026: Release MS-Agent v1.6.0, which includes the following updates:
- Context Compression: Added context compression mechanism with token usage monitoring, overflow detection, and automatic context compaction via pruning historical tool outputs and LLM-based summarization.
- Agentic Insight v2 Enhancements: Major architecture and performance improvements to the deep research system; achieves 55.43 on DeepResearch Bench with GPT5 and Qwen3.5-plus/flash. See Agentic Insight v2.
- Knowledge Search: Integrated Sirchmunk for intelligent retrieval over local codebases and documentation during agent conversations. See the retrieval guide.
- Multimodal Model Input: Support image, video, and other multimodal inputs. See the multimodal guide.
-
🚀 Feb 06, 2026: Release MS-Agent v1.6.0rc1, which includes the following updates:
- Agentic Insight v2: A fully refactored deep-research system with better performance, scalability, and trustworthiness, with a WebUI entry point. See Agentic Insight v2.
-
🚀 Feb 04, 2026: Release MS-Agent v1.6.0rc0, which includes the following updates:
- Code Genesis for complex code generation tasks, refer to Code Genesis
- Singularity Cinema for animated video generation workflow, refactored version, refer to Singularity Cinema
- Agent Skills v2: Knowledge-driven skill system — skills as procedural knowledge with progressive disclosure, multi-source loading, and standard tool integration. Refer to Agent Skills.
- WebUI: A new WebUI has been added, featuring agentic chatting capabilities, complex code generation and video generation workflow.
2025 and earlier
-
🎬 Nov 13, 2025: Release Singularity Cinema, to support short video generation for complex scenarios, check here
-
🚀 Nov 12, 2025: Release MS-Agent v1.5.0, which includes the following updates:
- 🔥 We present FinResearch, a multi-agent workflow tailored for financial research
- Support financial data collection via Akshare and Baostock
- Support DagWorkflow for workflow orchestration
- Optimize the DeepResearch workflow for stability and efficiency
- FinResearch official documentation: FinResearch Doc
- DEMO: FinResearchStudio
- Examples: FinResearchExamples
-
🚀 Nov 07, 2025: Release MS-Agent v1.4.0, which includes the following updates:
- 🔥 We present MS-Agent Skills, an Implementation of Anthropic-Agent-Skills Protocol.
- 🔥 Add Docs and 中文文档
- 🔥 Support Sandbox Framework ms-enclave
-
🚀 Sep 22, 2025: Release MS-Agent v1.3.0, which includes the following updates:
- 🔥 Support Code Scratch
- Support
Memoryfor building agents with long-term and short-term memory - Enhance the DeepResearch workflow
- Support RAY for accelerating document information extraction
- Support Anthropic API format for LLMs
-
🚀 Aug 28, 2025: Release MS-Agent v1.2.0, which includes the following updates:
- DocResearch now supports pushing to
ModelScope、HuggingFace、GitHubfor easy sharing of research reports. Refer to Doc Research for more details. - DocResearch now supports exporting the Markdown report to
HTML、PDF、PPTXandDOCXformats, refer to Doc Research for more details. - DocResearch now supports
TXTfile processing and file preprocessing, refer to Doc Research for more details.
- DocResearch now supports pushing to
-
🚀 July 31, 2025: Release MS-Agent v1.1.0, which includes the following updates:
- 🔥 Support Doc Research, demo: DocResearchStudio
- Add
General Web Search Enginefor Agentic Insight (DeepResearch) - Add
Max Continuous Runsfor Agent chat with MCP.
-
🚀 July 18, 2025: Release MS-Agent v1.0.0, improve the experience of Agent chat with MCP, and update the readme for Agentic Insight.
-
🚀 July 16, 2025: Release MS-Agent v1.0.0rc0, which includes the following updates:
- Support for Agent chat with MCP (Model Context Protocol)
- Support for Deep Research (Agentic Insight), refer to: Report_Demo, Script_Demo
- Support for MCP-Playground
- Add callback mechanism for Agent chat
-
🔥🔥🔥Aug 8, 2024: A new graph based code generation tool CodexGraph is released by Modelscope-Agent, it has been proved effective and versatile on various code related tasks, please check example.
-
🔥🔥Aug 1, 2024: A high efficient and reliable Data Science Assistant is running on Modelscope-Agent, please find detail in example.
-
🔥July 17, 2024: Parallel tool calling on Modelscope-Agent-Server, please find detail in doc.
-
🔥June 17, 2024: Upgrading RAG flow based on LLama-index, allow user to hybrid search knowledge by different strategies and modalities, please find detail in doc.
-
🔥June 6, 2024: With Modelscope-Agent-Server, Qwen2 could be used by OpenAI SDK with tool calling ability, please find detail in doc.
-
🔥June 4, 2024: Modelscope-Agent supported Mobile-Agent-V2arxiv,based on Android Adb Env, please check in the application.
-
🔥May 17, 2024: Modelscope-Agent supported multi-roles room chat in the gradio.
-
May 14, 2024: Modelscope-Agent supported image input in
RolePlayagents with latest OpenAI modelGPT-4o. Developers can experience this feature by specifying theimage_urlparameter. -
May 10, 2024: Modelscope-Agent launched a user-friendly
Assistant API, and also provided aTools APIthat executes utilities in isolated, secure containers, please find the document -
Apr 12, 2024: The Ray version of multi-agent solution is on modelscope-agent, please find the document
-
Mar 15, 2024: Modelscope-Agent and the AgentFabric (opensource version for GPTs) is running on the production environment of modelscope studio.
-
Feb 10, 2024: In Chinese New year, we upgrade the modelscope agent to version v0.3 to facilitate developers to customize various types of agents more conveniently through coding and make it easier to make multi-agent demos. For more details, you can refer to #267 and #293 .
-
Nov 26, 2023: AgentFabric now supports collaborative use in ModelScope's Creation Space, allowing for the sharing of custom applications in the Creation Space. The update also includes the latest GTE text embedding integration.
-
Nov 17, 2023: AgentFabric released, which is an interactive framework to facilitate creation of agents tailored to various real-world applications.
-
Oct 30, 2023: Facechain Agent released a local version of the Facechain Agent that can be run locally. For detailed usage instructions, please refer to Facechain Agent.
-
Oct 25, 2023: Story Agent released a local version of the Story Agent for generating storybook illustrations. It can be run locally. For detailed usage instructions, please refer to Story Agent.
-
Sep 20, 2023: ModelScope GPT offers a local version through gradio that can be run locally. You can navigate to the demo/msgpt/ directory and execute
bash run_msgpt.sh. -
Sep 4, 2023: Three demos, demo_qwen, demo_retrieval_agent and demo_register_tool, have been added, along with detailed tutorials provided.
-
Sep 2, 2023: The preprint paper associated with this project was published.
-
Aug 22, 2023: Support accessing various AI model APIs using ModelScope tokens.
-
Aug 7, 2023: The initial version of the modelscope-agent repository was released.
✨ Features
🖥️ Unified Multi-Surface Agent Workspace
One shared Python SDK runtime powers the browser WebUI (ms-agent ui), native terminal TUI (ms-agent), CLI, and embedded application integrations. Built for real project workflows, it provides end-to-end reasoning and tool observability, queued and mid-run steering inputs, structured interactive decision-making, session branching from any completed turn, inline workspace file collaboration, and built-in multi-provider model capability metadata for automatic context budgeting, thinking controls, and vision alignment. WebUI guide · TUI guide
🧩 Customizable Harness & Production Security
Extensible Execution & Customization: Organizes tool execution, plan checks, and feedback loops into a highly customizable runtime—use lifecycle callbacks and command-based Hooks to apply business rules, inspect or rewrite tool arguments, and drive feedback loops, paired with recurring task scheduling for research, monitoring, and continuous maintenance.
Production Security & Fault Isolation: Defines clear boundaries between autonomous execution and human approval through rule-based safety guards and layered permission policies, paired with encryption at rest for managed credentials, optional single-user WebUI authentication, and MCP startup fault isolation for reliable local and remote deployments. Permissions · Hooks · Credentials
🧠 Context and Memory for Long-running Tasks
Manages immutable session history, active model context, and persistent project memory as three decoupled layers: session logs preserve full records for crash-safe recovery, the context layer supports composable tool-output pruning and automatic/manual compaction, and the unified memory layer supports pluggable backends (local file storage as well as ReMe, mem0, and other adapters). Native compatibility with SOUL.md, AGENTS.md, and PROFILE.md brings standard workspace instructions and prompt templates seamlessly into long-horizon workflows. Context management · Memory · Workspace personalization
🤝 Autonomous Collaboration and Explicit Workflows
Let a lead agent dynamically delegate open-ended tasks to specialist sub-agents with isolated contexts, or define deterministic stages and dependencies through explicit workflows. Tailor models, tools, and skills per role to move smoothly from autonomous exploration to structured delivery. Sub-agents · Workflows
📈 Managed, Evaluation-Driven Agent Skills
Package domain knowledge and operating procedures into progressively disclosed Agent Skills reused across tasks. Install and upgrade Skills directly from GitHub or ModelScope links with pre-update file diff reviews and one-click rollback, keeping team skills auditable and maintainable. Installation and updates
The Skill Evolution workflow builds on execution traces and evaluation feedback to generate candidate revisions, compares them on a validation set, and tracks skill versions and scores for verifiable, evidence-backed improvement. Workflow guide
🔌 Open Protocols and Portable Agent Ecosystem
Connect to mainstream model providers within a lock-in-free interoperability layer: integrate natively with code editors and interactive clients over ACP (Agent Client Protocol)—supporting both bidirectional integration and external agent proxying—and enable cross-service discovery and remote agent collaboration over A2A (Agent-to-Agent).
Natively reuse community plugins across formats such as Claude Code, Codex, and OpenClaw (skills, commands, agent definitions, Hooks, and MCP configurations), and use Agent Hub (ms-agent agent) to convert, redact, synchronize, back up, and restore instructions, skills, and memory across frameworks such as MS-Agent, QwenPaw, OpenClaw, and Hermes, among others. Plugin support · Agent Hub · ACP · A2A
🎯 From Framework Capabilities to Domain Applications
Built-in applications bring models, tools, and multi-agent collaboration together into complete workflows for research, software development, financial analysis, and content creation. Use them directly for specialized tasks, or build on their workflows and domain expertise to create your own applications. Explore the applications
🚀 Installation
Install from PyPI, Docker, or source, or explore online with zero setup. Pick the fastest path for your workflow:
| Interface | Best suited for | Fastest way to start |
|---|---|---|
| ☁️ Agent Playground | Zero-setup online trial directly on ModelScope | Try modelscope.cn/agents/playground |
| 🖥️ WebUI | Local browser workspace with live execution visibility & file editing (Python 3.12+, Node 22.22.0+, pnpm) | python -m pip install -U "ms-agent[webui]" → ms-agent ui |
| ⌨️ TUI / CLI / SDK | Terminal sessions, scripts, or Python application integration (Python 3.10+) | python -m pip install -U ms-agent → ms-agent |
| 🐳 Docker Image | Zero host Python / Node setup for instant workspace deployment | docker run ... ms-agent:1.7.0 (Deployment guide) |
For the default ModelScope provider, get an API key from the access token page. The local steps below use PyPI.
🖥️ WebUI
MS-Agent WebUI provides a browser workspace for local projects. Chat with models, follow tool activity, manage skills and MCP tools, and browse or edit project files without leaving the interface.
WebUI demo: organize event materials and create a briefing. See task planning, approvals for file changes, and result checks in action.
https://github.com/user-attachments/assets/43b3c1cc-555a-4184-b1dd-66e0a21e7a12
Check the versions with python3 --version and node --version; see the Quick start for environment setup. With Python 3.12+, create and activate a virtual environment, or activate an existing one:
python3 -m venv ms-agent-env
source ms-agent-env/bin/activate
Install and start the app in the same terminal:
npm install --global pnpm@10.17.1
python -m pip install -U "ms-agent[webui]"
ms-agent ui
The package includes the built frontend. First launch installs its Node dependencies in a local cache, so stay connected to the internet. The browser opens at the address printed in the terminal, usually http://127.0.0.1:8000; if that port is busy, the app chooses another. Press Ctrl-C in the terminal to stop the service.
Then configure a model and send your first message:
- Open Settings → Models, select your provider, and click Edit to save your API key. ModelScope keys are available on the access token page. If your provider is not listed, follow the model settings guide to add it first.
- Click Add model under that provider and enter a supported model ID, such as
Qwen/Qwen3.8-Flash-Nextfor ModelScope. Saving a key does not add or select a model. - Return to chat, select the model below the message box, keep permissions set to Always ask, and send a short request such as “Describe in two sentences how you can help me.”
Keys and sessions are stored locally under ~/.ms_agent by default. Do not commit .env files or expose API keys in conversations or screenshots.
Continue with the WebUI guide, or see Troubleshooting if a request fails.
ms-agent ui --port 8080 # Choose another port
ms-agent ui --no-browser # Do not open a browser
More installation and development options are in the WebUI README.
⌨️ Terminal and SDK
TUI, CLI, and the Python SDK require Python 3.10+; Node.js and pnpm are not needed. If you already installed the WebUI, reuse its Python environment and configure your API key below. Otherwise, create or activate a Python environment, then install from PyPI. See the Quick start for environment setup:
python3 -m venv ms-agent-env
source ms-agent-env/bin/activate
python -m pip install -U ms-agent
The following examples use ModelScope inference by default. Set your API key in the terminal where you will run the commands or Python program:
export MODELSCOPE_API_KEY="your_modelscope_api_key"
The first run of the default agent may install additional dependencies for local code execution. Stay connected to the internet and wait for the input prompt or task result.
⌨️ TUI
Start the terminal interface and enter a task. Use /help to see commands for session management and more, and /quit to exit:
ms-agent
🛠️ CLI
Run a task directly. Omit --query to enter interactive mode:
ms-agent run --query "Introduce the applications of MS-Agent"
🐍 Python SDK
Save the following as quickstart.py, then run python quickstart.py in the same terminal where you configured the API key:
import asyncio
from ms_agent import LLMAgent
async def main():
agent = LLMAgent()
await agent.run("Introduce the applications of MS-Agent")
asyncio.run(main())
Optional dependencies
Install extensions in the same Python environment as needed:
| Capability | Command |
|---|---|
| Vector / hybrid skill search | python -m pip install -U "ms-agent[retrieval]" |
| Deep research / document parsing | python -m pip install -U "ms-agent[research]" |
| Video generation | python -m pip install -U "ms-agent[cinema]" |
| All runtime extensions, including WebUI (Python 3.12+) | python -m pip install -U "ms-agent[all]" |
See the Quick start for the full list.
When you open a new terminal, activate the Python environment again. WebUI users can then run ms-agent ui. Terminal and SDK users also need to set their API key again, or save it in a local .env file (do not commit that file). See the configuration reference.
⚙️ Configuration and Extensions
After your first conversation, you can choose another model, connect MCP tools, or load skills. In the WebUI, manage these in Settings; see the model settings and skills and MCP guides. For terminal and SDK usage, see the tools and skills pages. Try tool calls online in the MCP Playground.
For scheduled jobs with ms-agent cron, Agent Hub with ms-agent agent, and more commands, see the CLI reference.
🎯 Applications
These applications use the framework to handle specialized tasks from start to finish. Use them directly or adapt their agent orchestration, tools, and workflows for your own systems. Each linked guide lists the required models and dependencies and explains how to run the project.
🔎 Agentic Insight · From Research Questions to Evidence-based Reports
A Researcher agent coordinates Searcher and Reporter agents to investigate open-ended questions through iterative search, evidence collection, and writing. Version 2 stores structured intermediate artifacts in the filesystem and explicitly ties report claims to evidence, making it easier to trace sources, review the research process, and resume work.
As of April 9, 2026, Agentic Insight v2 scored 55.31 on DeepResearch Bench with Qwen3.5-Plus + GPT 5.2 and ranked second among open-source entries and fifth overall.
v2 guide · Report demo · Benchmark results · v1 base and extended workflows
💻 CodeGenesis · From Natural-language Requirements to Software Projects
Coordinate requirements analysis, architecture design, file planning, coding, and refinement through a multi-agent development workflow. Generate files in dependency order and iterate using LSP diagnostics and runtime feedback. A seven-stage standard workflow supports detailed project design; a four-stage alternative supports rapid prototyping.
Design and usage guide · Source code · Workflow diagram
📊 FinResearch · Financial Data Meets Market Research
Five specialist agents handle task decomposition, data collection, quantitative analysis, market sentiment analysis, and report writing. Combine structured financial data from AkShare / BaoStock with public information from the web to produce illustrated reports that bring together data analysis, visualizations, and qualitative findings.
Usage guide · Online demo · Example reports · Video demo
📑 DocResearch · Turn Source Documents into Illustrated Reports
Read papers and research material from multiple documents or URLs, extract key information, and generate reports with figures. Supported inputs include PDF, TXT, PPT, and DOCX; export reports as PDF, PPTX, DOCX, or HTML for reading, presentations, and sharing.
🎬 Singularity Cinema · Turn Knowledge into Short Videos
Start with a topic or plain-text material and coordinate scripting, storyboarding, narration, visual generation, and video composition. Create explainers about science, technology, and economics, combining images, captions, and generated video clips in a customizable creative workflow.
Usage guide and more videos · Click the preview to watch “How to Deploy a Large Language Model”:
🧬 Skill Evolution · Improve Skills with Task Feedback
For tasks that can be evaluated automatically, run the current skills, collect traces and scores, then use reflection and skill-management agents to create or revise skills. The workflow compares candidates on a validation set, then separately tests the initial version, the final version, and the version with the highest validation score. A SearchQA baseline provides a starting point for studying how task experience can improve a skill library.
📚 Documentation
Jump directly to the guide you need (or browse the Full Documentation):
| Goal | Start here |
|---|---|
| Try an agent online or complete a first local task | Agent Playground · Quick start · Python SDK |
| Work on projects in a browser or terminal and steer long tasks | WebUI workspace · TUI · Projects and sessions |
| Manage long-horizon context, unified memory, and workspace instructions | Context management · Memory · Personalization · Scheduled tasks |
| Install, review updates, or evolve Agent Skills | Skill management · Skill mechanisms · Skill Evolution |
| Customize execution control, permissions, and multi-agent collaboration | Permissions · Hooks · Callbacks · Sub-agents · Workflows |
| Reuse community plugins, sync across frameworks, or connect open protocols | Plugins · Agent Hub · MCP · ACP · A2A |
| Deploy remotely, migrate encrypted credentials, or troubleshoot issues | Deployment · Credentials · Troubleshooting |
Architecture · Configuration reference · CLI reference · Contributor guide
📄 License
This project is licensed under the Apache License 2.0.
⭐ Star History
Metadata
Release files for ms-agent 1.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ms_agent-1.7.0.tar.gz | 44.3 MB | Without provenance | Details for ms_agent-1.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ms_agent-1.7.0-py3-none-any.whl | Python 3 | none | any | Details for ms_agent-1.7.0-py3-none-any.whl |
Total release size: 89.2 MB
Release files / ms_agent-1.7.0.tar.gz
| Download URL | ms_agent-1.7.0.tar.gz |
|---|---|
| Size | 44.3 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8ea82aadf8d0788bb758b6e1c901d94c717037296c3577672126d1d240723196
|
|
BLAKE2b-256 checksum How to use checksums |
a922d3a2444064b46e88e8235b675818bc4a3ab39bb328551a6c481b1826679b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.16
|
Release files / ms_agent-1.7.0-py3-none-any.whl
| Download URL | ms_agent-1.7.0-py3-none-any.whl |
|---|---|
| Size | 44.9 MB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf25f7ef4f7b372df463c38cb0746bf992abe0587da6b50e32b82d7255cfbc4b
|
|
BLAKE2b-256 checksum How to use checksums |
71abb259fc802cbe710d64ac68377fe57d58ea77149766d8d26033c0e44b7e96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.16
|
Security for ms-agent 1.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.