Official implementation of CAR (Create And Replan), accepted to Findings of ACL 2026.
CAR is a tool-using agent framework for environments where the initial toolset may be incomplete or unreliable. It introduces two mechanisms:
- Dynamic Tool Synthesis: creates a missing Python tool during inference and adds it to the current action space.
- Global Trajectory Rectification: diagnoses failed execution, preserves successful steps, and replans only the remaining trajectory.
This repository also contains ToolHop-Pro, a benchmark derived from ToolHop for evaluating agents under tool scarcity and execution instability.
| Path | Description |
|---|---|
car_agent.py |
Main CAR workflow: routing, planning, execution, and final synthesis |
car/replanner.py |
Global trajectory rectification |
car/reflector.py |
Invalid-result and failure detection |
car/meta_tools/ |
Tool creation, schema conversion, and isolated execution |
car/prompts.py |
Prompts for the CAR modules |
ToolHopPro.json |
ToolHop-Pro benchmark |
test_arc_mode.py |
Evaluation script |
tool_set/ |
Runtime tool pool |
results/ |
Experiment outputs |
CAR requires Python 3.13 or later and uses uv for dependency management.
git clone https://github.com/Lancetwang/car.git
cd car
uv syncCreate an .env file for your OpenAI-compatible model provider:
OPENAI_API_KEY=your_api_key
OPENAI_BASE_URL=your_openai_compatible_endpointModel names and runtime limits are configured in config.yaml. Docker is required for isolated tool execution.
Run CAR interactively:
uv run car_agent.pyEvaluate ToolHop-Pro in the Complete or Missing setting:
uv run test_arc_mode.py --type complete
uv run test_arc_mode.py --type missingRun selected examples:
uv run test_arc_mode.py --type missing --id 0 1 2 3ToolHop-Pro contains 995 examples and 622 unique tools. It defines three evaluation settings:
- Complete: all tools are available.
- Missing: logical tools are removed and must be synthesized when needed.
- Error: the complete toolset is retained, with execution failures injected into logical tools.
The released evaluation script currently provides the Complete and Missing settings. The paper does not specify the probability, seed, or timeout distribution used for Error-mode injection; these values are therefore not reconstructed in this repository.
Pass rate on ToolHop-Pro with Qwen3-Plus:
| Method | Complete | Missing | Error |
|---|---|---|---|
| CAR | 54.57 | 53.87 | 52.86 |
On the original ToolHop benchmark, CAR improves Qwen3-Plus from 47.94% to 54.57% pass rate. See the paper for the complete experimental setup, baselines, and ablations.