Solving the issues of agent memory evaluation in healthcare scenarios.
ο½π€ HuggingFace Dataset ο½ π Arxiv Preprint ο½ π δΈζ ο½
MedMemoryBench is a benchmark framework for evaluating Agent memory methods, with a focus on memory capability assessment in medical dialogue scenarios. This framework provides unified evaluation interfaces, multiple baseline method implementations, and a flexible configuration management system, while also supporting the import and evaluation of other datasets.
- [2026.09] π MedMemoryBench is accepted to NeurIPS 2026!
- [2026.05] MedMemoryBench v1.0 is officially released β dataset, evaluation framework, and 14 memory method baselines.
- [2026.05] Dataset available on HuggingFace.
|
Comprehensive Medical Dataset
|
Rich Baseline Coverage
|
|
Unified Evaluation Framework
|
Flexible Configuration
|
| Type | Count | Description |
|---|---|---|
entity_exact_match |
400 | Exact recall of medical entities |
temporal_localization |
400 | Time-related clinical reasoning |
multiple_choice |
398 | Multi-option medical QA |
inference_generation |
397 | Open-ended clinical inference |
state_update |
200 | Tracking patient state evolution |
multi_hop_clinical_deduction |
191 | Multi-hop clinical deduction |
Every dataset is loaded from a fixed path under data/, declared by the data.root_dir field of its config in configs/dataset_config/. Place each dataset at exactly the path below β the loader resolves data/ relative to the repository root and does not search elsewhere.
| Dataset | Source | Expected local path | Config file | Size |
|---|---|---|---|---|
| MedMemoryBench (zh) | π€ AQ-MedAI/MedMemoryBench | data/MedMemoryBench/ |
medmemorybench.yaml |
~598 MB |
| MedMemoryBench (en) | π€ AQ-MedAI/MedMemoryBench | data/MedMemoryBench_EN/ |
medmemorybench.yaml (root_dir) |
~443 MB |
| LoCoMo | π snap-research/locomo | data/locomo/ |
locomo.yaml |
~18 MB |
| AMA-Bench | π AMA-Bench/AMA-Hub | data/AMA-Hub/ |
ama_bench.yaml |
~48 MB |
| LongMemEval-V2 (optional) | π LongMemEval-V2 | data/longmemeval-v2/ |
longmemeval_v2.yaml |
β |
Click to expand full directory tree
MedMemoryBench/
βββ main.py # Evaluation entry point
βββ requirements.txt # Python dependencies
βββ LICENSE # Apache License 2.0
βββ LEGAL.md # Comment-language legal notice
βββ .env.example # Environment variable template
β
βββ configs/ # Configuration files
β βββ method_config/ # Per-method YAML configs (gpt-5.1 / qwen3 variants)
β β βββ long_context_gpt-5.1.yaml
β β βββ embedding_rag_gpt-5.1.yaml
β β βββ bm25_rag_gpt-5.1.yaml
β β βββ graph_rag_gpt-5.1.yaml
β β βββ mem0_gpt-5.1.yaml
β β βββ memos_gpt-5.1.yaml
β β βββ memrl_gpt-5.1.yaml
β β βββ amem_gpt-5.1.yaml
β β βββ hipporag_gpt-5.1.yaml
β β βββ lightmem_gpt-5.1.yaml
β β βββ letta_gpt-5.1.yaml
β β βββ mirix_gpt-5.1.yaml
β β βββ remem_gpt-5.1.yaml
β β βββ zep_gpt-5.1-chat.yaml
β β βββ ... # + qwen3 variants
β βββ dataset_config/
β βββ medmemorybench.yaml
β βββ locomo.yaml
β βββ ama_bench.yaml
β
βββ methods/ # Memory method implementations
β βββ base.py # BaseAgent abstract class
β βββ long_context.py # Long-context baseline
β βββ embedding_rag.py # Dense embedding RAG
β βββ bm25_rag.py # BM25 sparse RAG
β βββ graph_rag.py # Graph-based RAG
β βββ self_rag.py # Self-RAG
β βββ mem0_agent.py # Mem0 adapter
β βββ memos_agent.py # MemOS adapter
β βββ memrl_agent.py # MemRL adapter
β βββ amem_agent.py # A-MEM adapter
β βββ hipporag_agent.py # HippoRAG adapter
β βββ lightmem_agent.py # LightMem adapter
β βββ letta_agent.py # Letta adapter
β βββ mirix_agent.py # MIRIX adapter
β βββ remem_agent.py # ReMem adapter
β βββ zep_agent.py # Zep Cloud adapter
β βββ <vendored repos> # mem0/, memOS/, MemRL/, amem/, HippoRAG/,
β # LightMem/, letta/, MIRIX/, REMem/, MEM1/,
β # cognee/, memorag/ (third-party sources)
β
βββ benchmarks/ # Dataset evaluation implementations
β βββ base.py # BaseDataset abstract class
β βββ medmemorybench/ # MedMemoryBench dataset
β β βββ dataset.py
β β βββ evaluator.py
β β βββ checkpoint.py
β βββ locomo/ # LoCoMo dataset
β βββ dataset.py
β βββ evaluator.py
β
βββ metrics/ # Evaluation metrics
β βββ base.py # BaseMetric abstract class
β βββ string_match.py # String matching metrics
β βββ llm_judge.py # LLM-as-a-Judge metrics
β βββ locomo_metrics.py # LoCoMo-specific metrics
β
βββ src/ # Core orchestration modules
β βββ config.py # Configuration loader
β βββ agent.py # AgentManager
β βββ evaluator.py # Evaluation dispatcher
β βββ result.py # Result collection & reporting
β
βββ utils/ # Utility modules
β βββ llm_client.py # Unified LLM client
β βββ tokenizer.py # Tokenizer helpers
β βββ templates.py # Prompt templates
β βββ prompts_qa.py # QA prompts
β βββ prompts_judge.py # Judge prompts
β βββ prompts_memorize.py # Memorization prompts
β βββ langchain_callback.py # LangChain callback hooks
β βββ logger.py # Logger
β
βββ docker/ # Optional service compose files
β βββ mirix-init.sql
β βββ mirix-services.yml
β
βββ scripts/ # Helper scripts
β βββ run_eval.sh
β βββ mirix-services.sh
β
βββ data/ # Datasets (not tracked; see "Datasets" section)
β βββ MedMemoryBench/ # MedMemoryBench, Chinese, ~598 MB
β βββ MedMemoryBench_EN/ # MedMemoryBench, English, ~443 MB
β βββ locomo/ # LoCoMo upstream repo, ~18 MB
β βββ AMA-Hub/ # AMA-Bench upstream repo, ~48 MB
β
βββ generation/ # Dataset generation pipeline (sub-project)
βββ outputs/ # Evaluation outputs (gitignored)
βββ exp_results/ # Curated experiment reports
βββ logs/ # Runtime logs (gitignored)
βββ results/ # Method-side caches (gitignored)
git clone https://github.com/AQ-MedAI/MedMemoryBench.git
cd MedMemoryBenchNote:
data/is not tracked by Git. After cloning, follow Datasets to fetch MedMemoryBench, LoCoMo, and AMA-Bench intodata/before running any evaluation.
Using uv (recommended)
curl -LsSf https://astral.sh/uv/install.sh | sh
uv venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
uv pip install -r requirements.txtUsing conda
conda create -n medmemorybench python=3.10
conda activate medmemorybench
pip install -r requirements.txtMethod-specific dependencies: Some memory methods vendor upstream packages under
methods/(e.g.methods/mem0/,methods/memOS/). If a method has its ownrequirements.txtorREADME, follow those instructions to enable it.
Embedding models: Method configs reference local embedding models or API. For the former, please download the embedded model before running.
cp .env.example .envEdit .env and fill in the API keys you intend to use:
# BigModel (OpenAI-compatible, primary endpoint used in this project)
BIGMODEL_API_KEY=your_bigmodel_api_key
BIGMODEL_BASE_URL=https://open.bigmodel.cn/api/paas/v4
# OpenAI (optional)
OPENAI_API_KEY=your_openai_api_key
OPENAI_BASE_URL=https://api.openai.com/v1
# Azure OpenAI (optional)
AZURE_OPENAI_API_KEY=your_azure_key
AZURE_OPENAI_ENDPOINT=https://your-endpoint.openai.azure.com/
# Zep Cloud (optional, only needed for the Zep agent)
ZEP_API_KEY=your_zep_api_key
# Default model selection
DEFAULT_LLM_MODEL=gpt-4o-mini
DEFAULT_EMBEDDING_MODEL=text-embedding-3-small
EMBEDDING_PROVIDER=openai
# Optional: isolate Letta local runtime data (defaults to ~/.letta)
LETTA_DIR=.tmp/letta_runtimeVia shell script:
./scripts/run_eval.sh bm25_rag_gpt-5.1 medmemorybenchVia Python:
# Standard run
python main.py -m bm25_rag_gpt-5.1 -d medmemorybench
# Dry run (no real LLM/API calls)
python main.py -m embedding_rag_gpt-5.1 -d medmemorybench --dry-run
# Resume from checkpoint
python main.py -m embedding_rag_gpt-5.1 -d medmemorybench --resume
# List available methods / datasets
python main.py --list-methods
python main.py --list-datasetsEach method is driven by a YAML file under configs/method_config/:
# configs/method_config/embedding_rag_gpt-5.1.yaml
method_name: "embedding_rag"
method_type: "rag" # baseline / rag / agentic_memory
description: "Embedding RAG Agent - Dense vector retrieval based RAG method"
model:
provider: "openai"
name: "gpt-5.1"
temperature: 0.3
max_completion_tokens: 100000
agent_params:
top_k: 5 # Number of documents to retrieve
chunk_size: 512 # Text chunk size
chunk_overlap: 50 # Chunk overlap
embedding:
provider: "local" # openai / local / huggingface
model: "/path/to/local/model"Dataset configs live under configs/dataset_config/. Each one pins the dataset to a fixed location under data/ via root_dir (see Datasets):
# configs/dataset_config/medmemorybench.yaml
dataset_name: "medmemorybench"
description: "Medical dialogue memory evaluation dataset"
language: "zh" # metadata only; switch datasets via root_dir, not this field
data:
root_dir: "data/MedMemoryBench"
sessions_pattern: "persona_{id}/eval/generated_dialogues.json"
queries_pattern: "persona_{id}/eval/generated_queries.json"
evaluation:
mode: "independent" # independent / merged
evaluation_interval: 10 # Evaluate every N sessions
query_types:
- name: "entity_exact_match"
metric: "string_contain"
- name: "temporal_localization"
metric: "llm_judge"
# ... more types# configs/dataset_config/locomo.yaml # configs/dataset_config/ama_bench.yaml
data: data:
root_dir: "data/locomo/data" root_dir: "data/AMA-Hub/dataset/test"
data_file: "locomo10.json" data_file: "open_end_qa_set.jsonl"Point
root_dirat a different location if you store the datasets elsewhere on disk, e.g. on a large data volume. Only the directory holding the file named indata_file(or thepersona_{id}/eval/tree for MedMemoryBench) needs to match.
Evaluation results are saved under outputs/<method>_<model>/:
outputs/
βββ bm25_rag_gpt-5.1/
βββ eval_medmemorybench_20260330_181703.json # Detailed results (JSON)
βββ report_medmemorybench_20260330_181703.txt # Human-readable report
βββ memory_builds_20260330_181703.json # Memory build logs
If you find MedMemoryBench useful in your research, please consider citing our work:
@inproceedings{wang2026medmemorybench,
title={MedMemoryBench: Benchmarking Agent Memory in Personalized Healthcare},
author={Yihao Wang and Haoran Xu and Renjie Gu and Yixuan Ye and Xinyi Chen and Xinyu Mu and Yuan Gao and Chunxiao Guo and Peng Wei and Jinjie Gu and Huan Li and Ke Chen and Lidan Shou},
booktitle={Advances in Neural Information Processing Systems (NeurIPS)},
year={2026}
}- Code β Apache License 2.0
- Dataset (
data/MedMemoryBench/,data/MedMemoryBench_EN/) β CC BY 4.0 - Vendored third-party sources under
methods/retain their original upstream licenses. - See LEGAL.md for the source-comment language clause.
