█

AI/TLDR

Buy me a coffee
Buy me a coffee

HippoRAG

Knowledge-graph retrieval with Personalized PageRank, for the questions vector search misses

RAG Frameworks & PlatformsOpen source
Language
Python
License
MIT
$conda create -n hipporag python=3.10
IN SHORT

What is HippoRAG?

HippoRAG is a retrieval framework that treats a document collection as long-term memory rather than a flat pile of chunks. Instead of retrieving by embedding similarity alone, it runs open information extraction over your documents to build a knowledge graph, then retrieves over that graph using Personalized PageRank. It sits in the RAG Frameworks & Platforms category of the Retrieval & Knowledge (RAG) tools and is open-source, written in Python and licensed MIT.

Overview

HippoRAG is a retrieval framework that treats a document collection as long-term memory rather than a flat pile of chunks. Instead of retrieving by embedding similarity alone, it runs open information extraction over your documents to build a knowledge graph, then retrieves over that graph using Personalized PageRank. The project frames this as mirroring how human long-term memory recognises and uses connections between new and existing knowledge.

The team reports that HippoRAG 2 improves associativity — multi-hop retrieval, where the answer requires combining facts from separate documents — and sense-making, meaning the integration of large and complex contexts, without giving up performance on simpler questions. They also position it as cheaper than other graph-based approaches: comparable cost and latency to standard RAG in the online path, with significantly fewer resources needed for offline indexing than GraphRAG, RAPTOR or LightRAG.

It comes out of the OSU NLP Group and is backed by two papers: HippoRAG at NeurIPS 2024 and "From RAG to Memory: Non-Parametric Continual Learning for Large Language Models" at ICML 2025. Despite the research lineage it installs as an ordinary Python package with a small API — construct `HippoRAG`, call `index()` on your documents, call `rag_qa()` with your queries — and it works against OpenAI or any OpenAI-compatible LLM and embedding endpoints, including local servers such as vLLM.

What it does

  • Builds a knowledge graph from your documents via open information extraction, then retrieves over it with Personalized PageRank
  • Targets multi-hop retrieval and sense-making over long, complex contexts rather than single-chunk lookups
  • Cheaper offline indexing than other graph RAG approaches, by the project's own comparison against GraphRAG, RAPTOR and LightRAG
  • Small Python API: index documents and ask questions with `index()` and `rag_qa()`, usable as a context manager
  • Works with OpenAI models or any OpenAI-compatible chat and embedding endpoint, including a local vLLM server
  • Index identity is pinned: persisted vectors and extraction state are bound to the endpoint, model and components that produced them, and mismatched indexes are rejected instead of silently mixed

Getting started

HippoRAG targets Python 3.10. Install the package, set the key for whichever model endpoint you use, then index a few documents and query them.

Create an environment and install

The README uses Conda or uv with Python 3.10. Optional extras add local-model support.

bashbash
conda create -n hipporag python=3.10
conda activate hipporag
pip install hipporag

Or install from source with uv

For development, a project-local virtual environment and an editable install. Add extras such as `[vllm]` or `[gritlm]` only when needed.

bashbash
uv venv --python 3.10 .venv
source .venv/bin/activate
uv pip install -e .

Set your model credentials

Point HippoRAG at OpenAI, or at any OpenAI-compatible endpoint. The GPU variable matters only when you run local models.

bashbash
export OPENAI_API_KEY=<your OpenAI API key>
export CUDA_VISIBLE_DEVICES=0,1,2,3
export HF_HOME=<path to Huggingface home directory>

Index documents and ask a question

`save_dir` is where the graph and vectors persist, so a later run can reuse the index instead of rebuilding it.

pythonpython
from hipporag import HippoRAG

docs = ["George Rankin is a politician."]
queries = ["What is George Rankin's occupation?"]
with HippoRAG(save_dir="outputs", llm_model_name="gpt-4o-mini", embedding_model_name="text-embedding-3-small") as hipporag:
    hipporag.index(docs=docs)
    results = hipporag.rag_qa(queries=queries)

Point it at a local or self-hosted endpoint

Pass explicit base URLs to run the LLM and the embedding model on your own servers. Endpoints must return standard `usage` data — HippoRAG fails closed rather than cache a response whose token cost it cannot account for.

pythonpython
hipporag = HippoRAG(
    save_dir=save_dir,
    llm_model_name="your-llm",
    llm_base_url="http://localhost:8000/v1",
    embedding_model_name="your-embedding-model",
    embedding_provider="openai",
    embedding_base_url="http://localhost:8001/v1",
)

Commands and code are distilled from the project's own documentation — always check the official repo for the latest.

When to use it

  • Reach for it when your questions need facts joined across several documents and plain vector RAG keeps returning one relevant chunk and missing the rest
  • Reach for it for sense-making over a large corpus — narrative or report collections where the answer depends on integrating a lot of context
  • Reach for it when you want graph-based retrieval but found GraphRAG-class indexing too expensive to run repeatedly
  • Reach for it to add a persistent, reusable memory layer to an assistant that keeps accumulating documents over time

How HippoRAG compares

HippoRAG alongside other open-source rag frameworks & platforms tools AI/TLDR tracks, ranked by GitHub stars.

ToolStarsWhat it does
Dify★ 162kAn open-source platform with a visual workflow builder for creating LLM and RAG applications without writing much code.
graphify★ 155kTurns a folder of code, docs, PDFs and images into a local knowledge graph with tree-sitter AST parsing and Leiden communities — queryable by agents over MCP, no vector store.
RAGFlow★ 95kA RAG engine built around deep document understanding that turns complex files into a grounded, citation-backed question-answering layer.
Context7★ 65.7kContext7 pulls current, version-specific documentation and code examples for any library and feeds them into your LLM, available as a CLI skill or an MCP server.
Pathway★ 61.9kA Python framework with a Rust streaming engine that keeps ETL, real-time analytics and RAG pipelines continuously up to date as source data changes.
LightRAG★ 41kA graph-based RAG system that builds an entity-and-relationship knowledge graph for fast retrieval and easy incremental updates.
PageIndex★ 40.8kPageIndex turns long PDFs into a table-of-contents tree and uses LLM reasoning to retrieve relevant sections, with no vector database and no chunking.
HippoRAG★ 4.1kKnowledge-graph retrieval with Personalized PageRank, for the questions vector search misses