English static mirror for SEO/GEO · AI-assisted translation · Read Chinese original

MathModelAgent: Fully Automating a 3-Day Math Modeling Contest in 1 Hour

Forum topic · ✨步子哥 · 2026-09-12

Summary

MathModelAgent is an open-source agent project designed for mathematical modeling competitions (such as MCM/ICM and China's national contest), where teams traditionally spend 3 days and 3 nights producing a paper. The project automates the entire workflow—problem analysis, model selection, coding, debugging, paper writing, and typesetting—producing a submission-ready PDF in about an hour. Its key architectural choice is building only a SKILLS layer on top of existing harnesses (Claude Code / Codex / Cursor) rather than a custom agent framework, betting that domain knowledge belongs in Markdown skill files while planning and tool-calling are handled by the harness. Internally it uses heterogeneous multi-agent collaboration (modeling, coding, and writing roles powered by different LLMs), a 9-step automated acceptance pipeline including numeric consistency checks and Typst compilation, 17 built-in Typst templates for major contests, a human-in-the-loop mechanism with six decision actions, and a four-layer fault-tolerance strategy. A desktop version ships preconfigured for macOS and Windows.

Math modeling contests follow a standard rhythm: 3 days and 3 nights, three people—one modeling, one coding, one writing—and an all-night typesetting sprint before submitting a PDF.

MathModelAgent's author compressed this into 1 hour. Not 1 hour of assistance, but 1 hour of fully automated execution—problem analysis, modeling, coding, debugging, paper writing, and typesetting, outputting a directly submittable PDF.

The project gained 264 stars in a single day. Its ambition is stated in the first line of the README: an Agent designed for mathematical modeling that automatically completes the modeling process and generates a complete, directly submittable paper.

SKILLS-Driven: No Harness Layer

MathModelAgent's most counterintuitive design decision: the project only builds the SKILLS layer, not the Harness layer.

What does this mean? Most agent projects write their own agent framework—task planning, tool calling, memory management, error recovery, all in-house. MathModelAgent abandons that path, using Claude Code / Codex / Cursor directly as the Harness (runtime environment) and writing only skill files.

Each skill is a Markdown file describing a specific stage (problem analysis, modeling, coding, paper writing, acceptance). The harness (Claude Code, etc.) reads the skill files and executes according to the descriptions.

The author states it plainly in the README:

> Two years ago, I implemented my own agent framework. Now and going forward, more agent products should be built directly on harnesses like Codex / Claude Code / Pi + SKILLS.

This is a paradigm judgment: the agent framework layer is being absorbed by the harness layer. You don't need your own task planner—Claude Code is already a good task planner; you don't need your own tool calling—the MCP protocol has standardized it; what you need is domain knowledge, and the best carrier for domain knowledge is skill files.

Multi-Agent Division of Labor: Modeler, Coder, Writer

MathModelAgent is not a single agent internally, but a collaboration of three roles:

  • Modeler: analyzes the problem, selects models (AHP, TOPSIS, ARIMA, GA, etc.), outputs mathematical formulas and modeling rationale
  • Coder: writes code based on the modeling rationale, runs it, generates charts
  • Writer: integrates the modeling rationale, code results, and charts into a paper, typeset per template
  • Each agent can use a different model—the modeler uses a strong reasoning model (e.g., Claude Opus), the coder a strong coding model (e.g., GPT-4), the writer a strong writing model. This is heterogeneous model specialization rather than "one model does everything."

    9-Step Acceptance: No Embarrassing Errors in the Paper

    "Embarrassing errors" in math modeling papers are fatal—wrong formulas, mismatched data, missing charts, messy formatting. MathModelAgent's acceptance pipeline has 9 steps:

    1. Text leakage detection (no prompts or internal reasoning in the paper) 2. Numerical consistency verification (numbers in the paper must match code output) 3. Typst compilation (the paper must compile to PDF) 4. PDF visual inspection (the compiled PDF must look normal) 5-9. Other formatting and content checks

    These 9 steps are an automated QA pipeline, not human review. The agent doesn't just write the paper—it reviews its own paper.

    17 Typst Templates: Covering Major Contests

    Paper format requirements are very specific—China's national contest, Huashu Cup, Huawei Cup, MCM/ICM each have their own templates. MathModelAgent ships with 17 Typst templates and automatically matches the contest type.

    Choosing Typst over LaTeX is an interesting judgment. Typst is a modern typesetting system written in Rust, orders of magnitude faster than LaTeX, with simpler syntax. For agents, generating Typst source is easier than generating LaTeX—simpler syntax, fewer errors, faster compile feedback.

    HIL: Pausing at Critical Nodes

    Fully automated doesn't mean fully unattended. MathModelAgent's HIL (Human-in-the-Loop) mechanism pauses at critical nodes for user approval, with 6 decision actions:

  • confirm: approve and continue
  • edit: modify, then continue
  • regenerate: regenerate
  • ask: ask the agent a question
  • skip: skip this step
  • abort: terminate the entire run
This is "human on the loop" rather than "human in the loop"—people don't watch every step, only intervene at critical nodes.

Four Layers of Fault Tolerance: When Agents Fail

Agents can't succeed 100% of the time. MathModelAgent has four layers of fault tolerance:

1. Bounded retries: retry a few times on failure 2. Fallback hand-off: if retries fail, switch to a backup model 3. Evaluator shadow mode: an evaluator scores in parallel to catch quality issues 4. Feedback rerun: inject feedback and rerun

This is an engineering approach to fault tolerance—not hoping the agent gets it right the first time, but assuming the agent will err and designing mechanisms so it can recover.

Desktop Version: Out of the Box

MathModelAgent has a desktop version (macOS / Windows) with Claude Code and the full SKILLS suite bundled. Users don't need to install Python, Node.js, or Redis—download the dmg/exe, install, add an API key, and go.

This is a key step in agent productization—shifting the pain of environment setup from users to developers. The developer packages the entire runtime; the user just uses it.

Takeaways

MathModelAgent isn't the most complex agent project, but it represents a trend:

1. SKILLS layer independent of the Harness layer—agent frameworks absorbed by harnesses like Claude Code, domain knowledge carried in skill files 2. Heterogeneous multi-agent specialization—different roles use different models, not one model for everything 3. Automated acceptance pipelines—agents not only produce, but self-review 4. Six HIL decision actions—not just "confirm/cancel" but fine-grained human-machine collaboration 5. Typst replacing LaTeX—an agent-friendly typesetting system: fast, simple, low-error

The project's deeper judgment: the future of agents isn't bigger models, but better skill design. Model capability is already strong; the bottleneck is how to feed domain knowledge to models in structured form. MathModelAgent does this with skill files, and the result is a 3-day contest completed in 1 hour.

Not every task can be compressed this way, but tasks with standardized workflows, clear output formats, and verifiable quality standards all fit this pattern. Math modeling is just the first vertical domain to be skill-ified.

---

GitHub: https://github.com/jihe520/MathModelAgent

Tags

#mathmodelagent#ai-agents#claude-code#mathematical-modeling#typst#multi-agent#human-in-the-loop#open-source

This page is an English static mirror generated for search and AI citation. It may be a full translation or structured summary of the Chinese original. Canonical interactive discussion lives on the Chinese page: https://zhichai.net/topic/178634773