modelscope/ms-agent
MS-Agent: a lightweight framework to empower agentic execution of complex tasks
MS‑Agent – A lightweight, extensible framework for autonomous AI agents
What it is – MS‑Agent is an open‑source Python‑based framework that lets you build, run, and manage long‑running, multi‑step AI agents. It provides a harness that coordinates model calls, tool execution, permission checks, and feedback loops, while handling context‑compression, memory layers, and scheduling. The same agent logic can be used from a web UI, a terminal UI, a CLI, or embedded in other Python applications via a shared SDK.
Key capabilities
- Customizable harness – plug in lifecycle callbacks, hooks, and policy checks to shape how an agent plans, validates, and executes steps.
- Context & memory management – separate session, active‑context, and project‑wide memory stores; automatic pruning and LLM‑based summarisation keep token usage in check.
- Autonomous collaboration – a lead agent can spawn specialist sub‑agents or run DAG‑style workflows, assigning different models, tools, and skills to each role.
- Reusable skills – domain‑specific procedures are packaged as skills that can be loaded on demand. An evaluation‑driven “Skill Evolution” workflow revises skills based on execution traces.
- Open ecosystem – supports many model providers, ModelScope’s MCP tool protocol, ACP/A2A integration, and an Agent Hub that syncs agents, skills, and memory across local or remote ModelScope repositories.
- Multimodal input – images, video and other modalities can be fed to agents (v1.6.0).
- Built‑in applications – ready‑made pipelines for research (DeepResearch/Agentic Insight), code generation (Code Genesis), video creation (Singularity Cinema), financial analysis (FinResearch), document research, etc.
How to get started
- Install the Python SDK (requires Python 3.12+). The package is on PyPI as
ms-agent. - Choose an interface:
- WebUI – run
ms-agent uiafter cloning the repo; a browser workspace lets you create projects, chat with agents, view tool activity, and edit files. - TUI / CLI – use
ms-agent chatorms-agent run …for terminal‑based interaction or scripted tasks. - SDK – import
ms_agentin your own code to assemble custom agents, define skills, and invoke the harness programmatically.
- WebUI – run
- Add your ModelScope (or other) API key in the WebUI Settings → Models panel.
Typical use cases
- Deep research – autonomous literature search, summarisation, and report generation (Agentic Insight v2).
- Software development – multi‑step code generation, debugging, and documentation with the Code Genesis skill set.
- Content creation – video generation pipelines via Singularity Cinema.
- Financial analysis – data collection from Akshare/Baostock and multi‑agent research workflows.
- General RAG / knowledge‑search – integrated Sirchmunk retrieval over local codebases and docs.
Documentation & community
- Official site: https://modelscope.github.io/ms-agent/
- Docs (English & Chinese): https://ms-agent-en.readthedocs.io
- Discord & WeChat groups for support.
- The project follows an Apache‑2.0‑style license (see
LICENSE).
Why it matters – By abstracting the plumbing of tool calling, memory handling, and workflow orchestration, MS‑Agent lets developers focus on the logic of their agents. Its modular design, multimodal support, and built‑in applications make it a practical foundation for research assistants, coding copilots, and other autonomous AI systems.
Related
- Project
- Project
- Project
- Project
- Project