Sanjin a1a6b010c3 modify
modify
2025-05-26 22:41:57 +08:00
2025-05-05 23:47:52 +08:00
2025-05-26 22:41:57 +08:00
2025-05-19 20:31:56 +08:00
2025-05-26 22:41:57 +08:00
2025-05-12 13:30:41 +08:00
2025-05-12 13:30:41 +08:00
2025-05-12 13:30:41 +08:00
2025-05-05 23:47:52 +08:00
fix
2025-05-25 16:37:27 +08:00

🤖 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
  • 💻 Local code interpreter
  • 📝 Generate a well-formatted paper
  • 🤝 Multi-agents: modeling expert, coding expert (reflection module, local code interpreter), paper expert
  • 🔄 Multi-LLMs: Different models for each agent
  • 💰 Low cost agentless (about 1 RMB per task)

🚀 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
  • User interaction (model selection, rewriting, etc.)
  • Cloud integration for code interpreter (e.g., e2b providers)
  • Multi-language: R, Matlab
  • Drawing: napki, draw.io

Video Demo

📖 Usage Guide

Notice: Please make sure Python, Nodejs, and Redis are installed on your computer.

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.

  1. Configure Model

Copy /backend/.env.dev.example to /backend/.env.dev (remove the .example suffix), and fill in the model configuration and APIKEY
Deepseek Developer Platform

ENV=dev
# Compatible with OpenAI format, refer to official docs
DEEPSEEK_API_KEY=
DEEPSEEK_MODEL=
DEEPSEEK_BASE_URL=
# Max Q&A turns
MAX_CHAT_TURNS=60
# Reflection retries
MAX_RETRIES=5
# https://e2b.dev/
E2B_API_KEY=

LOG_LEVEL=DEBUG
DEBUG=true
# Make sure Redis is installed
REDIS_URL=redis://localhost:6379/0
REDIS_MAX_CONNECTIONS=20
CORS_ALLOW_ORIGINS=http://localhost:5173,http://localhost:3000

It is recommended to use models with strong capabilities and large parameter counts.

  1. Install Dependencies

Clone the project

git clone https://github.com/jihe520/MathModelAgent.git

Start backend

cd backend
pip install uv # Recommended: use uv to manage python projects
uv sync # Install dependencies
# Start backend
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
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, can be converted to Word (try pandoc)

🤝 Contribution & Development

DeepWiki

  • 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

Thanks to sponsors
danmo-tyc

For questions, join the group
QQ Group: 699970403

S
Description
2analysis-modeling: 数学建模赛题分析与建模设计合并阶段。用于读取题面和附件,完成子问题拆解、数据理解、假设预检、变量定义、模型公式、目标函数、约束条件、求解策略和可交给代码实现的建模报告。; 1start-mathmodel: 数学建模竞赛工作流入口。用于启动完整建模流程:询问用户偏好,生成 plan.md 和 todo.md,并按阶段调用赛题分析、建模、代码与图表、流程图、论文撰写、验证验收等 skills。; 4drawio: 数学建模非数据型图示绘制阶段。根据 ANALYSIS_MODELING_REPORT.md、RESULTS_REPORT.md 和已有 figures/ 生成技术路线图、子问题求解流程图、模型结构图、数据处理流程图等 DrawIO 图,并导出论文可引用 PDF。; 5writing: 数学建模竞赛论文撰写阶段,支持 Typst 和 LaTeX 双引擎。根据 ANALYSIS_MODELING_REPORT.md、RESULTS_REPORT.md 和 figures/*.pdf 选择比赛模板、排版引擎、组织章节,并在论文正文中按章节直接…
Readme 103 MiB
Languages
Python 37.2%
Vue 21.2%
TeX 19.8%
Typst 13.2%
TypeScript 5.5%
Other 3%