README_EN.md
May 1, 2026 ยท View on GitHub
๐ค MathModelAgent ๐
An agent designed for mathematical modeling
Automatically complete mathematical modeling and generate a ready-to-submit paper.
็ฎไฝไธญๆ | English
๐ Vision
Turn 3 days of competition into 1 hour
Automatically generate an award-level modeling paper
โจ Features
- ๐ Automatic problem analysis, mathematical modeling, code writing, error correction, and paper writing
- ๐ป Code Interpreter
- ๐ Generate a well-formatted paper
- ๐ค Multi-agents: modeling expert, coding expert, paper expert, etc.
- ๐ Multi-LLMs: Different models for each agent
- ๐ค Support for all models: litellm
- ๐ฐ Low cost: workflow agentless, no dependency on agent framework
- ๐งฉ Custom templates: prompt inject for setting requirements for each subtask separately
๐ Future Plans
- Add and complete webui, cli
- Comprehensive tutorials and documentation
- Provide web service
- English support (MCM/ICM)
- LaTeX template integration
- Vision model integration
- Proper citation implementation
- More test cases
- Docker deployment
- Human in loop: User interaction (model selection, @agent rewriting, etc.)
- Feedback: evaluate the result and modify
- Cloud integration for code interpreter (e.g., e2b providers)
- Multi-language: R, Matlab
- Drawing: napki, draw.io, plantuml, svg, mermaid.js
- Add benchmark
- Web search tool
- RAG knowledge base
- A2A hand off: Code expert reflects on errors multiple times, hands off to smarter model agent
Video Demo
Caution
The project is in experimental development stage, with many areas needing improvement and optimization. I (the project author) am busy but will update when time permits. Contributions are welcome.
For case references, check the demo folder. If you have good cases, please submit a PR to this directory
๐ Usage Guide
Three deployment options are available, choose the one that suits you best:
- Docker
- Local deployment
- Automated script deployment
If you want to run the CLI version, switch to the master branch. It's easier to deploy, but will not be updated in the future.
๐ณ Option 1: Docker Deployment (Recommended: Simplest)
- Configure Environment Variables
cp backend/.env.dev.example backend/.env.dev
cp frontend/.env.example frontend/.env.development
Fill in the configuration in:
- backend/.env.dev
- frontend/.env.development
- Start Services
docker-compose up -d
- Access
You can now access:
- Frontend interface: http://localhost:5173
- Backend API: http://localhost:8000
๐ป Option 2: Local Deployment
Make sure Python, Nodejs, and Redis are installed on your computer
- Configure Environment Variables
Copy /backend/.env.dev.example to /backend/.env.dev (remove the .example suffix)
Configure Environment Variables
It is recommended to use models with strong capabilities and large parameter counts.
Copy /frontend/.env.example to /frontend/.env.development (remove the .example suffix)
- Install Dependencies
Clone the project
git clone https://github.com/jihe520/MathModelAgent.git
Start backend
Start Redis
cd backend
pip install uv # Recommended: use uv to manage python projects
uv sync # Install dependencies
# Start backend
# Activate Python virtual environment
source .venv/bin/activate # MacOS or Linux
venv\Scripts\activate.bat # Windows
# Run this command for MacOS or Linux
ENV=DEV uvicorn app.main:app --host 0.0.0.0 --port 8000 --ws-ping-interval 60 --ws-ping-timeout 120 --reload
# Run this command for Windows
set ENV=DEV ; uvicorn app.main:app --host 0.0.0.0 --port 8000 --ws-ping-interval 60 --ws-ping-timeout 120
Start frontend
cd frontend
npm install -g pnpm
pnpm i # Make sure pnpm is installed
pnpm run dev
Results and outputs are generated in the backend/project/work_dir/xxx/* directory:
- notebook.ipynb: code generated during execution
- res.md: final results in markdown format
๐ Option 3: Automated Script Deployment (Community Contribution)
Need an automatic deployment script? mmaAutoSetupRun
Need to customize prompt templates? Prompt Inject: prompt
๐ค Contribution & Development
- The project is in experimental development stage (updated when I have time), with frequent changes and some bugs being fixed.
- Everyone is welcome to participate and make the project better.
- PRs and issues are very welcome.
- For requirements, refer to Future Plans.
After cloning the project, install the Todo Tree plugin to view all todo locations in the code.
.cursor/* contains overall architecture, rules, and mcp for easier development.
๐ License
Free for personal use. For commercial use, please contact me (the author).
๐ Reference
Thanks to the following projects:
Others
๐ Sponsor
Thanks to sponsors: danmo-tyc
๐ฅ GROUP
For questions, join the group