PhysMaster decomposes a physics problem into subtasks, explores multiple solution strategies in parallel through an MCTS search tree, evaluates and refines them with a Critic, and distills reusable knowledge β from a single node all the way up to a cross-task wisdom store.
- MCTS-Driven Search: Explores multiple solution paths in parallel, balancing exploitation and exploration via UCB1
- Multi-Agent Pipeline: 5 specialized agents (Clarifier β Supervisor β Theoretician β Critic β Summarizer) collaborate in a structured loop
- Hierarchical Memory: Per-node experience β compressed knowledge β cross-task wisdom, with cognitive reinforcement on high-reward paths
- LANDAU Knowledge Layer: RAG over 74 physics textbooks, real-time arXiv search, 12 domain skill packs, and workflow templates
- Minimal Config: Only
llm+pipeline.query_filerequired; everything else has sensible defaults
| Component | Role |
|---|---|
| π Clarifier | Parse problem into structured subtasks |
| π― Supervisor | Read tree context, pick next subtask, decide draft vs. revise |
| β‘ Theoretician | Solve subtask with Python, skills, arXiv, prior knowledge |
| π§ͺ Critic | Score solution (0β1): complete Β· to_revise Β· to_redraft |
| π Summarizer | Extract best trajectory, write markdown report |
| π¦ LANDAU | External knowledge layer β provides prior RAG, arXiv search, domain skills, and workflow templates |
The loop stops when all subtasks are completed along some path, or the round budget runs out.
Prerequisites: Python 3.10+, an OpenAI-compatible LLM API key
# 1. Install
git clone https://github.com/AdrianMiao27/PHY_Master.git
cd PHY_Master
pip install -r requirements.txt
# 2. Configure β edit config.yaml
# llm.base_url / api_key / model + pipeline.query_file
# 3. Run
python run.py # default config.yaml
python run.py -c custom.yaml # custom configOutput lands in outputs/<task_name>/ β includes summary.md, visualization.html (interactive MCTS tree), and per-node working directories.
π‘ Minimal mode β run without external knowledge: set
skills.enabled: falseand alllandau.*_enabled: false.
β Full config reference
# ββ LLM ββββββββββββββββββββββββββββββββββββββββββββββ
llm:
base_url: "https://api.openai.com/v1"
api_key: "sk-..."
model: "gpt-4o"
# ββ Pipeline βββββββββββββββββββββββββββββββββββββββββ
pipeline:
query_file: "instructions/test.txt"
output_path: "outputs"
max_rounds: 10 # MCTS round budget
parallel_processes: 2 # concurrent Theoretician workers
debug_logging: false # detailed per-node logs in outputs/<task>/log/
# ββ MCTS βββββββββββββββββββββββββββββββββββββββββββββ
mcts:
draft_expansion: 2 # children per draft expansion
revise_expansion: 1 # children per revise expansion
exploration_constant: 1.414 # UCB1 exploration weight (sqrt 2)
active_beam_width: 0 # 0 = no pruning; N = keep top-N per depth
# ββ Clarifier ββββββββββββββββββββββββββββββββββββββββ
clarifier:
max_key_concpets: 5
# ββ Skills βββββββββββββββββββββββββββββββββββββββββββ
skills:
enabled: true
roots:
- "LANDAU/skills"
# ββ LANDAU knowledge modules βββββββββββββββββββββββββ
landau:
library_enabled: true # arXiv paper search
library: "LANDAU/library"
workflow_enabled: true # problem-solving templates
workflow: "LANDAU/workflow"
prior_enabled: true # FAISS RAG knowledge base
prior: "LANDAU/prior"
wisdom_save_enabled: false # persist distilled wisdom after each task
# ββ Visualization ββββββββββββββββββββββββββββββββββββ
visualization:
enabled: trueKey parameters:
| Key | Description | Default |
|---|---|---|
pipeline.max_rounds |
Total MCTS iterations before forced stop | 10 |
pipeline.parallel_processes |
Theoretician subprocesses | 2 |
pipeline.debug_logging |
Write detailed per-node JSON logs | false |
mcts.draft_expansion |
Child nodes per draft round | 2 |
mcts.revise_expansion |
Child nodes per revise round | 2 |
mcts.exploration_constant |
UCB1 exploration term | 1.414 |
mcts.active_beam_width |
Beam pruning width (0 = off) | 0 |
PhysMaster does not solve linearly. It maintains a tree of solution attempts and navigates it like a game:
| Step | What happens |
|---|---|
| Select | UCB1 picks the most promising leaf, balancing reward vs. exploration |
| Expand | N Theoretician workers spawn in parallel and produce child nodes |
| Evaluate | Critic scores each child on a 0β1 scale |
| Backpropagate | Reward flows upward; high-reward nodes (>0.8) reinforce ancestors with verified knowledge |
| Prune | If beam width is set, low-reward nodes beyond the budget are closed |
The search terminates when a complete path is found or max_rounds is hit. The best root-to-leaf path is extracted for the summary.
The search tree carries knowledge forward at three scopes:
| Scope | Description |
|---|---|
| π¬ Per-Node Experience | Full Theoretician output β reasoning, tool calls, code. Available to the Critic for evaluation, then compressed. |
| π¦ Compressed Knowledge | Distilled summary attached to each node. Ancestors and siblings share insights through tree context. |
| π Cross-Task Wisdom | Best trajectory distilled post-task and written back to the FAISS index for future retrieval. |
High-reward nodes (>0.8) trigger cognitive reinforcement: verified knowledge is propagated to ancestors during backpropagation.
The LANDAU/ directory provides the external knowledge layer that powers the Theoretician's domain expertise.
| Module | Path | What it does |
|---|---|---|
| π Prior (RAG) | LANDAU/prior/ |
PDF/MD/Text β parent-child chunks β bge-small-en-v1.5 β FAISS index. Dense + BM25 hybrid retrieval with RRF. |
| π Library | LANDAU/library/ |
Real-time arXiv paper search & retrieval at solve time. |
| π§ Skills | LANDAU/skills/ |
12 domain knowledge packs β Theoretician loads on demand. |
| π Workflows | LANDAU/workflow/ |
YAML solving templates β Clarifier auto-matches by keyword overlap. |
Pre-built knowledge base: PhysLib on HuggingFace β 78k chunks from 74 physics textbooks.
Ingestion commands
python LANDAU/prior/prior_store.py # ingest all
python LANDAU/prior/prior_store.py --target path/to/file.pdf # single file
python LANDAU/prior/prior_store.py --reset # full rebuild12 built-in skills
| Skill | Coverage |
|---|---|
| Classical Electrodynamics | Maxwell's equations, radiation, waveguides |
| Quantum Mechanics | Schrodinger equation, scattering, angular momentum |
| Thermodynamics & Statistical Mechanics | Partition functions, phase transitions, ensembles |
| Conservation Laws | Noether's theorem, conserved currents |
| Perturbation Expansion | Regular/singular perturbation, asymptotic series |
| Variational Methods | Euler-Lagrange, Rayleigh-Ritz |
| Dimensional Analysis | Pi theorem, natural units, scaling laws |
| Symmetry Analysis | Group theory, Lie algebras, representations |
| Fourier & Spectral Analysis | Fourier/Laplace transforms, spectral methods |
| Numerical ODE/PDE | Runge-Kutta, finite difference/element |
| Statistical Error Analysis | Error propagation, fitting, Monte Carlo |
| LaMET Asymptotic Expansion | Large-momentum effective theory |
| Platform | How |
|---|---|
| π€ Feishu Bot | Send a physics problem in chat β pipeline runs in background β summary pushed back. See feishu/README.md. |
| π§© Claude Code | bash extensions/skills/physmaster/install_cc.sh β use /physmaster in any session. |
| π§© OpenClaw | bash extensions/skills/physmaster/install_openclaw.sh /path/to/skills β use_skill(name="physmaster", ...). |
See extensions/README.md for details.
PHY_Master/
βββ run.py Entry point
βββ config.yaml Configuration
βββ requirements.txt
βββ core/ Core pipeline
β βββ clarifier.py Query β structured contract
β βββ supervisor.py MCTS orchestrator
β βββ mcts.py MCTSNode / MCTSTree
β βββ theoretician.py Solver agent (subprocess)
β βββ summarizer.py Trajectory β markdown report
β βββ visualization.py Tree β interactive HTML
βββ LANDAU/ Knowledge modules
β βββ skills/ 12 built-in physics skills
β βββ workflow/ Problem-solving YAML templates
β βββ library/ arXiv paper search & retrieval
β βββ prior/ FAISS RAG knowledge base
βββ utils/ Utilities
βββ prompts/ 14 prompt templates (7 agents)
βββ instructions/ Query files
βββ extensions/ Skill plugins for CC / OpenClaw
βββ feishu/ Feishu bot integration
βββ outputs/ Generated at runtime
If you use PhysMaster in your research, please cite:
@misc{miao2025physmaster,
title={PhysMaster: Building an Autonomous AI Physicist for Theoretical and Computational Physics Research},
author={Tingjia Miao and Jiawen Dai and Jingkun Liu and Jinxin Tan and Muhua Zhang and Wenkai Jin and Yuwen Du and Tian Jin and Xianghe Pang and Zexi Liu and Tu Guo and Zhengliang Zhang and Yunjie Huang and Shuo Chen and Rui Ye and Yuzhi Zhang and Linfeng Zhang and Kun Chen and Wei Wang and Weinan E and Siheng Chen},
year={2025},
eprint={2512.19799},
archivePrefix={arXiv},
primaryClass={cs.AI},
url={https://arxiv.org/abs/2512.19799},
}
