An open-source multi-agent framework that generates production-ready software projects from natural language requirements. It can do:
- End-to-end project generation with frontend, backend, and database integration
- High-quality code with LSP validation and dependency resolution
- Topology-aware code generation that eliminates reference errors
- Automated deployment to EdgeOne Pages
- Flexible workflows: standard (7-stage) or simple (4-stage) pipelines
This project needs to be used together with ms-agent.
- Clone this repo:
git clone https://github.com/modelscope/ms-agent
cd ms-agent- Build the Docker sandbox image (requires Docker):
bash projects/code_genesis/tools/build_sandbox_image.shThis builds a code-genesis-sandbox:version1 image containing Python 3.12, Node.js 20, npm, git and curl. All shell commands from the agents run inside this container for security isolation.
Note: To speed up dependency downloads during image builds and at container runtime, we use some mirror registries instead of the official sources by default. If your network environment does not require mirrors, you can comment out the relevant lines.
- Run:
PYTHONPATH=. openai_api_key=your-api-key openai_base_url=your-api-url python ms_agent/cli/cli.py run --config projects/code_genesis --query 'make a demo website' --trust_remote_code trueThe code will be output to the output folder in the current directory by default.
To enable diff-based editing and automated deployment, configure the following in your YAML files:
Add edit_file_config to both coding.yaml and refine.yaml:
edit_file_config:
model: morph-v3-fast # or other compatible models
api_key: your-api-key
base_url: https://api.morphllm.com/v1Get your model and API key from https://www.morphllm.com
Add edgeone-pages-mcp configuration to refine.yaml:
mcp_servers:
edgeone-pages:
env:
EDGEONE_PAGES_API_TOKEN: your-edgeone-tokenGet your EDGEONE_PAGES_API_TOKEN from https://pages.edgeone.ai/zh/document/pages-mcp
The workflow is defined in workflow.yaml and follows a 7-stage pipeline:
Standard Workflow:
- User Story Agent - Parses user requirements into structured user stories
- Architect Agent - Selects technology stack and defines system architecture
- File Design Agent - Generates physical file structure from architectural blueprint
- File Order Agent - Constructs dependency DAG and topological sort for parallel code generation
- Install Agent - Bootstraps environment and resolves dependencies
- Coding Agent - Synthesizes code with LSP validation, following dependency order
- Refine Agent - Performs runtime validation, bug fixing, and automated deployment
Each agent produces structured intermediate outputs, ensuring engineering rigor throughout the pipeline.
Function of each module:
- workflow.yaml - Entry configuration file defining the 7-stage pipeline. You can customize the workflow sequence here
- user_story.yaml / architect.yaml / file_design.yaml / file_order.yaml / install.yaml / coding.yaml / refine.yaml - Configuration files for each agent in the workflow
- workflow/*.py - Python implementation for each agent's logic
After all writing and compiling is finished, an input will be shown to enable human feedback:
- Please run both frontend and backend with
npm run devto start the website - Check website problems and give error feedback from:
- The backend console
- The browser console
- Page errors
- After the website runs normally, you can adjust the website, add new features, or refactor something
- If you find the token cost is huge or there's an infinite loop, stop it at any time.
- Feel free to optimize the code and bring new ideas