# chen-yang-liu/change-agent architecture

> Architecture diagram of the GitHub repository chen-yang-liu/change-agent, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/chen-yang-liu/change-agent
- Repository: https://github.com/chen-yang-liu/change-agent

## Overview

Change-Agent combines a multi-level remote-sensing change model with an interactive LLM-agent framework. The documented workflow starts with paired pre/post images, produces change masks and descriptive captions, and exposes interactive analysis through CLI and web demos. The model-training path uses LEVIR-MCI data and evaluation metrics; the agent framework supplies language models and executable tools. The README documents capabilities beyond the sampled excerpts, so links between the change model and agent tools are not inferred where their wiring is unverified.

Main entry points: [`Multi_change/train.py`](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/train.py) (Model training), [`lagent-main/lagent/agents/internlm2_agent.py`](https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/agents/internlm2_agent.py) (Agent orchestration), [`lagent-main/lagent/actions/action_executor.py`](https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/actions/action_executor.py) (Action executor), [`Multi_change/predict.py`](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/predict.py) (Inference)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mci["Change interpretation"]
  node_cli["CLI demo<br/>[try_chat.py]"]
  node_web["Web demo<br/>[web_demo.py]"]
  node_predict["Inference<br/>[predict.py]"]
  node_dataset["LEVIR-MCI data<br/>[LEVIR_MCI.py]"]
  node_preprocess["Caption preprocessing<br/>[preprocess_data.py]"]
  node_encoder["Feature encoder"]
  node_backbone["SegFormer backbone<br/>[segformer.py]"]
  node_decoder["Task decoder<br/>[model_decoder.py]"]
  node_trainer["Model training<br/>[train.py]"]
end

subgraph group_agent["Interactive agent"]
  node_agent["Agent orchestration<br/>[internlm2_agent.py]"]
  node_agent_base["Agent base<br/>[base_agent.py]"]
end

subgraph group_framework["Agent framework"]
  node_executor["Action executor<br/>[action_executor.py]"]
  node_image_action["Image change action"]
  node_search["Web search actions<br/>[google_search.py]"]
  node_python["Python interpreter"]
  node_ipython["IPython sessions<br/>[ipython_manager.py]"]
  node_llm_base["Language model API<br/>[base_llm.py]"]
  node_vllm["vLLM backend<br/>[vllm_wrapper.py]"]
end

subgraph group_metrics["Evaluation"]
  node_bleu["BLEU scoring<br/>[bleu.py]"]
  node_cider["CIDEr scoring<br/>[cider.py]"]
  node_meteor["METEOR scoring<br/>[meteor.py]"]
  node_rouge["ROUGE scoring<br/>[rouge.py]"]
end

node_user(("User"))
node_images["Image pair"]
node_external_llm(("Language model service"))

node_user -->|"starts chat"| node_cli
node_user -->|"uses demo"| node_web
node_cli -->|"submits turns"| node_agent
node_web -->|"submits turns"| node_agent
node_user -->|"provides images"| node_predict
node_images -->|"input pair"| node_predict
node_predict -->|"extracts features"| node_encoder
node_encoder -->|"uses backbone"| node_backbone
node_predict -->|"predicts tasks"| node_decoder
node_dataset -->|"provides samples"| node_trainer
node_preprocess -->|"creates caption data"| node_dataset
node_trainer -->|"trains model"| node_encoder
node_trainer -->|"trains model"| node_decoder
node_agent -->|"extends"| node_agent_base
node_agent -->|"queries model"| node_llm_base
node_vllm -->|"implements"| node_llm_base
node_llm_base -.->|"generates text"| node_external_llm
node_agent -->|"dispatches actions"| node_executor
node_executor -->|"dispatches action"| node_image_action
node_executor -->|"dispatches action"| node_search
node_executor -->|"dispatches action"| node_python
node_python -->|"runs sessions"| node_ipython
node_trainer -->|"evaluates captions"| node_bleu
node_trainer -->|"evaluates captions"| node_cider
node_trainer -->|"evaluates captions"| node_meteor
node_trainer -->|"evaluates captions"| node_rouge

