ChemAgent leverages an innovative self-improving memory system to significantly enhance performance in complex scientific tasks, with a particular focus on Chemistry.
- Self-updating Memory System: Continuously improves model performance
- Specialized for Chemistry: Tailored for chemical reasoning tasks
- Modular Architecture: Includes task splitting, execution, association, and reflection modules
Xagent/agent/
: Contains prompts and code for functional modulesdev_test.py
: Execution code for memory pool constructionassets/config.yml
: Configuration and module activation managementoutput/
: Experimental results for GPT-4 and GPT-3.5 across four datasetsmemory/
: Plan Memory and Execute Memory for the four datasetsdataset/
: Experimental datasets from SciBench
- Installation: (Add installation instructions here)
- Configuration: Modify
assets/config.yml
to suit your needs - Running Experiments: Use
dev_test.py
with appropriate parameters
For detailed usage instructions, see the "How to run" and "How to dev" sections below.
python dev_test.py --tool python --mode test --list_source <put_the_datasetname_here>
You can choose from the following datasets located in the dataset
folder: atkins
, chemmc
, matter
, or quan
.
Before executing tasks using this framework, it is necessary to first construct memory according to the process outlined in the paper.
-
Add Few-shot Examples: In the
XAgent/agent/simple_agent/prompt.py
file, select two examples fromfewshot_examples
and incorporate them into the model prompt. -
Update Configuration File: Modify the
assets/config.yml
file to adjust the configuration according to your requirements. -
Run Development Tests: Execute the development test mode using the following command:
python dev_test.py --tool python --mode dev --list_source <put_the_datasetname_here>
The assets/config.yml
file allows you to customize various settings for the ChemAgent framework:
default_completion_kwargs:
model: gpt-3.5-turbo-16k
eva_model: gpt-4
temperature: 0.2
request_timeout: 60
To change other settings:
save_dir: "./memory/exec_memory/storage_matter_gpt4"
plan_save_dir: "./memory/plan_memory/plan_storage_matter_gpt4"
score: False
refine: False
image: False
The configuration parameters control various aspects of the system:
-
Memory Pools:
plan_save_dir
: Specifies the memory pool for Plan Memorysave_dir
: Specifies the memory pool for Execution Memory
-
Knowledge Memory:
img
: Controls the activation of Knowledge Memory
-
Task Execution:
refine
: Determines if the system should refine the task strategy upon execution failure
-
Evaluation:
score
: Decides if the evaluation module is enabled