Skip to content

Commit 012a006

Browse files
author
alcholiclg
committed
Merge branch 'main' of https://github.com/modelscope/ms-agent into release/1.6
2 parents fbe9621 + 2299b20 commit 012a006

File tree

82 files changed

+7851
-1165
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+7851
-1165
lines changed

.github/SECURITY.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
If you believe you have found a security vulnerability in **MS-Agent**, please report it responsibly.
6+
7+
- **Preferred**: Use GitHub **Private Vulnerability Reporting** (Security → Advisories → Report a vulnerability), if enabled.
8+
- **Do not** open a public GitHub Issue for security reports.
9+
10+
Please include:
11+
- A clear description of the issue and impact
12+
- A minimal proof-of-concept (PoC), if possible
13+
- Affected versions/commits
14+
- Reproduction steps and environment details
15+
- Any suggested mitigations/fix ideas (optional)
16+
17+
We will acknowledge receipt as soon as possible and work with you on coordinated disclosure.
18+
19+
## Scope
20+
21+
In scope includes (but is not limited to):
22+
- Tool execution security
23+
- Prompt/document injection leading to unsafe tool usage
24+
- Arbitrary file read/write, path traversal
25+
- SSRF and internal network access through tools
26+
- Unsafe deserialization (pickle/yaml/etc.)
27+
28+
Out of scope:
29+
- Issues in third-party dependencies with no exploitable path through MS-Agent
30+
- Misconfigurations or insecure deployments not recommended by the project
31+
- Social engineering attacks that do not involve a technical vulnerability in MS-Agent
32+
33+
## Disclosure Process
34+
35+
- We will confirm receipt of your report.
36+
- We will investigate and validate the issue.
37+
- We will coordinate a fix and release.
38+
- We may publish a GitHub Security Advisory (and request a CVE when appropriate).
39+
- We will credit reporters where possible (unless you prefer to remain anonymous).

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ apps/agentfabric/config/local_user/*
153153
ast_index_file.py
154154

155155

156-
#neo4j
156+
# neo4j
157157
.neo4j.lock
158158
neo4j.lock
159159
/temp/

README.md

Lines changed: 7 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -307,41 +307,8 @@ For more details, please refer to [**MS-Agent Skills**](ms_agent/skill/README.md
307307
308308
---
309309
310-
### Agent Skills
311-
312-
The **MS-Agent Skill Module** is **Implementation** of [Anthropic-Agent-Skills](https://platform.claude.com/docs/en/agents-and-tools/agent-skills) Protocol.
313-
314-
#### 🔍 Intelligent Skill Retrieval
315-
- **Hybrid Search**: Combines FAISS dense retrieval with BM25 sparse retrieval
316-
- **LLM-based Filtering**: Uses LLM to filter and validate skill relevance
317-
- **Query Analysis**: Automatically determines if skills are needed for a query
318-
319-
#### 📊 DAG-based Execution
320-
- **Dependency Management**: Builds execution DAG based on skill dependencies
321-
- **Parallel Execution**: Runs independent skills concurrently
322-
- **Input/Output Linking**: Automatically passes outputs between dependent skills
323-
324-
#### 🧠 Progressive Skill Analysis
325-
- **Two-phase Analysis**: Plan first, then load resources
326-
- **Incremental Loading**: Only loads required scripts/references/resources
327-
- **Context Optimization**: Minimizes token usage while maximizing understanding
328-
- **Auto Bug Fixing**: Analyzes errors and attempts automatic fixes
329-
330-
#### 🔒 Secure Execution Environment
331-
- **Docker Sandbox**: Isolated execution using [ms-enclave](https://github.com/modelscope/ms-enclave) containers
332-
- **Local Execution**: Controlled local execution with RCE prevention
333-
- **Security Checks**: Pattern-based detection of dangerous code
334-
335-
#### 🔄 Self-Reflection & Retry
336-
- **Error Analysis**: LLM-based analysis of execution failures
337-
- **Auto-Fix**: Attempts to fix code based on error messages
338-
- **Configurable Retries**: Up to N retry attempts with fixes
339-
340-
341-
For more details, please refer to [**MS-Agent Skills**](ms_agent/skill/README.md).
342310
343-
344-
### Agentic Insight
311+
### Agentic Insight (Deep Research)
345312
346313
#### - Lightweight, Efficient, and Extensible Multi-modal Deep Research Framework
347314
@@ -558,6 +525,12 @@ MS-Agent provides a modern web interface for interacting with agents. Built with
558525
ms-agent ui
559526
```
560527
528+
**Windows tip:** If the console shows garbled text, use the PowerShell helper:
529+
530+
```powershell
531+
webui/scripts/start-webui.ps1
532+
```
533+
561534
The browser will automatically open at http://localhost:7860
562535
563536
**Command Options:**

README_ZH.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,7 @@ asyncio.run(main())
311311

312312
---
313313

314-
315-
### Agentic Insight
314+
### Agentic Insight (Deep Research)
316315

317316
#### - 轻量级、高效且可扩展的多模态深度研究框架
318317

@@ -568,6 +567,12 @@ MS-Agent提供了一个简洁轻量的Web界面,用于与智能体进行交互
568567
ms-agent ui
569568
```
570569

570+
**Windows 提示:** 若控制台出现乱码,建议使用 PowerShell 启动脚本:
571+
572+
```powershell
573+
webui/scripts/start-webui.ps1
574+
```
575+
571576
浏览器打开: http://localhost:7860
572577

573578
**命令参数**

docs/en/Components/Config.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,3 +166,20 @@ In addition to yaml configuration, MS-Agent also supports several additional com
166166
```
167167

168168
> 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`.
169+
170+
- 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.
171+
172+
### Quick Start for Knowledge Search
173+
174+
Use the `--knowledge_search_paths` parameter to quickly enable knowledge search based on local documents:
175+
176+
```bash
177+
# Using default agent.yaml configuration, automatically reuses LLM settings
178+
ms-agent run --query "How to implement user authentication?" --knowledge_search_paths "./src,./docs"
179+
180+
# Specify configuration file
181+
ms-agent run --config /path/to/agent.yaml --query "your question" --knowledge_search_paths "/path/to/docs"
182+
```
183+
184+
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.
185+
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.

docs/en/Projects/CodeGenesis.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
slug: CodeGenesis
3+
title: Code Genesis
4+
description: Ms-Agent Code Genesis Project for production-ready software project generation from natural language
5+
---
6+
7+
# Code Genesis
8+
9+
Code Genesis is an open-source multi-agent framework that generates production-ready software projects from natural language requirements. It orchestrates specialized AI agents to autonomously deliver end-to-end project generation with frontend, backend, and database integration.
10+
11+
## Overview
12+
13+
### Features
14+
15+
- **End-to-end project generation**: Automatically generates complete projects with frontend, backend, and database integration from natural language descriptions
16+
- **High-quality code**: LSP validation and dependency resolution ensure production-ready output
17+
- **Topology-aware generation**: Eliminates reference errors through dependency-driven code generation
18+
- **Automated deployment**: Deploys to EdgeOne Pages automatically with MCP integration
19+
- **Flexible workflows**: Choose between standard (7-stage) or simple (4-stage) pipelines based on project complexity
20+
21+
### Architecture
22+
23+
Code Genesis provides two configurable workflow modes:
24+
25+
#### Standard Workflow (Production-Grade)
26+
27+
![Standard Workflow](../../../projects/code_genesis/asset/workflow.jpg)
28+
29+
The standard pipeline implements a rigorous 7-stage process optimized for complex, production-ready projects:
30+
31+
```
32+
User Story → Architect → File Design → File Order → Install → Coding → Refine
33+
```
34+
35+
**Pipeline Stages**:
36+
1. **User Story Agent**: Parses user requirements into structured user stories
37+
2. **Architect Agent**: Selects technology stack and defines system architecture
38+
3. **File Design Agent**: Generates physical file structure from architectural blueprint
39+
4. **File Order Agent**: Constructs dependency DAG and topological sort for parallel code generation
40+
5. **Install Agent**: Bootstraps environment and resolves dependencies
41+
6. **Coding Agent**: Synthesizes code with LSP validation, following dependency order
42+
7. **Refine Agent**: Performs runtime validation, bug fixing, and automated deployment
43+
44+
Each agent produces structured intermediate outputs, ensuring engineering rigor throughout the pipeline.
45+
46+
#### Simple Workflow (Rapid Prototyping)
47+
48+
![Simple Workflow](../../../projects/code_genesis/asset/simple_workflow.jpg)
49+
50+
For lightweight projects or quick iterations, the simple workflow condenses the pipeline into 4 core stages:
51+
52+
```
53+
Orchestrator → Install → Coding → Refine
54+
```
55+
56+
**Streamlined Process**:
57+
1. **Orchestrator Agent**: Unified requirement analysis, architecture design, and file planning
58+
2. **Install Agent**: Dependency resolution and environment setup
59+
3. **Coding Agent**: Direct code generation with integrated file ordering
60+
4. **Refine Agent**: Validation and deployment
61+
62+
#### Workflow Comparison
63+
64+
| Aspect | Standard Workflow | Simple Workflow |
65+
|--------|-------------------|-----------------|
66+
| **Agent Stages** | 7 specialized agents | 4 consolidated agents |
67+
| **Architecture Quality** | Explicit, auditable design | Implicit, monolithic design |
68+
| **Generation Time** | Moderate (thorough planning) | Fast (direct execution) |
69+
| **Use Cases** | Production systems, complex apps | Prototypes, demos, simple tools |
70+
71+
## How to Use
72+
73+
### Installation
74+
75+
Clone the repository and prepare the environment:
76+
77+
```bash
78+
git clone https://github.com/modelscope/ms-agent
79+
cd ms-agent
80+
pip install -r requirements/code.txt
81+
pip install -e .
82+
```
83+
84+
Prepare npm environment, following https://nodejs.org/en/download. If you are using Mac, using Homebrew is recommended: https://formulae.brew.sh/formula/node
85+
86+
Make sure your installation is successful:
87+
```bash
88+
npm --version
89+
```
90+
91+
Make sure the npm installation is successful, or the npm install/build/dev will fail.
92+
93+
### Quick Start
94+
95+
Run the standard workflow:
96+
97+
```bash
98+
PYTHONPATH=. openai_api_key=your-api-key openai_base_url=your-api-url \
99+
python ms_agent/cli/cli.py run \
100+
--config projects/code_genesis \
101+
--query 'make a demo website' \
102+
--trust_remote_code true
103+
```
104+
105+
The code will be output to the `output` folder in the current directory by default.
106+
107+
### Advanced Configuration
108+
109+
#### Enable Diff-Based File Editing
110+
111+
Add `edit_file_config` to both `coding.yaml` and `refine.yaml`:
112+
113+
```yaml
114+
edit_file_config:
115+
model: morph-v3-fast # or other compatible models
116+
api_key: your-api-key
117+
base_url: https://api.morphllm.com/v1
118+
```
119+
120+
Get your model and API key from https://www.morphllm.com
121+
122+
#### Enable Automated Deployment
123+
124+
Add `edgeone-pages-mcp` configuration to `refine.yaml`:
125+
126+
```yaml
127+
mcp_servers:
128+
edgeone-pages:
129+
env:
130+
EDGEONE_PAGES_API_TOKEN: your-edgeone-token
131+
```
132+
133+
Get your `EDGEONE_PAGES_API_TOKEN` from https://pages.edgeone.ai/zh/document/pages-mcp

0 commit comments

Comments
 (0)