
An Agent Memory Framework Designed For Deep Research Agents
Are you tired of deep research agents that "understand" everything but "remember" nothing? Does your agent struggle with diluted attention in sea of long-form text? Are you frustrated by reasoning failures caused by noisy, irrelevant memories? Do you find your agent memory crippled by skyrocketing computational costs and the logistical nightmare of ever-growing context histories? Most importantly: Is your agent stuck memorizing "what" the result is, while completely failing to learn "how" to get there? If so, you are witnessing the fundamental bottleneck of current agent memory: an incompetent Planner retrieving memories from bloated memory and using non-comprehensive in-context prompts to guide an unprepared Executor in conducting deep research.
MIA (Memory In Intelligence Agent) is a memory framewoek designed for deep research agents. It is developed by a joint team from the Shanghai Institute of Intelligence (SII) and East China Normal University (ECNU). MIA is a paradigm-shifting framework designed to transform agents from "passive record-keepers" into "active strategists." MIA replaces the chaotic "memory dump" with a sophisticated Manager-Planner-Executor architecture:
🌟 Key Highlights

📊 Experimental Analysis
Our comprehensive evaluation across multiple benchmarks demonstrates that MIA significantly improves the performance of Deep Research Agents:
We also provide two MIA versions of OpenClaw skills in Original Version and Trust-Worthy Version, which not only integrate MIA memory framework, but also include trust-worthy judgment mechanism. Here are the MIA memory and trust-worthy demos. In addition, we also provide the reference code for training the Planner model based on the online-talking with OpenClaw bot in Training Version and the lightweight FP8 model checkpoints in Lightweight Model.
MIA Memory Demo:
Trust-Worthy Demo:
The core implementation is mainly in web_tools/server.
Open web_tools/run.sh and configure the Google Search Serper key:
export SERPER_KEY_ID="xxxxx"
Start the run script:
cd web_tools
bash ./run.sh
Service SERVICE_URL/server, method SERVICE_URL/server/search
The core implementation is mainly in local_search.
Refer to the setup instructions in search-r1. This project uses wiki25 local retrieval.
Configure the path and start the run script:
cd local_search
bash ./run.sh
Service http://localhost:8001/, method http://localhost:8001/retrieve
The image search cache used in this project: image_search_cache
conda create -n verl python==3.10.12
Run the install.sh script in the train directory to install dependencies.
Flash-attention needs to be installed separately:
wget -nv https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3+cu12torch2.7cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
pip install --no-cache-dir flash_attn-2.8.3+cu12torch2.7cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
Training: 🤗 Train
Our implementation is based on VeRL. Key modifications:
/Executor-Train/Train/verl/experimental/tool_agent_loop.py.prompt is defined in /Executor-Train/Train/local_search/prompt.py.CustomRLHFDataset) and reward score computation (compute_score) are in Executor-Train/Train/local_search/mmsearch.py.verl.tools.search_tool.SearchTool and verl.tools.web_image_to_image_search_tool.WebImageToImageSearchTool./Executor-Train/Train/local_search/run_mmsearch_grpo.sh.1. Deploy the local text search tool.
2. Configure /Executor-Train/Train/local_search/mm_search_tool_config.yaml and /Executor-Train/Train/local_search/mmsearch.yaml:
mm_search_tool_config.yaml
tools[0].config.retrieval_service_url: local search service URLtools[1].config.fvqa_train_cache_path, tools[1].config.test_cache_path: image search cache paths for the test and validation setsmmsearch.yaml
hydra.searchpath: trainer config pathdata.custom_cls.path: custom dataset code pathactor_rollout_ref.rollout.multi_turn.tool_config_path: path to the tool config mm_search_tool_config.yaml3. Deploy Qwen3-32B on Node 1 as Planner & Judger:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Qwen/Qwen3-32B \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
LLM service at your_url/8002/v1
4. Deploy the Memory-Planner service (can be on the same node as Planner & Judger):
cd Memory-Serve
cd TRAIN_PLANNER
Configure the run script run.sh: set both MEMORY_URL and PLAN_URL to the LLM service deployed in the previous step.
To improve training efficiency, memory content and initial plan are collected in advance. Only the replan service is needed here: your_url/5000/replan_train.
5. Configure the training script /Executor-Train/Train/local_search/run_mmsearch_grpo.sh:
JUDGE_URL: judge service, set to your_url/8002/v1REPLAN_URL: replan service, set to your_url/5000/replan_trainWANDB_API_KEY: WandB API key (optional)SAVE_CHECKPOINT_DIR: model save pathDATASET_TRAIN: training dataset pathDATASET_VAL: validation dataset pathREF_MODEL_PATH: pretrained model path6. Start training on Node 2. Navigate to /Executor-Train/Train/:
bash ./local_search/run_mmsearch_grpo.sh
7. Export the model:
python -m verl.model_merger merge \
--backend fsdp \
--local_dir /your_path/actor \
--target_dir /your_path
Download our trained Executor 🤗 here
Our implementation is based on VeRL. Key modifications:
/Planner-Train/mem-plan/verl/experimental/multi_turn_loop.py.prompt is defined in /Planner-Train/mem-plan/local_search/prompt.py.CustomRLHFDataset) and reward score computation (compute_score) are in /Planner-Train/mem-plan/local_search/mmsearch.py./Planner-Train/mem-plan/local_search/run_mmsearch_grpo.sh.1. Deploy the Judger service on Node 1:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Qwen/Qwen3-32B \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
2. Deploy the Executor service on Node 2.
Deploy the trained Executor:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Executor \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
Navigate to /Serve/Train_Planner and configure the run script serve.sh:
AGENT_URL: Executor service URLSERVICE_URL: offline text search service URLTEST_CACHE_DIR: image-to-image search cache pathMAX_LLM_CALL_PER_RUN: maximum number of interaction rounds between Executor and toolsStart the service:
bash serve.sh
3. Configure the training script /Planner-Train/mem-plan/local_search/run_mmsearch_grpo.sh:
JUDGE_URL: judge service, set to your_url/8002/v1PLAN_URL: Executor service for plan responses, set to your_url/5000/planREPLAN_URL: Executor service for replan responses, set to your_url/5000/replanWANDB_API_KEY: WandB API key (optional)SAVE_CHECKPOINT_DIR: model save pathDATASET_TRAIN: training dataset pathDATASET_VAL: validation dataset pathREF_MODEL_PATH: pretrained model pathTo improve training efficiency, memory content and image caption are collected in advance.
4. Start training on Node 3. Navigate to /Planner-Train/mem-plan/:
bash ./local_search/run_mmsearch_grpo.sh
5. Export the model:
python -m verl.model_merger merge \
--backend fsdp \
--local_dir /your_path/actor \
--target_dir /your_path
Download our trained Planner 🤗 here
This section introduces the TTRL code used for developer performance validation. Its core implementation is based on an improved veRL framework, which first loads the policy model (i.e., the Planner), then reads the test set, and synchronously completes the following during a single-round (1-epoch) inference process: outputting validation results, storing explicit memory (workflows compressed by Memory Manager), and updating implicit memory (parameters of the policy model).
1. Deploy the Memory Manager & Judger service on Node 1:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Qwen/Qwen3-32B \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
2. Deploy the Executor service on Node 2:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Executor \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
Navigate to /Serve/MIA-TTRL and configure the run script serve.sh:
AGENT_URL: Executor service URLSERVICE_URL: offline/online text search service URLTEST_CACHE_DIR: image-to-image search cache pathMAX_LLM_CALL_PER_RUN: maximum number of interaction rounds between Executor and toolsMEMORY_URL: Memory Manager service URLTTRL_SAVE: output path during explorationPARQUET_PATH: test set path with images (required for image datasets)In /Serve/MIA-TTRL/call_agent.py, configure the text search method (choose one):
from tool_search_local import * # offline text search
from tool_serper import * # online text search
Switch the Python script in /Serve/MIA-TTRL/serve.sh to select the mode (supervised / unsupervised):
python agent_serve_ttrl.py .... # scenario where Ground-Truth is available after each question
python agent_serve_ttrl_nogt.py .... # scenario where Ground-Truth is unavailable after each question
3. Configure the script /TTRL/TTRL/local_search/run_mmsearch_grpo.sh (supervised) or /TTRL/TTRL-nogt/local_search/run_mmsearch_grpo.sh (unsupervised):
JUDGE_URL: judge service, set to your_url/8002/v1MEMORY_URL: memory retrieval service, set to your_url/5000/memoryPLAN_URL: Executor service for plan responses, set to your_url/5000/planREPLAN_URL: Executor service for replan responses, set to your_url/5000/replanMEMORY_BANK_SAVE_URL: service for saving memories to the buffer (current batch exploration not yet complete), set to your_url/5000/memory_bank_saveBATCH_EVALUATE_URL: service for evaluating current batch samples, set to your_url/5000/batch_evaluateCONSOLIDATE_MEMORIES_URL: service for extracting memories from all buffered samples, set to your_url/5000/consolidate_memoriesSAVE_MEMORIES_URL: service for saving all memories, set to your_url/5000/save_memoryWANDB_API_KEY: WandB API key (optional)SAVE_CHECKPOINT_DIR: model save pathDATASET_TRAIN: dataset pathDATASET_VAL: unused, set to the same as DATASET_TRAINREF_MODEL_PATH: initial Planner pathStart the service:
bash serve.sh
4. Start the Planner training on Node 3. Navigate to /TTRL/TTRL/ or /TTRL/TTRL-nogt/:
bash ./local_search/run_mmsearch_grpo.sh
This section introduces the TTRL-streaming code designed for end users. We decouple the original veRL framework into a server side and a client side: the server loads the policy model and remains on standby; the client handles user interactions and streams input data and user feedback to the server in real time, driving the coordinated update of explicit memory (memory archives) and implicit memory (policy model parameters). Users can customize the feedback mechanism and reward format to flexibly adapt to different application scenarios.
1. Deploy the Memory Manager & Judger service on Node 1:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Qwen/Qwen3-32B \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
2. Deploy the Executor service on Node 2:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Executor \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
Open /Serve/MIA-TTRL and configure the run script serve_streaming.sh:
AGENT_URL: URL of the Executor serviceSERVICE_URL: URL of the text search (offline/online) serviceTEST_CACHE_DIR: Cache path for image-to-image searchMAX_LLM_CALL_PER_RUN: Maximum number of interaction rounds between Executor and toolsMEMORY_URL: URL of the Memory Manager serviceTTRL_SAVE: Output path during explorationFor text search settings in /Serve/MIA-TTRL/call_agent.py (choose one):
from tool_search_local import * # Offline text search
from tool_serper import * # Online text search
If you encounter out-of-memory (OOM) errors during runtime, you can modify the device for loading embedding in /Serve/MIA-TTRL/agent_serve_ttrl_streaming.py to cpu:
class MemoryProcessor:
def __init__(self):
"""Initialize the OpenAI client based on model configuration."""
self.model_name = MODEL_NAME
bert_path = "/your_path/bert/sup-simcse-bert-base-uncased"
# self.device = "cuda" if torch.cuda.is_available() else "cpu"
self.device = "cpu" # Disable adaptive selection, always load on CPU
3. Configure the server-side script /TTRL-streaming/run_streaming_ttrl_server.sh:
JUDGE_URL: Judge service, set to your_url/8002/v1TTRL_AGENT_BASE: TTRL-streaming service, set to your_url/5000GT_REWARD_URL: Service for receiving reward signals, set to your_url/5000/planWANDB_API_KEY: WandB API key (optional)SAVE_CHECKPOINT_DIR: Model save pathREF_MODEL_PATH: Initial Planner pathdata.train_batch_size: batch_size used when updating parametersactor_rollout_ref.actor.optim.lr: Learning rate when updating parametersactor_rollout_ref.rollout.n: Number of rollout iterations for the GRPO methodLaunch on Node 3:
bash run_streaming_ttrl_server.sh
4. Configure the reward service (user feedback) /TTRL-streaming/:
TTRL-streaming/run_gt_reward_server.sh
JUDGE_URL: Judge service, set to your_url/8002/v1TTRL-streaming/gt_reward_core.py: Can be modified to implement custom user feedback/reward patternsLaunch on Node 3:
bash run_gt_reward_server.sh
5. Configure the client-side script /TTRL-streaming/run_streaming_ttrl_client.sh:
JUDGE_URL: Judge service, set to your_url/8002/v1TTRL_AGENT_BASE: TTRL-streaming service, set to your_url/5000GT_REWARD_URL: Service for receiving reward signals, set to your_url/5000/planREF_MODEL_PATH: Initial Planner pathTTRL_SERVER: URL of the veRL server, set to http://127.0.0.1:8765DATASET_TRAIN: Dataset pathSAVE_STEP: Save interval for the policy modelCLIENT_BATCH_SIZE: Client parallelism count; must be divisible by data.train_batch_size (the minimum number of samples required for one update) set on the server sideLaunch on Node 3:
bash run_streaming_ttrl_client.sh
Released under the MIT License.
PhD Student: Weicheng Meng, Yu Cheng, Zhihang Lin
Student Leader: Jingyang Qiao
Professor: Zhizhong Zhang, Xin Tan, Jingyu Gong, Zhaoxia Yin
Projector Leader: Yuan Xie
We also plan to release the following next versions:
High-Efficiency Version
Trust-worthy Version
Python
99.8%

