Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
6baa994
fix: video gen exclude edit_file
Feb 6, 2026
9c8205c
Merge branch 'main' of https://github.com/modelscope/ms-agent
Feb 9, 2026
94b833f
Merge branch 'main' of https://github.com/modelscope/ms-agent
Mar 5, 2026
11bcf06
enhance deep research v2
Mar 11, 2026
dd3f185
Merge branch 'main' of https://github.com/modelscope/ms-agent
Mar 12, 2026
693d9e9
feat: support search local paths through sirchmunk
Mar 15, 2026
05cb676
refactor: optimize architecture, restrict researcher report edits, up…
Mar 15, 2026
2977ba0
Update ms_agent/agent/llm_agent.py
suluyana Mar 16, 2026
879dba4
Apply suggestion from @gemini-code-assist[bot]
suluyana Mar 16, 2026
1dd49b6
fix local code executor; refine workflow and prompt (03)
Mar 17, 2026
c27347f
fix timeout; support for running subagent in process; support for pos…
Mar 19, 2026
5920dc4
refine readme for deep research; add run_benchmark.sh; fix counting c…
Mar 20, 2026
14cb873
Merge branch 'main' of https://github.com/modelscope/ms-agent into fe…
Mar 20, 2026
5202823
full modify?
Mar 20, 2026
24eb500
fix lint
Mar 20, 2026
986b34f
enrich researcher's reflection strategy to enhance stability
Mar 23, 2026
e6ad3e9
Merge branch 'main' of https://github.com/modelscope/ms-agent
Mar 24, 2026
88aaae6
Merge remote-tracking branch 'origin' into feat/tools
Mar 24, 2026
fec8bfe
mv localsearch to tools
Mar 24, 2026
b437bdc
thinking support beta; search_file_content fix
Mar 25, 2026
86a3ba8
support API key pool construction; support for reasoning model
Mar 27, 2026
8a32ce5
fix lint
Mar 27, 2026
393f23c
support for vertex type anthropic llm; refine reasoning output
Mar 27, 2026
49919ab
Merge branch 'main' of https://github.com/modelscope/ms-agent
Mar 31, 2026
e00c296
feat: add snapshot/rollback system to agent runtime
Apr 2, 2026
f08a15e
support for response api; optimize log output formatting
Apr 2, 2026
6bfb262
feat: merge SplitTask into AgentTool, add TaskManager infrastructure
Apr 2, 2026
db45457
feat: add run_in_background support to AgentTool
Apr 2, 2026
47bf056
feat: add TaskControlTool for LLM-accessible task management
Apr 3, 2026
e3b62dc
fix: hold strong reference to background watcher asyncio.Task to prev…
Apr 3, 2026
6286732
fix: cancel watcher tasks on AgentTool cleanup; export TaskControlToo…
Apr 3, 2026
c326139
fix: correct malformed XML in TaskManager._format_notification
Apr 3, 2026
b103ffa
test: add smoke tests for TaskManager, AgentTool dynamic spec, TaskCo…
Apr 3, 2026
7a96f8e
feat: stream sub-agent execution trace to file in real time
Apr 9, 2026
5825111
Merge branch 'main' of https://github.com/modelscope/ms-agent into fe…
Apr 9, 2026
6a1ba9f
fix lint
Apr 9, 2026
c6b1e3b
Merge branch 'main' of https://github.com/modelscope/ms-agent
Apr 10, 2026
2f2dbb0
Merge branch 'main' of https://github.com/modelscope/ms-agent
Apr 13, 2026
193e4a1
Merge remote-tracking branch 'origin' into feat/git
Apr 13, 2026
b3feb1a
feat: workspace policy, shell artifacts, TaskManager, grep/glob tools
Apr 13, 2026
ebbc72a
chore(projects): align configs with filesystem and workspace search t…
Apr 13, 2026
94ba0c3
refactor(tools): merge grep/glob into FileSystemTool
Apr 13, 2026
9841444
Merge branch 'feat/dr_reasoning' of https://github.com/alcholiclg/ms-…
Apr 13, 2026
ec5fb1a
feat(search): add Tavily engine, extract fetcher, and dr_bench wiring
Apr 20, 2026
cb75af3
fix(jina): align reader with websearch (meta fetch + playwright fallb…
Apr 20, 2026
87ae4ef
Merge origin/feat/git into bench/tavily-0413 (snapshot utils; keep be…
Apr 21, 2026
18a5683
chore(tools): use origin/feat/git filesystem_tool on bench/tavily-0413
Apr 21, 2026
e59618d
Merge feat/git into bench/tavily-0413; resolve prompts/reporter_callb…
Apr 22, 2026
ecf350b
fix(dr v2): align tavily yaml file_system include with grep/glob/edit…
Apr 22, 2026
7b49a52
Merge feat/agent-tool-overhaul into bench/tavily-0413
Apr 23, 2026
a5d4267
fix(filesystem): drop read-cache staleness gate for writes
Apr 23, 2026
00c8e86
fix(deep-research): harden tools, snapshots, and reporter/searcher co…
Apr 27, 2026
e5890f6
Merge branch 'bench/tavily-0413' into feat/tools
Apr 27, 2026
67668e9
fix lint
Apr 28, 2026
2d96611
Revert "fix lint"
Apr 28, 2026
34d5e92
fix lint
Apr 28, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ wheels/
/package
/temp
**/tmp/
.env*
.claude-trace/
/apps/agentfabric/tmp/
MANIFEST

Expand Down Expand Up @@ -148,6 +150,7 @@ apps/agentfabric/config/local_user/*
*.pt
.run/
.run/*
.claude*

# ast template
ast_index_file.py
Expand Down
13 changes: 6 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@



default_language_version:
python: python3.11
repos:
- repo: https://github.com/pycqa/flake8.git
rev: 4.0.0
rev: 7.3.0
hooks:
- id: flake8
exclude: ^(thirdparty/|examples/|tests/|projects/agent_skills/|projects/fin_research/examples/|ms_agent/utils/prompts\.py)
- repo: https://github.com/PyCQA/isort.git
rev: 4.3.21
rev: 5.13.2
hooks:
- id: isort
exclude: ^(examples/|projects/fin_research/examples/|projects/agent_skills/|tests/)
- repo: https://github.com/pre-commit/mirrors-yapf.git
rev: v0.30.0
rev: v0.32.0
hooks:
- id: yapf
exclude: ^(thirdparty/|examples/|projects/fin_research/examples/|projects/agent_skills/|tests/)
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v3.1.0
rev: v5.0.0
hooks:
- id: trailing-whitespace
exclude: ^(thirdparty/|tests/|projects/fin_research/examples/|projects/agent_skills/)
Expand Down
16 changes: 12 additions & 4 deletions docs/en/Components/Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ tools:
url: https://mcp.api-inference.modelscope.net/xxx/sse
exclude:
- map_geo
# Local codebase / document search (sirchmunk), exposed as the `localsearch` tool
localsearch:
paths:
- ./src
- ./docs
work_path: ./.sirchmunk
mode: FAST
# Optional: llm_api_key, llm_base_url, llm_model_name (else inherited from `llm`)
```

For the complete list of supported tools and custom tools, please refer to [here](./Tools.md)
Expand Down Expand Up @@ -220,19 +228,19 @@ In addition to yaml configuration, MS-Agent also supports several additional com

> Any configuration in agent.yaml can be passed in with new values via command line, and also supports reading from environment variables with the same name (case insensitive), for example `--llm.modelscope_api_key xxx-xxx`.

- knowledge_search_paths: Knowledge search paths, comma-separated multiple paths. When provided, automatically enables SirchmunkSearch for knowledge retrieval, with LLM configuration automatically inherited from the `llm` module.
- knowledge_search_paths: Comma-separated local search paths. Merges into `tools.localsearch.paths` and registers the **`localsearch`** tool (sirchmunk) for on-demand use by the model—not automatic per-turn injection. LLM settings are inherited from the `llm` module unless you set `tools.localsearch.llm_*` fields.

### Quick Start for Knowledge Search

Use the `--knowledge_search_paths` parameter to quickly enable knowledge search based on local documents:
Use `--knowledge_search_paths` or define `tools.localsearch` in yaml so the model can call `localsearch` when needed:

```bash
# Using default agent.yaml configuration, automatically reuses LLM settings
ms-agent run --query "How to implement user authentication?" --knowledge_search_paths "./src,./docs"
ms-agent run --query "How to implement user authentication?" --knowledge_search_paths "/path/to/docs"

# Specify configuration file
ms-agent run --config /path/to/agent.yaml --query "your question" --knowledge_search_paths "/path/to/docs"
```

LLM-related parameters (api_key, base_url, model) are automatically inherited from the `llm` module in the configuration file, no need to configure them repeatedly.
If you need to use independent LLM configuration in the `knowledge_search` module, you can explicitly configure `knowledge_search.llm_api_key` and other parameters in the yaml.
For a dedicated sirchmunk LLM, set `tools.localsearch.llm_api_key`, `llm_base_url`, and `llm_model_name` in yaml. Legacy top-level `knowledge_search` with the same keys is still read for backward compatibility.
14 changes: 11 additions & 3 deletions docs/zh/Components/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,14 @@ tools:
url: https://mcp.api-inference.modelscope.net/xxx/sse
exclude:
- map_geo
# 本地代码库/文档搜索(sirchmunk),对应模型可调用的 `localsearch` 工具
localsearch:
paths:
- ./src
- ./docs
work_path: ./.sirchmunk
mode: FAST
# 可选:llm_api_key、llm_base_url、llm_model_name(不填则从 `llm` 继承)
```

支持的完整工具列表,以及自定义工具请参考 [这里](./tools)
Expand Down Expand Up @@ -218,13 +226,13 @@ handler: custom_handler
}
}
```
- knowledge_search_paths: 知识搜索路径,逗号分隔的多个路径。传入后会自动启用 SirchmunkSearch 进行知识检索,LLM 配置自动从 `llm` 模块复用
- knowledge_search_paths: 知识搜索路径,逗号分隔。会合并到 `tools.localsearch.paths` 并注册 **`localsearch`** 工具(sirchmunk),由模型按需调用,不再在每轮自动注入上下文;除非配置 `tools.localsearch.llm_*`,否则 LLM `llm` 模块复用

> agent.yaml 中的任意一个配置,都可以使用命令行传入新的值,也支持从同名(大小写不敏感)环境变量中读取,例如 `--llm.modelscope_api_key xxx-xxx`。

### 知识搜索快速使用

通过 `--knowledge_search_paths` 参数,可以快速启用基于本地文档的知识搜索
通过 `--knowledge_search_paths` 或在 yaml 中配置 `tools.localsearch`,启用本地知识搜索(模型按需调用 `localsearch`)

```bash
# 使用默认 agent.yaml 配置,自动复用 LLM 设置
Expand All @@ -235,4 +243,4 @@ ms-agent run --config /path/to/agent.yaml --query "你的问题" --knowledge_sea
```

LLM 相关参数(api_key, base_url, model)会自动从配置文件的 `llm` 模块继承,无需重复配置。
如果需要在 `knowledge_search` 模块中使用独立的 LLM 配置,可以在 yaml 中显式配置 `knowledge_search.llm_api_key` 等参数
若 sirchmunk 需独立 LLM,可在 yaml 的 `tools.localsearch` 下设置 `llm_api_key`、`llm_base_url`、`llm_model_name`。仍支持旧版顶层 `knowledge_search` 相同字段,以便迁移
86 changes: 0 additions & 86 deletions examples/knowledge_search/agent.yaml.example

This file was deleted.

3 changes: 1 addition & 2 deletions ms-agent-skills/scripts/check_ms_agent.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Copyright (c) ModelScope Contributors. All rights reserved.
import json
import subprocess
import sys

import json


def check_import() -> dict:
"""Check that ms_agent is importable."""
Expand Down
11 changes: 10 additions & 1 deletion ms_agent/agent/base.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (c) ModelScope Contributors. All rights reserved.
import os
from abc import ABC, abstractmethod
from omegaconf import DictConfig
from typing import Any, AsyncGenerator, List, Tuple, Union

from ms_agent.llm import Message
from ms_agent.utils import read_history, save_history
from ms_agent.utils.constants import DEFAULT_OUTPUT_DIR, DEFAULT_RETRY_COUNT
from omegaconf import DictConfig


class Agent(ABC):
Expand Down Expand Up @@ -74,6 +74,15 @@ def save_history(self, messages: Any, **kwargs):
return
save_history(self.output_dir, self.tag, self.config, messages)

def list_snapshots(self) -> list:
"""Return snapshots for this agent's output_dir, most recent first."""
from ms_agent.utils.snapshot import list_snapshots
return list_snapshots(self.output_dir)

def rollback(self, commit_hash: str) -> bool:
"""Restore output_dir to a previous snapshot and truncate history."""
raise NotImplementedError()

def next_flow(self, idx: int) -> int:
"""Used in workflow, decide which agent goes next."""
return idx + 1
3 changes: 1 addition & 2 deletions ms_agent/agent/code_agent.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Copyright (c) ModelScope Contributors. All rights reserved.
from omegaconf import DictConfig
from typing import Any, List, Union

from ms_agent.llm import Message
from omegaconf import DictConfig

from .base import Agent


Expand Down
Loading
Loading