How amrex-codes/amrex-agent works
AMReXAgent turns natural-language requests into configured AMReX-family simulation runs, with optional result analysis and visualization. Its documented workflow includes solver/case discovery, planning and review, input generation, execution, and result handling; it also offers multiple retrieval strategies and MCP access. The README establishes the product capabilities, while the available source excerpts do not show most node-to-node calls, so those internal workflow links are marked dashed and unverified rather than asserted as observed calls.
Main entry points: main.py CLI workflow · architect_node.py Plan and baseline · runner_node.py Build and run · embedding.py Embedding retrieval
Components 21
Workflow orchestration
- CLI workflow
src/main.py - Agent configuration
src/config.py - Clarification
src/nodes/clarification_handler_node.py
Solver discovery
- Solver configurations
database/configs/pelec_config.py - Embedding retrieval
src/services/embedding.py - Solver search
database/indexing/level0_searcher.py - Case search
database/indexing/level2_searcher.py
Planning and validation
- Plan and baseline
src/nodes/architect_node.py - Plan review
src/nodes/reviewer_node.py - Plan validation
src/services/validation.py
Simulation execution
- Input generation
src/nodes/input_writer_node.py - Build and run
src/nodes/runner_node.py - Local execution
src/services/run_local.py - Superfacility execution
src/services/run_superfacility_tools.py
Results and interfaces
- Run analysis
src/nodes/analysis_node.py - Visualization
src/nodes/visualization_node.py - Plot parameters
src/services/viz_param_extractor.py - MCP interface
src/mcp_tools.py
Other components
- Prompt user
- AMReX solver
- External orchestrator
Connections 21
- Prompt user → CLI workflow: submits prompt
- CLI workflow → Agent configuration: loads settings
src/main.py - CLI workflow → Clarification: clarifies intent
- CLI workflow → Plan and baseline: starts planning
- Plan and baseline → Solver configurations: uses solver definitions
- Plan and baseline → Embedding retrieval: retrieves context
- Embedding retrieval → Solver search: searches solvers
- Embedding retrieval → Case search: searches cases
- Plan and baseline → Plan review: submits plan
- Plan review → Plan validation: validates plan
- Plan review → Input generation: approves plan
- Input generation → Build and run: prepares run
- Build and run → Local execution: runs locally
- Build and run → Superfacility execution: submits remotely
- Local execution → AMReX solver: executes
- Superfacility execution → AMReX solver: executes
- Build and run → Run analysis: provides run status
- Run analysis → Visualization: routes results
- Visualization → Plot parameters: extracts plot inputs
- External orchestrator → MCP interface: invokes tools
- MCP interface → CLI workflow: exposes workflow