Official implementation of ContDa (ACL 2026), a framework for continual documentation adaptation in tool-using LLM agents. ContDa improves robustness under evolving toolsets by leveraging relations between tools for guided exploration and ambiguity-aware adjustment.
This camera-ready repository intentionally includes only the StableToolBench pipeline code and a compact StableToolBench corpus snapshot. Baselines, ablation studies, analysis notebooks, generated experiment outputs, caches, and private credentials are not included.
evolution/ours/dynamic_evolution.py: main continual documentation adaptation pipeline.evolution/model/: LLM clients and BGE retrieval/clustering utilities.evolution/utils.py: API probing, similarity, and preprocessing helpers.server/dynamic/corpus/expanded_tools_group/original/: original StableToolBench time-step inputs.server/virtual_api_server/: optional virtual API server adapted from prior work, with a sanitized config template.
For each time step, ContDa:
- Loads the original StableToolBench tool corpus.
- Explores each new tool by proposing natural user queries.
- Calls the tool endpoint or virtual server to collect observations.
- Analyzes observations and rewrites the tool description.
- Retrieves similar previous tools for later time steps.
- Clusters discovered tools and appends concise relational notes to make similar tools easier to distinguish.
Outputs are written under the selected corpus folder:
discovered/time_<t>.jsonadjusted/time_<t>.json- temporary TSV and embedding cache files generated by retrieval/clustering
Install dependencies in a clean Python environment:
pip install -r requirements.txtSet API credentials through environment variables. Do not put real keys in tracked files.
export OPENAI_API_KEY="..."
export OPENAI_API_BASE="https://api.openai.com/v1"
export RAPIDAPI_KEY="..."OPENAI_API_BASE is optional if you use the default OpenAI endpoint.
From the repository root:
python -m evolution.ours.dynamic_evolution \
--model_name gpt-4o-mini \
--env expanded_tools_group \
--time_step 5 \
--parallel \
--max_workers 4To use an explicit corpus path:
python -m evolution.ours.dynamic_evolution \
--model_name gpt-4o-mini \
--corpus_folder server/dynamic/corpus/expanded_tools_group \
--time_step 5To route tool calls through the optional virtual server:
python -m evolution.ours.dynamic_evolution \
--model_name gpt-4o-mini \
--env expanded_tools_group \
--rapidapi_url http://127.0.0.1:8080/virtualThe virtual server first tries the configured ToolBench/RapidAPI endpoint. If a real response is unavailable and cached examples exist, it can simulate a response with an LLM.
cd server/virtual_api_server
cp config.example.yml config.yml
python main.pyBefore running, edit config.yml paths for your environment. Keep real keys in environment variables, not in config.yml.
- The included corpus snapshot is enough to show the pipeline structure. Full experiment outputs are deliberately excluded.
- The BGE retriever downloads/loads
BAAI/bge-large-en-v1.5throughsentence-transformerswhen no local cache is available. - Generated folders such as
discovered/,adjusted/, cache files, logs, and local configs are ignored by.gitignore.