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.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
|
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
β
βββ 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 (Git LFS)
β βββ MedMemoryBench/ # Chinese, ~598 MB
β βββ MedMemoryBench_EN/ # English, ~443 MB
β βββ locomo/ # LoCoMo, ~18 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)
Note: This repository ships datasets via Git LFS. Please install it before cloning.
# Install Git LFS (skip if already installed)
brew install git-lfs # macOS
sudo apt-get install git-lfs # Ubuntu/Debian
# Windows: https://git-lfs.github.com/
git lfs install
git clone https://github.com/AQ-MedAI/MedMemoryBench.git
cd MedMemoryBenchUsing 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_runtimeTips:
- For BigModel, set
BIGMODEL_API_KEY/BIGMODEL_BASE_URLfirst; the framework maps them to OpenAI-compatible settings internally.LETTA_DIRis recommended to avoid stale SQLite metadata from previous Letta runs.
Via 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 --resumeEach 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/:
# configs/dataset_config/medmemorybench.yaml
dataset_name: "medmemorybench"
description: "Medical dialogue memory evaluation dataset"
language: "zh"
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 typesEvaluation 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:
@article{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},
journal={arXiv preprint arXiv:2605.11814},
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.
