Skip to content

Bingo-W/ContDa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ContDa: Continual Documentation Adaptation

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.

Contents

  • 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.

Pipeline

For each time step, ContDa:

  1. Loads the original StableToolBench tool corpus.
  2. Explores each new tool by proposing natural user queries.
  3. Calls the tool endpoint or virtual server to collect observations.
  4. Analyzes observations and rewrites the tool description.
  5. Retrieves similar previous tools for later time steps.
  6. 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>.json
  • adjusted/time_<t>.json
  • temporary TSV and embedding cache files generated by retrieval/clustering

Setup

Install dependencies in a clean Python environment:

pip install -r requirements.txt

Set 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.

Run the StableToolBench Pipeline

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 4

To 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 5

To 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/virtual

Optional Virtual Server

The 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.py

Before running, edit config.yml paths for your environment. Keep real keys in environment variables, not in config.yml.

Notes

  • 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.5 through sentence-transformers when no local cache is available.
  • Generated folders such as discovered/, adjusted/, cache files, logs, and local configs are ignored by .gitignore.

About

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.

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors