HippoRAG 2: From RAG to Memory


HippoRAG 2 is a memory framework for LLMs that recognizes and uses connections in new knowledge, mirroring a key function of human long-term memory.
Our experiments show that HippoRAG 2 improves associativity (multi-hop retrieval) and sense-making (the process of integrating large and complex contexts) in even the most advanced RAG systems, without sacrificing their performance on simpler tasks.
Like its predecessor, HippoRAG 2 remains cost and latency efficient in online processes, while using significantly fewer resources for offline indexing compared to other graph-based solutions such as GraphRAG, RAPTOR, and LightRAG.
Figure 1: Evaluation of continual learning capabilities across three key dimensions: factual memory (NaturalQuestions, PopQA), sense-making (NarrativeQA), and associativity (MuSiQue, 2Wiki, HotpotQA, and LV-Eval). HippoRAG 2 surpasses other methods across all
categories, bringing it one step closer to true long-term memory.
Figure 2: HippoRAG 2 methodology.
Papers
Installation
Use Conda or uv to create a Python 3.10 environment. A project-local .venv is recommended for development.
conda create -n hipporag python=3.10
conda activate hipporag
pip install hipporag
Set only the environment variables required by the models you use:
export CUDA_VISIBLE_DEVICES=0,1,2,3
export HF_HOME=<path to Huggingface home directory>
export OPENAI_API_KEY=<your openai api key> # if you want to use OpenAI model
conda activate hipporag
For a project-local environment managed by uv:
uv venv --python 3.10 .venv
source .venv/bin/activate
uv pip install -e .
Install optional local-model support only when needed, for example uv pip install -e '.[vllm]' or uv pip install -e '.[gritlm]'.
HippoRAG supports openai>=3.3.1,<4: compatible 3.x client updates are accepted,
while a new major version requires an explicit compatibility review. To reproduce
the minimum supported SDK baseline, apply the optional constraint without changing
the library's public dependency range:
uv pip install -r requirements.txt -c constraints/openai-tested.txt
SDK compatibility should be checked in separate clean environments against both
the minimum baseline above and the newest allowed release. The latter can be
installed and tested with:
uv pip install -r requirements.txt --upgrade-package openai
PYTHONPATH=src python -m unittest tests.test_openai_sdk_compat
Upgrading existing indexes
Version 2.0.0a5 binds persisted vectors and OpenIE state to the endpoint, deployment, model, normalization, and component identity that produced them. Existing indexes without an index_manifest.json, or indexes whose identity no longer matches the active configuration, are rejected rather than mixed silently. Re-index into a fresh save_dir; copying or fabricating only the manifest is not a safe migration. When injecting a custom embedding model, extraction LLM, or text preprocessor, set index_identity to a stable version string so configuration changes cannot reuse incompatible state. The default OpenIE output limits are openie_ner_max_tokens=2048 and openie_triple_max_tokens=4096, sized to leave room for reasoning tokens; they are part of the OpenIE identity, so an index built with the earlier development defaults (512 and 2048) must either be re-indexed or loaded with those values set explicitly.
Quick Start
OpenAI