MultiHop-RAG
MultiHopRagBenchmark integrates the official MultiHop-RAG benchmark.
MultiHop-RAG is useful for evaluating questions that require evidence across multiple facts. It can compare vector-only recipes, Heta graph recipes, rewrite recipes, and multihop recipes on complex questions.
Data Layout
MultiHop-RAG is a corpus-level benchmark:
It builds one KB:
Usage
Use local files:
from heta_framework.evaluation import BenchmarkRunner, MultiHopRagBenchmark
benchmark = MultiHopRagBenchmark(
corpus_path="corpus.json",
queries_path="MultiHopRAG.json",
)
result = await BenchmarkRunner().run(
benchmark=benchmark,
recipe=recipe,
knowledge_base_name="multihop_rag_graph_v1",
query_modes=("heta_multihop_search",),
)
Or allow the adapter to download official files:
Downloaded files are stored under BenchmarkWorkspace.cache_dir / "multihop_rag".
Document Mapping
Each article becomes a BenchmarkDocument:
The text includes title, source, published time, URL, and body.
Raw key:
Case Mapping
Each row in MultiHopRAG.json becomes a BenchmarkCase:
case_id = multihop_rag_{index}
query = row["query"]
expected.answers = row["answer"]
labels.question_type = row["question_type"]
Evidence uses raw source_key as the locator so EvidenceRecallAtK can match query result sources.
Default Evaluators
Recommended modes: