Skip to content

About

[NeurIPS 2026] MedMemoryBench: Benchmarking Agent Memory in Personalized Healthcare.

Topics

Resources

Stars

85 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

17 Commits

Folders and files

Repository files navigation

MedMemoryBench: Benchmarking Agent Memory in Personalized Healthcare [NIPS'26]

MedMemoryBench overview β€” four key challenges in medical memory evaluation

Solving the issues of agent memory evaluation in healthcare scenarios.

ο½œπŸ€— HuggingFace Dataset | πŸ“„ Arxiv Preprint | 🌐 δΈ­ζ–‡ |

version python license NeurIPS 2026


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.

Table of Contents


πŸ“° News

  • [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.

✨ Features

Comprehensive Medical Dataset

  • 20 longitudinal patient personas with background, life events, and trap events
  • ~2,020 multi-session doctor–patient dialogue sessions
  • ~1,986 evaluation queries across 6 clinically motivated types
  • Bilingual support: Chinese (~598 MB) + English (~443 MB)

Rich Baseline Coverage

  • 3 classic baselines: Long Context, Embedding RAG, BM25 RAG
  • 7 agentic memory systems: Mem0, Letta, MemOS, A-MEM, MIRIX, MemRL, LightMem
  • 4 graph-based systems: GraphRAG, HippoRAG-v2, ReMem, Zep

Unified Evaluation Framework

  • Plug-and-play method integration via BaseAgent
  • Multi-metric evaluation: string match + LLM-as-a-Judge
  • Checkpoint & resume for long-running experiments
  • Dry-run mode for fast pipeline validation

Flexible Configuration

  • YAML-driven method & dataset configs
  • Multi-provider LLM support (OpenAI / BigModel / Azure)
  • Local & remote embedding models
  • Cross-benchmark evaluation (MedMemoryBench + LoCoMo)

Query Types

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

πŸ“¦ Datasets

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 β€”

πŸ“ Project Structure

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)

πŸš€ Quick Start

1. Clone the Repository

git clone https://github.com/AQ-MedAI/MedMemoryBench.git
cd MedMemoryBench

Note: data/ is not tracked by Git. After cloning, follow Datasets to fetch MedMemoryBench, LoCoMo, and AMA-Bench into data/ before running any evaluation.

2. Environment Setup

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.txt
Using conda
conda create -n medmemorybench python=3.10
conda activate medmemorybench
pip install -r requirements.txt

Method-specific dependencies: Some memory methods vendor upstream packages under methods/ (e.g. methods/mem0/, methods/memOS/). If a method has its own requirements.txt or README, 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.

3. Configure Environment Variables

cp .env.example .env

Edit .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_runtime

4. Run Evaluation

Via shell script:

./scripts/run_eval.sh bm25_rag_gpt-5.1 medmemorybench

Via 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-datasets

πŸ”§ Configuration

Method Configuration

Each 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 Configuration

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_dir at 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 in data_file (or the persona_{id}/eval/ tree for MedMemoryBench) needs to match.

πŸ“„ Output

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

πŸ“ Citations

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}
}

πŸ“œ License

  • 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.

About

[NeurIPS 2026] MedMemoryBench: Benchmarking Agent Memory in Personalized Healthcare.

Topics

Resources

Stars

85 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages