Retrieval-Augmented Generation (RAG) has become the standard approach for grounding LLM outputs in external knowledge. But standard RAG has a fundamental limitation: it treats each query independently, with no memory of past retrievals or ability to connect information across documents. HippoRAG takes inspiration from the human brain’s hippocampus to overcome this, creating a long-term memory system that dramatically improves multi-hop question answering.
Published at NeurIPS 2024 and available at github.com/OSU-NLP-Group/HippoRAG, HippoRAG combines LLMs with knowledge graphs in a framework modeled on the hippocampal indexing theory of human memory. The result is a RAG system that builds a persistent knowledge structure from documents, enabling it to answer complex questions that require connecting information across multiple sources – achieving approximately 20% improvement over standard RAG on multi-hop QA benchmarks.
The project was developed by researchers at Ohio State University’s NLP Group and has rapidly gained attention in both academic and industrial circles. HippoRAG 2, the latest version, introduced further improvements in retrieval accuracy and computational efficiency. The framework is model-agnostic and can be applied to any document collection.
What is HippoRAG?
HippoRAG is a neurobiologically inspired RAG framework that creates a long-term memory for LLMs by combining knowledge graphs with retrieval-augmented generation. It is modeled on the hippocampal indexing theory, where the hippocampus creates and stores index pointers to information distributed across the neocortex. HippoRAG achieves state-of-the-art performance on multi-hop question answering benchmarks.
How does HippoRAG work?
HippoRAG operates in two phases: the offline indexing phase and the online retrieval phase.
| Phase | Component | What Happens | Analogy |
|---|---|---|---|
| Offline indexing | LLM-based extraction | Extract open knowledge graph triplets from documents | Hippocampus encoding |
| Offline indexing | Named entity recognition | Identify entities and link them across documents | Pattern separation |
| Offline indexing | Graph construction | Build a unified knowledge graph connecting all documents | Cognitive map formation |
| Online retrieval | Query encoding | Encode question into graph-level query | Hippocampal recall |
| Online retrieval | Graph traversal | Follow entity and relationship paths to find answers | Pattern completion |
| Online retrieval | Context assembly | Gather relevant passages for LLM context | Episodic memory retrieval |
This two-phase approach means that once the knowledge graph is built, retrieval is significantly more efficient than re-embedding and searching over all documents for each query.
What improvements does HippoRAG 2 bring?
HippoRAG 2 addresses several limitations of the original and introduces new capabilities.
| Feature | HippoRAG 1 | HippoRAG 2 |
|---|---|---|
| Graph construction | Single-pass LLM extraction | Iterative refinement with verification |
| Entity linking | Exact string matching | Semantic + fuzzy matching |
| Retrieval scope | Top-k passages | Adaptive retrieval depth |
| Computational cost | High indexing cost | 40% lower indexing cost |
| Multi-hop accuracy (2WikiMultihop) | 51.3% | 59.8% |
| Multi-hop accuracy (HotpotQA) | 58.2% | 65.1% |
| Single-hop accuracy (Natural Questions) | 44.7% | 51.4% |
The improvements in HippoRAG 2 make it practical for larger document collections and higher-throughput applications.
How do you install and use HippoRAG?
HippoRAG is available as a Python package with a straightforward API:
# Install
pip install hipporag
# Basic usage
from hipporag import HippoRAG
# Index documents
rag = HippoRAG()
rag.index(documents)
# Query
answer = rag.query("What is the relationship between protein X and disease Y?")
print(answer)
The library integrates with common document loaders and embedding models, and supports both OpenAI and open-source embedding backends.
How should HippoRAG be cited?
If you use HippoRAG in academic work, please cite the NeurIPS 2024 paper:
@inproceedings{hipporag2024,
title={HippoRAG: Neurobiologically Inspired Long-Term Memory for Large Language Models},
author={Gutierrez, Bernal Jimenez and others},
booktitle={NeurIPS},
year={2024}
}
Frequently Asked Questions
What is HippoRAG?
HippoRAG is a neurobiologically inspired RAG framework that creates a long-term memory for LLMs using knowledge graphs. It achieves approximately 20% better accuracy on multi-hop QA compared to standard RAG and was published at NeurIPS 2024.
How does HippoRAG work?
HippoRAG has two phases: offline indexing (extracting knowledge graph triplets from documents, linking entities, and building the graph) and online retrieval (encoding the query, traversing the graph, and assembling relevant passages for the LLM). This mirrors the hippocampal indexing theory of human memory.
What improvements does HippoRAG 2 offer?
HippoRAG 2 introduces iterative graph refinement, semantic entity matching, adaptive retrieval depth, and 40% lower computational cost. Accuracy improves from 51.3% to 59.8% on 2WikiMultihop and from 58.2% to 65.1% on HotpotQA.
How do I install HippoRAG?
Install via pip install hipporag. The library supports OpenAI embeddings and open-source embedding models, with integrations for common document loaders.
How should HippoRAG be cited?
Cite the NeurIPS 2024 paper by Gutierrez et al. The BibTeX entry is available in the GitHub repository’s README.
Further Reading
- HippoRAG GitHub Repository
- HippoRAG: Neurobiologically Inspired Long-Term Memory for LLMs (NeurIPS 2024)
- HippoRAG 2: Better Retrieval with Iterative Refinement
- Hippocampal Indexing Theory of Memory
- Retrieval-Augmented Generation: A Survey
flowchart TB
subgraph Offline Indexing
A[Document Collection] --> B[LLM Extraction]
B --> C[Knowledge Triplets]
C --> D[Entity Linking]
D --> E[Knowledge Graph]
end
subgraph Online Retrieval
F[User Query] --> G[Query Encoding]
G --> H[Graph Traversal]
H --> I[Context Assembly]
I --> J[LLM Answer]
end
E --> Hgraph TD
subgraph Comparison
A[Standard RAG] --> B[Embed Each Query]
B --> C[Vector Similarity Search]
C --> D[Top-K Passages]
D --> E[Answer Generation]
F[HippoRAG] --> G[Build Knowledge Graph]
G --> H[Encode Query as Graph Traversal]
H --> I[Multi-Step Path Finding]
I --> J[Assemble Connected Passages]
J --> K[Answer Generation]
end
subgraph Accuracy
L["Standard RAG: 42.1% (2WikiMultihop)"]
M["HippoRAG 1: 51.3%"]
N["HippoRAG 2: 59.8%"]
end
無程式碼也能輕鬆打造專業LINE官方帳號!一鍵導入模板,讓AI助你行銷加分!