click node_cli "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/try_chat.py"
click node_web "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/web_demo.py"
click node_predict "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/predict.py"
click node_dataset "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/data/LEVIR_MCI.py"
click node_preprocess "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/preprocess_data.py"
click node_encoder "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/model/model_encoder_att.py"
click node_backbone "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/model/segformer.py"
click node_decoder "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/model/model_decoder.py"
click node_trainer "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/train.py"
click node_agent "https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/agents/internlm2_agent.py"
click node_agent_base "https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/agents/base_agent.py"
click node_executor "https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/actions/action_executor.py"
click node_image_action "https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/actions/image_change_interpreter.py"
click node_search "https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/actions/google_search.py"
click node_python "https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/actions/ipython_interpreter.py"
click node_ipython "https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/actions/ipython_manager.py"
click node_llm_base "https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/llms/base_llm.py"
click node_vllm "https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/llms/vllm_wrapper.py"
click node_bleu "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/eval_func/bleu/bleu.py"
click node_cider "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/eval_func/cider/cider.py"
click node_meteor "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/eval_func/meteor/meteor.py"
click node_rouge "https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/eval_func/rouge/rouge.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_web,node_predict,node_dataset,node_preprocess,node_encoder,node_backbone,node_decoder,node_trainer,node_user toneBlue
class node_agent,node_agent_base toneAmber
class node_executor,node_image_action,node_search,node_python,node_ipython,node_llm_base,node_vllm toneMint
class node_bleu,node_cider,node_meteor,node_rouge toneRose
class node_images,node_external_llm toneIndigo
```

## Components

### Change interpretation

- [CLI demo](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/try_chat.py): `Multi_change/try_chat.py`
- [Web demo](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/web_demo.py): `Multi_change/web_demo.py`
- [Inference](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/predict.py): `Multi_change/predict.py`
- [LEVIR-MCI data](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/data/LEVIR_MCI.py): `Multi_change/data/LEVIR_MCI.py`
- [Caption preprocessing](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/preprocess_data.py): `Multi_change/preprocess_data.py`
- [Feature encoder](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/model/model_encoder_att.py): `Multi_change/model/model_encoder_att.py`
- [SegFormer backbone](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/model/segformer.py): `Multi_change/model/segformer.py`
- [Task decoder](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/model/model_decoder.py): `Multi_change/model/model_decoder.py`
- [Model training](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/train.py): `Multi_change/train.py`

### Interactive agent

- [Agent orchestration](https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/agents/internlm2_agent.py): `lagent-main/lagent/agents/internlm2_agent.py`
- [Agent base](https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/agents/base_agent.py): `lagent-main/lagent/agents/base_agent.py`

### Agent framework

- [Action executor](https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/actions/action_executor.py): `lagent-main/lagent/actions/action_executor.py`
- [Image change action](https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/actions/image_change_interpreter.py): `lagent-main/lagent/actions/image_change_interpreter.py`
- [Web search actions](https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/actions/google_search.py): `lagent-main/lagent/actions/google_search.py`
- [Python interpreter](https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/actions/ipython_interpreter.py): `lagent-main/lagent/actions/ipython_interpreter.py`
- [IPython sessions](https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/actions/ipython_manager.py): `lagent-main/lagent/actions/ipython_manager.py`
- [Language model API](https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/llms/base_llm.py): `lagent-main/lagent/llms/base_llm.py`
- [vLLM backend](https://github.com/chen-yang-liu/change-agent/blob/main/lagent-main/lagent/llms/vllm_wrapper.py): `lagent-main/lagent/llms/vllm_wrapper.py`

### Evaluation

- [BLEU scoring](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/eval_func/bleu/bleu.py): `Multi_change/eval_func/bleu/bleu.py`
- [CIDEr scoring](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/eval_func/cider/cider.py): `Multi_change/eval_func/cider/cider.py`
- [METEOR scoring](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/eval_func/meteor/meteor.py): `Multi_change/eval_func/meteor/meteor.py`
- [ROUGE scoring](https://github.com/chen-yang-liu/change-agent/blob/main/Multi_change/eval_func/rouge/rouge.py): `Multi_change/eval_func/rouge/rouge.py`

### Other components

- **User**
- **Image pair**
- **Language model service**

## Connections

- User → CLI demo: starts chat
- User → Web demo: uses demo
- CLI demo → Agent orchestration: submits turns
- Web demo → Agent orchestration: submits turns
- User → Inference: provides images
- Image pair → Inference: input pair
- Inference → Feature encoder: extracts features
- Feature encoder → SegFormer backbone: uses backbone
- Inference → Task decoder: predicts tasks
- LEVIR-MCI data → Model training: provides samples
- Caption preprocessing → LEVIR-MCI data: creates caption data
- Model training → Feature encoder: trains model
- Model training → Task decoder: trains model
- Agent orchestration → Agent base: extends
- Agent orchestration → Language model API: queries model
- vLLM backend → Language model API: implements
- Language model API → Language model service: generates text
- Agent orchestration → Action executor: dispatches actions
- Action executor → Image change action: dispatches action
- Action executor → Web search actions: dispatches action
- Action executor → Python interpreter: dispatches action
- Python interpreter → IPython sessions: runs sessions
- Model training → BLEU scoring: evaluates captions
- Model training → CIDEr scoring: evaluates captions
- Model training → METEOR scoring: evaluates captions
- Model training → ROUGE scoring: evaluates captions
