Personal agents need to remember what a user said, track how that information changes, and decide how it should affect the current request. EvoMemState stores Persistent Facts in an evolving memory ontology. Retrieval produces a request-specific Relational State, and a policy generates a Reasoning State to guide a frozen response model.
- Ontology-Guided Memory State Induction extracts Persistent Facts from dialogue and organizes them in a personal memory ontology. The ontology maintains validity, scope, source, time, and relations such as
SUPERSEDESandCONFLICTS_WITH. - RL-Based State Evolution retrieves a Relational State containing relevant memories and their relations, then trains a Memory State Evolution Policy to generate a Reasoning State. The policy learns from the change in answer quality when that Reasoning State is supplied to a frozen response model.
- State-Aware Reasoning combines the Relational State and generated Reasoning State to produce the final response.
The figure shows the full method from the manuscript, including policy training. This repository includes inference, GRPO policy training and the slime backend. Training data and model checkpoints are supplied separately.
The complete main table from the EvoMemState manuscript is reproduced below. All values are on a 0–100 scale. Bold and underlined values mark the best and second-best results within each response model, following the manuscript. Higher is better (↑), except for sycophancy rate (↓). Averages are copied directly from the paper.
| Memory system | MemSyco-Bench | MemTrapBench | LoCoMo-Refined | LoCoMo | Overall Avg. ↑ | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| WTU Acc. ↑ | WTU Syco. ↓ | HTU Acc. ↑ | HTU Use ↑ | Avg. ↑ | Safety Score ↑ | CogBias Acc. ↑ | Bound. Acc. ↑ | Trauma Acc. ↑ | Avg. ↑ | Judge Score ↑ | Token F1 ↑ | Judge Score ↑ | Token F1 ↑ | ||
| Response model: Qwen3-8B | |||||||||||||||
| NaiveRAG | 36.3 | 55.3 | 51.6 | 64.0 | 42.4 | 60.2 | 63.9 | 77.0 | 93.4 | 73.6 | 39.0 | 38.4 | 34.4 | 35.8 | 47.4 |
| MemGPT | 29.0 | 66.7 | 54.0 | 67.0 | 39.0 | 62.2 | 66.0 | 64.5 | 52.4 | 61.3 | 45.7 | 40.0 | 36.8 | 37.0 | 45.7 |
| MemoryBank | 37.5 | 57.6 | 54.4 | 67.1 | 44.2 | 64.9 | 63.7 | 72.1 | 82.3 | 70.7 | 44.9 | 44.0 | 39.9 | 41.0 | 49.9 |
| Mem0 | 25.9 | 47.8 | 52.0 | 63.8 | 36.3 | 56.8 | 69.3 | 81.9 | 85.5 | 73.4 | 25.7 | 26.9 | 21.4 | 23.8 | 39.2 |
| A-MEM | 42.8 | 49.1 | 49.2 | 61.2 | 45.4 | 64.2 | 65.0 | 77.6 | 91.8 | 74.6 | 41.8 | 39.1 | 36.4 | 37.1 | 49.6 |
| LightMem | 21.0 | 49.6 | 46.1 | 58.7 | 31.0 | 68.6 | 69.9 | 88.6 | 91.6 | 79.7 | 25.3 | 27.2 | 22.1 | 24.0 | 39.5 |
| Supermemory | 23.3 | 70.5 | 63.7 | 74.2 | 39.5 | 67.5 | 65.4 | 79.6 | 61.7 | 68.6 | 16.6 | 17.5 | 15.7 | 15.8 | 35.1 |
| SimpleMem | 33.4 | 58.6 | 44.1 | 52.6 | 37.7 | 70.9 | 68.3 | 84.6 | 95.8 | 79.9 | 51.3 | 46.6 | 45.3 | 46.4 | 53.6 |
| PGMem | 33.2 | 62.8 | 54.5 | 69.1 | 41.8 | 71.0 | 66.4 | 85.1 | 75.6 | 74.5 | 28.5 | 26.9 | 25.4 | 25.2 | 42.6 |
| EvoMemState (Ours) | 47.7 | 38.0 | 72.4 | 81.3 | 57.6 | 73.8 | 62.3 | 88.8 | 91.4 | 79.1 | 57.4 | 47.3 | 45.5 | 41.6 | 59.9 |
| Response model: GPT-4o-mini | |||||||||||||||
| NaiveRAG | 48.3 | 42.8 | 49.2 | 61.1 | 48.7 | 61.7 | 58.6 | 65.0 | 97.4 | 70.7 | 43.2 | 39.1 | 34.4 | 36.9 | 49.3 |
| MemGPT | 40.8 | 48.0 | 56.2 | 66.0 | 46.9 | 66.4 | 60.7 | 69.9 | 62.3 | 64.8 | 49.1 | 39.5 | 40.2 | 39.1 | 50.3 |
| MemoryBank | 48.9 | 42.2 | 48.3 | 62.3 | 48.7 | 66.4 | 59.8 | 73.4 | 90.5 | 72.5 | 52.8 | 46.6 | 42.7 | 45.3 | 54.2 |
| Mem0 | 32.7 | 38.4 | 50.3 | 63.3 | 39.7 | 56.4 | 61.7 | 74.1 | 93.5 | 71.4 | 28.9 | 27.2 | 21.6 | 25.2 | 40.4 |
| A-MEM | 54.5 | 35.7 | 50.9 | 63.1 | 53.0 | 63.1 | 59.6 | 69.3 | 95.8 | 71.9 | 49.1 | 42.7 | 39.4 | 41.9 | 53.4 |
| LightMem | 25.0 | 42.9 | 46.9 | 60.4 | 33.8 | 70.2 | 63.8 | 80.8 | 95.2 | 77.5 | 24.2 | 26.9 | 21.8 | 25.1 | 39.3 |
| Supermemory | 35.0 | 56.3 | 52.9 | 65.9 | 42.2 | 67.4 | 58.8 | 74.2 | 76.4 | 69.2 | 15.8 | 16.0 | 14.9 | 14.8 | 35.5 |
| SimpleMem | 25.0 | 63.2 | 47.6 | 60.7 | 34.0 | 69.7 | 64.6 | 72.7 | 97.3 | 76.1 | 53.8 | 48.0 | 47.2 | 48.4 | 52.8 |
| PGMem | 39.6 | 54.4 | 53.7 | 66.3 | 45.2 | 73.9 | 60.9 | 81.1 | 83.1 | 74.7 | 19.8 | 18.9 | 16.7 | 17.6 | 39.1 |
| EvoMemState (Ours) | 53.1 | 31.9 | 67.6 | 80.1 | 58.9 | 73.9 | 73.9 | 88.8 | 90.4 | 78.7 | 60.8 | 48.5 | 46.4 | 45.2 | 61.2 |
WTU/HTU: When/How to Use memory. Syco.: sycophancy rate. Use: correct use. CogBias: cognitive bias. Bound.: boundary. The table reports manuscript results; the commands below describe how to run inference.
.
├── README.md
├── .env.example # Endpoint configuration template
├── assets/evomemstate_framework.png # Manuscript framework
├── config/ # Ontology and benchmark configuration
├── evomemstate/
│ ├── builder.py # Memory construction
│ ├── extractor.py # Ontology-guided extraction
│ ├── ontology.py # Persistent ontology and updates
│ ├── retrieval.py # Relational State retrieval
│ ├── reasoning_state.py # Reasoning State inference
│ ├── reasoning_state_reward.py # Frozen-answer improvement reward
│ ├── reasoning_state_policy.py # Policy prompts and training records
│ ├── training_data.py # External manifest conversion
│ ├── slime_step_info.py # Rollout metrics
│ ├── prompting.py # Context for the answer model
│ ├── harness/ # Context pipeline and rules
│ ├── memsyco_adapter.py # MemSyco integration
│ ├── memtrap_adapter.py # MemTrap integration
│ └── run_locomo.py # LoCoMo-Refined inference
├── slime/ # Vendored GRPO training backend
├── scripts/ # Training and benchmark entry points
├── docs/ # Installation and implementation notes
├── tests/ # Offline checks
├── envs/ # Environment definitions
├── pyproject.toml
└── requirements.txt
datasets/ and outputs/ are local runtime directories ignored by Git.
From the repository root, using Python 3.12:
pip install -e .
pip install -r datasets/MemSyco-Bench/requirements.txtPlace MemSyco-Bench at datasets/MemSyco-Bench first. Copy .env.example to .env and fill MEMORY_*, REASONING_STATE_*, GEN_B_*, and JUDGE_* with your model names, endpoints, and keys. Keep credentials in .env.
bash scripts/install_memsyco_adapter.sh
python -m evomemstate.prebuild_graphs --tasks all --limit 3MODE=smoke bash scripts/run_evomemstate_memsyco.shThe runner loads .env, reuses existing graphs, and runs inference and scoring on three examples per task. Results are saved to outputs/evomemstate_memsyco/. Use --limit 0 for full graph construction and MODE=full for full inference.
Requires a Linux CUDA training environment with PyTorch, SGLang, Megatron-LM and compatible fused kernels installed. Install the included backend:
pip install -e ./slimeSupply a policy checkpoint, its converted Megatron torch_dist checkpoint and prepared training JSONL. Set the frozen answer endpoint in your local environment, then train:
export MEGATRON_PATH=/path/to/Megatron-LM
export HF_CHECKPOINT=/path/to/Qwen3-4B-Instruct-2507
export REF_TORCH_DIST=/path/to/Qwen3-4B-Instruct-2507_torch_dist
export PROMPT_DATA=/path/to/reasoning_state_train.jsonl
export ANSWER_MODEL=YOUR_FROZEN_ANSWER_MODEL
export ANSWER_BASE_URL=https://YOUR_PROVIDER/v1
# Set ANSWER_API_KEY locally, or use GEN_B_API_KEY from .env.
bash scripts/run_reasoning_state_rl.shTraining updates only the policy, using the frozen answer score improvement with and without the generated Reasoning State, plus format and answer-leakage penalties. Outputs default to outputs/slime_saved/evomemstate-reasoning-state-qwen3-4b/. No datasets or model weights are bundled. For checkpoint conversion and training input format, see RL setup. After training, export and serve the policy, then point REASONING_STATE_* at its endpoint for inference.
If you use this code, please cite the accompanying EvoTeam paper:
@article{xiang2026evomemstate,
title={EvoMemState: Evolving Memory State for Personal Agents},
author={Xiang, Zhishang and Tang, Yunbo and Liu, Zhongqiao and Chen, Junkai and Chen, Zerui and Hu, Qingguo and Zhang, Yuxuan and Grant, William and Zhang, Qinggang Zhang and Su, Jinsong},
journal={arXiv preprint arXiv:2611.03743},
year={2026}
}