An Agent Memory Framework Designed For Deep Research Agents
Are you tired of deep research agents that "understand" everything but "remember" nothing? Does your agent struggle with diluted attention in sea of long-form text? Are you frustrated by reasoning failures caused by noisy, irrelevant memories? Do you find your agent memory crippled by skyrocketing computational costs and the logistical nightmare of ever-growing context histories? Most importantly: Is your agent stuck memorizing "what" the result is, while completely failing to learn "how" to get there? If so, you are witnessing the fundamental bottleneck of current agent memory: an incompetent Planner retrieving memories from bloated memory and using non-comprehensive in-context prompts to guide an unprepared Executor in conducting deep research.
MIA (Memory In Intelligence Agent) is a memory framewoek designed for deep research agents. It is developed by a joint team from the Shanghai Institute of Intelligence (SII) and East China Normal University (ECNU). MIA is a paradigm-shifting framework designed to transform agents from "passive record-keepers" into "active strategists." MIA replaces the chaotic "memory dump" with a sophisticated Manager-Planner-Executor architecture:
🌟 Key Highlights

📊 Experimental Analysis
Our comprehensive evaluation across multiple benchmarks demonstrates that MIA significantly improves the performance of Deep Research Agents:
We also provide two MIA versions of OpenClaw skills in Original Version and Trust-Worthy Version, which not only integrate MIA memory framework, but also include trust-worthy judgment mechanism. Here are the MIA memory and trust-worthy demos. In addition, we also provide the reference code for training the Planner model based on the online-talking with OpenClaw bot in Training Version and the lightweight FP8 model checkpoints in Lightweight Model.
MIA Memory Demo:
Trust-Worthy Demo:
The core implementation is mainly in web_tools/server.
Open web_tools/run.sh and configure the Google Search Serper key:
export SERPER_KEY_ID="xxxxx"
Start the run script:
cd web_tools
bash ./run.sh
Service SERVICE_URL/server, method SERVICE_URL/server/search
The core implementation is mainly in local_search.
Refer to the setup instructions in search-r1. This project uses wiki25 local retrieval.
Configure the path and start the run script:
cd local_search
bash ./run.sh
Service http://localhost:8001/, method http://localhost:8001/retrieve
The image search cache used in this project: image_search_cache
conda create -n verl python==3.10.12
Run the install.sh script in the train directory to install dependencies.
Flash-attention needs to be installed separately:
wget -nv https://github.com/Dao-AILab/flash-attention/releases/download/v2.8.3/flash_attn-2.8.3+cu12torch2.7cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
pip install --no-cache-dir flash_attn-2.8.3+cu12torch2.7cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
Training: 🤗 Train
Our implementation is based on VeRL. Key modifications:
/Executor-Train/Train/verl/experimental/tool_agent_loop.py.prompt is defined in /Executor-Train/Train/local_search/prompt.py.CustomRLHFDataset) and reward score computation (compute_score) are in Executor-Train/Train/local_search/mmsearch.py.verl.tools.search_tool.SearchTool and verl.tools.web_image_to_image_search_tool.WebImageToImageSearchTool./Executor-Train/Train/local_search/run_mmsearch_grpo.sh.1. Deploy the local text search tool.
2. Configure /Executor-Train/Train/local_search/mm_search_tool_config.yaml and /Executor-Train/Train/local_search/mmsearch.yaml:
mm_search_tool_config.yaml
tools[0].config.retrieval_service_url: local search service URLtools[1].config.fvqa_train_cache_path, tools[1].config.test_cache_path: image search cache paths for the test and validation setsmmsearch.yaml
hydra.searchpath: trainer config pathdata.custom_cls.path: custom dataset code pathactor_rollout_ref.rollout.multi_turn.tool_config_path: path to the tool config mm_search_tool_config.yaml3. Deploy Qwen3-32B on Node 1 as Planner & Judger:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Qwen/Qwen3-32B \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
LLM service at your_url/8002/v1
4. Deploy the Memory-Planner service (can be on the same node as Planner & Judger):
cd Memory-Serve
cd TRAIN_PLANNER
Configure the run script run.sh: set both MEMORY_URL and PLAN_URL to the LLM service deployed in the previous step.
To improve training efficiency, memory content and initial plan are collected in advance. Only the replan service is needed here: your_url/5000/replan_train.
5. Configure the training script /Executor-Train/Train/local_search/run_mmsearch_grpo.sh:
JUDGE_URL: judge service, set to your_url/8002/v1REPLAN_URL: replan service, set to your_url/5000/replan_trainWANDB_API_KEY: WandB API key (optional)SAVE_CHECKPOINT_DIR: model save pathDATASET_TRAIN: training dataset pathDATASET_VAL: validation dataset pathREF_MODEL_PATH: pretrained model path6. Start training on Node 2. Navigate to /Executor-Train/Train/:
bash ./local_search/run_mmsearch_grpo.sh
7. Export the model:
python -m verl.model_merger merge \
--backend fsdp \
--local_dir /your_path/actor \
--target_dir /your_path
Download our trained Executor 🤗 here
Our implementation is based on VeRL. Key modifications:
/Planner-Train/mem-plan/verl/experimental/multi_turn_loop.py.prompt is defined in /Planner-Train/mem-plan/local_search/prompt.py.CustomRLHFDataset) and reward score computation (compute_score) are in /Planner-Train/mem-plan/local_search/mmsearch.py./Planner-Train/mem-plan/local_search/run_mmsearch_grpo.sh.1. Deploy the Judger service on Node 1:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Qwen/Qwen3-32B \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
2. Deploy the Executor service on Node 2.
Deploy the trained Executor:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Executor \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
Navigate to /Serve/Train_Planner and configure the run script serve.sh:
AGENT_URL: Executor service URLSERVICE_URL: offline text search service URLTEST_CACHE_DIR: image-to-image search cache pathMAX_LLM_CALL_PER_RUN: maximum number of interaction rounds between Executor and toolsStart the service:
bash serve.sh
3. Configure the training script /Planner-Train/mem-plan/local_search/run_mmsearch_grpo.sh:
JUDGE_URL: judge service, set to your_url/8002/v1PLAN_URL: Executor service for plan responses, set to your_url/5000/planREPLAN_URL: Executor service for replan responses, set to your_url/5000/replanWANDB_API_KEY: WandB API key (optional)SAVE_CHECKPOINT_DIR: model save pathDATASET_TRAIN: training dataset pathDATASET_VAL: validation dataset pathREF_MODEL_PATH: pretrained model pathTo improve training efficiency, memory content and image caption are collected in advance.
4. Start training on Node 3. Navigate to /Planner-Train/mem-plan/:
bash ./local_search/run_mmsearch_grpo.sh
5. Export the model:
python -m verl.model_merger merge \
--backend fsdp \
--local_dir /your_path/actor \
--target_dir /your_path
Download our trained Planner 🤗 here
This section introduces the TTRL code used for developer performance validation. Its core implementation is based on an improved veRL framework, which first loads the policy model (i.e., the Planner), then reads the test set, and synchronously completes the following during a single-round (1-epoch) inference process: outputting validation results, storing explicit memory (workflows compressed by Memory Manager), and updating implicit memory (parameters of the policy model).
1. Deploy the Memory Manager & Judger service on Node 1:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Qwen/Qwen3-32B \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
2. Deploy the Executor service on Node 2:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Executor \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
Navigate to /Serve/MIA-TTRL and configure the run script serve.sh:
AGENT_URL: Executor service URLSERVICE_URL: offline/online text search service URLTEST_CACHE_DIR: image-to-image search cache pathMAX_LLM_CALL_PER_RUN: maximum number of interaction rounds between Executor and toolsMEMORY_URL: Memory Manager service URLTTRL_SAVE: output path during explorationPARQUET_PATH: test set path with images (required for image datasets)In /Serve/MIA-TTRL/call_agent.py, configure the text search method (choose one):
from tool_search_local import * # offline text search
from tool_serper import * # online text search
Switch the Python script in /Serve/MIA-TTRL/serve.sh to select the mode (supervised / unsupervised):
python agent_serve_ttrl.py .... # scenario where Ground-Truth is available after each question
python agent_serve_ttrl_nogt.py .... # scenario where Ground-Truth is unavailable after each question
3. Configure the script /TTRL/TTRL/local_search/run_mmsearch_grpo.sh (supervised) or /TTRL/TTRL-nogt/local_search/run_mmsearch_grpo.sh (unsupervised):
JUDGE_URL: judge service, set to your_url/8002/v1MEMORY_URL: memory retrieval service, set to your_url/5000/memoryPLAN_URL: Executor service for plan responses, set to your_url/5000/planREPLAN_URL: Executor service for replan responses, set to your_url/5000/replanMEMORY_BANK_SAVE_URL: service for saving memories to the buffer (current batch exploration not yet complete), set to your_url/5000/memory_bank_saveBATCH_EVALUATE_URL: service for evaluating current batch samples, set to your_url/5000/batch_evaluateCONSOLIDATE_MEMORIES_URL: service for extracting memories from all buffered samples, set to your_url/5000/consolidate_memoriesSAVE_MEMORIES_URL: service for saving all memories, set to your_url/5000/save_memoryWANDB_API_KEY: WandB API key (optional)SAVE_CHECKPOINT_DIR: model save pathDATASET_TRAIN: dataset pathDATASET_VAL: unused, set to the same as DATASET_TRAINREF_MODEL_PATH: initial Planner pathStart the service:
bash serve.sh
4. Start the Planner training on Node 3. Navigate to /TTRL/TTRL/ or /TTRL/TTRL-nogt/:
bash ./local_search/run_mmsearch_grpo.sh
This section introduces the TTRL-streaming code designed for end users. We decouple the original veRL framework into a server side and a client side: the server loads the policy model and remains on standby; the client handles user interactions and streams input data and user feedback to the server in real time, driving the coordinated update of explicit memory (memory archives) and implicit memory (policy model parameters). Users can customize the feedback mechanism and reward format to flexibly adapt to different application scenarios.
1. Deploy the Memory Manager & Judger service on Node 1:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Qwen/Qwen3-32B \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
2. Deploy the Executor service on Node 2:
export VLLM_USE_FLASHINFER_SAMPLER=0
CUDA_VISIBLE_DEVICES=0,1,2,3 \
vllm serve /your_path/Executor \
--tensor-parallel-size 4 \
--served-model-name "qwen" \
--gpu-memory-utilization 0.8 \
--host 0.0.0.0 \
--port 8002
Open /Serve/MIA-TTRL and configure the run script serve_streaming.sh:
AGENT_URL: URL of the Executor serviceSERVICE_URL: URL of the text search (offline/online) serviceTEST_CACHE_DIR: Cache path for image-to-image searchMAX_LLM_CALL_PER_RUN: Maximum number of interaction rounds between Executor and toolsMEMORY_URL: URL of the Memory Manager serviceTTRL_SAVE: Output path during explorationFor text search settings in /Serve/MIA-TTRL/call_agent.py (choose one):
from tool_search_local import * # Offline text search
from tool_serper import * # Online text search
If you encounter out-of-memory (OOM) errors during runtime, you can modify the device for loading embedding in /Serve/MIA-TTRL/agent_serve_ttrl_streaming.py to cpu:
class MemoryProcessor:
def __init__(self):
"""Initialize the OpenAI client based on model configuration."""
self.model_name = MODEL_NAME
bert_path = "/your_path/bert/sup-simcse-bert-base-uncased"
# self.device = "cuda" if torch.cuda.is_available() else "cpu"
self.device = "cpu" # Disable adaptive selection, always load on CPU
3. Configure the server-side script /TTRL-streaming/run_streaming_ttrl_server.sh:
JUDGE_URL: Judge service, set to your_url/8002/v1TTRL_AGENT_BASE: TTRL-streaming service, set to your_url/5000GT_REWARD_URL: Service for receiving reward signals, set to your_url/5000/planWANDB_API_KEY: WandB API key (optional)SAVE_CHECKPOINT_DIR: Model save pathREF_MODEL_PATH: Initial Planner pathdata.train_batch_size: batch_size used when updating parametersactor_rollout_ref.actor.optim.lr: Learning rate when updating parametersactor_rollout_ref.rollout.n: Number of rollout iterations for the GRPO methodLaunch on Node 3:
bash run_streaming_ttrl_server.sh
4. Configure the reward service (user feedback) /TTRL-streaming/:
TTRL-streaming/run_gt_reward_server.sh
JUDGE_URL: Judge service, set to your_url/8002/v1TTRL-streaming/gt_reward_core.py: Can be modified to implement custom user feedback/reward patternsLaunch on Node 3:
bash run_gt_reward_server.sh
5. Configure the client-side script /TTRL-streaming/run_streaming_ttrl_client.sh:
JUDGE_URL: Judge service, set to your_url/8002/v1TTRL_AGENT_BASE: TTRL-streaming service, set to your_url/5000GT_REWARD_URL: Service for receiving reward signals, set to your_url/5000/planREF_MODEL_PATH: Initial Planner pathTTRL_SERVER: URL of the veRL server, set to http://127.0.0.1:8765DATASET_TRAIN: Dataset pathSAVE_STEP: Save interval for the policy modelCLIENT_BATCH_SIZE: Client parallelism count; must be divisible by data.train_batch_size (the minimum number of samples required for one update) set on the server sideLaunch on Node 3:
bash run_streaming_ttrl_client.sh
Released under the MIT License.
PhD Student: Weicheng Meng, Yu Cheng, Zhihang Lin
Student Leader: Jingyang Qiao
Professor: Zhizhong Zhang, Xin Tan, Jingyu Gong, Zhaoxia Yin
Projector Leader: Yuan Xie
We also plan to release the following next versions:
High-Efficiency Version
Trust-worthy Version
Python
99.8%