HippoRAG is an open-source retrieval and long-term memory framework developed by the Ohio State University NLP Group. Inspired by the hippocampal indexing theory of human memory, HippoRAG enables Large Language Models (LLMs) to perform complex, multi-hop associative recall across knowledge corpora in a single retrieval step using knowledge graphs and Personalized PageRank (PPR).
graph TD
Corpus[Unstructured Document Corpus / Memories] --> OpenIE[Open Information Extraction via LLM]
OpenIE --> KG[Hippocampal Knowledge Graph<br/>Entity Nodes & Relationship Triples]
Query[Multi-Hop User Query] --> QueryNER[Query Named Entity Recognition]
QueryNER --> SeedNodes[Graph Seed Nodes]
SeedNodes --> PPR[Personalized PageRank Algorithm]
PPR --> TopPassages[Ranked Associative Passages]
TopPassages --> LLM[LLM Response Generation]
Traditional RAG systems mimic the neocortex by relying on dense vector embeddings for semantic similarity, which struggle with multi-hop associative reasoning without slow, iterative multi-turn retrieval loops.
HippoRAG models human brain architecture:
pip install hipporag), and fully runnable on local hardware using local LLMs (e.g., via vLLM or Ollama).from hipporag import HippoRAG
# 1. Initialize HippoRAG instance
hipporag = HippoRAG(
llm_model="meta-llama/Llama-3.3-70B-Instruct",
embedding_model="nvidia/NV-Embed-v2"
)
# 2. Index corpus of documents or agent memories
documents = [
"Alice founded Quantum Dynamics in 2022 in Geneva.",
"Quantum Dynamics specializes in topological quantum computing chips.",
"The Swiss National Science Foundation awarded Geneva-based quantum startups 10M CHF."
]
hipporag.index(documents)
# 3. Perform associative multi-hop retrieval
query = "What funding did Alice's research domain receive in Switzerland?"
results = hipporag.retrieve(query, top_k=2)
for doc in results:
print("Retrieved context:", doc)