Papers › KohakuRAG: A simple RAG framework with hierarchical document indexing

KohakuRAG: A simple RAG framework with hierarchical document indexing

8 Mar 2026arXiv:2603.07612added by Syntology

Shih-Ying Yeh, Yueh-Feng Ku, Ko-Wei Huang, Buu-Khang Tu

Title, abstract, authors and date from arXiv's metadata (CC0); this paper is not in the Papers with Code archive (frozen 2025-07-28).

Retrieval-augmented generation (RAG) systems that answer questions from document collections face compounding difficulties when high-precision citations are required: flat chunking strategies sacrifice document structure, single-query formulations miss relevant passages through vocabulary mismatch, and single-pass inference produces stochastic answers that vary in both content and citation selection. We present KohakuRAG, a hierarchical RAG framework that preserves document structure through a four-level tree representation (document → section → paragraph → sentence) with bottom-up embedding aggregation, improves retrieval coverage through an LLM-powered query planner with cross-query reranking, and stabilizes answers through ensemble inference with abstention-aware voting. We evaluate on the WattBot 2025 Challenge, a benchmark requiring systems to answer technical questions from 32 documents with ±0.1% numeric tolerance and exact source attribution. KohakuRAG achieves first place on both public and private leaderboards (final score 0.861), as the only team to maintain the top position across both evaluation partitions. Ablation studies reveal that prompt ordering (+80% relative), retry mechanisms (+69%), and ensemble voting with blank filtering (+1.2pp) each contribute substantially, while hierarchical dense retrieval alone matches hybrid sparse-dense approaches (BM25 adds only +3.1pp). We release KohakuRAG as open-source software at https://github.com/KohakuBlueleaf/KohakuRAG.

PaperPDFCode Syntology ranMethod as code

In Syntology View this paper on Syntology, its page in Syntology's graph. That page adds which of its functions are also present in other papers' code Syntology holds, with dates, and its dated run record as JSON and a README badge. It also lists the repositories linked to the paper, the abstract and the calls for agents.

Open this paper in Syntology's Atlas, the map of the papers in Syntology's graph and their citations.

For agents, on Syntology's MCP service (how to connect):

Code

Syntology 18 code samples harvested from 1 repository linked to this paper: 15 ran (of which 7 constructed an object rather than computing a result; 9 with no instrument failure: 0 honoured, 1 violated, 8 with no contract checked; 6 where Syntology's instrument failed) · 3 unverified. Where Syntology's instrument failed: 5 where our contract draft was wrong; 1 where the contract check could not run; failures of Syntology's instrument, not of the code.

By repository: found in paper text by Syntology: 18 samples from 1 repository, 15 ran (9 with no instrument failure; 6 where Syntology's instrument failed). The run record, sample by sample. “Ran” means executed on a synthesized input, not that the code is correct or reproduces the paper.

Levels written on 2026-09-22 (UTC): the dates Syntology's graph wrote each sample's verification level, not when the code executed.

KohakuBlueleaf/KohakuRAG found in paper text by SyntologySyntology: 18 samples, 15 ran (6 instrument-failed) · 3 unverified report

Reachability, where shown, is from one Syntology probe window (2026-09-16 to 2026-09-18); repositories not probed show nothing. GitHub stars are not tracked.

Code Syntology ran Syntology

18 samples harvested: 15 ran (of which 7 constructed an object rather than computing a result; 9 with no instrument failure: 0 honoured, 1 violated, 8 with no contract checked; 6 where Syntology's instrument failed) · 3 unverified. “Where Syntology's instrument failed” counts failures of Syntology's instrument, not of the code. Syntology's record for this page last changed ; when this build read Syntology's graph is in the build record. That date is not when the samples ran.

1ran · violated contract
5ran · our draft was wrong
1ran; the contract check could not run
8ran
3unverified

Licence: 18 of the 18 samples are pointer only, meaning Syntology does not serve that copy's text. This page shows no code text for any sample; each one links to its file in the repository.

Harvested from KohakuBlueleaf/KohakuRAG. “Ran” means the sample executed on a synthesized input. It does not mean the output is correct, and nothing here reproduces the paper's results. A line beginning “fixture:” under a sample that ran gives the arguments Syntology's fixture called the sample with, each as name:type/rank/element kind (? where none was recorded), and the type of what the fixture's run returned, exactly as the harness recorded them; the arguments and the returned type were recorded by two separate runs of the same fixture. No output value is shown, and a returned type says nothing about whether the output was right. “Level recorded” gives the UTC date when Syntology's graph wrote the sample's verification level, not when the code executed; where the level was written before Syntology's graph kept that date, the row says “level recorded, date not recorded”. “Honoured” and “violated” refer to a contract Syntology drafted from the code itself. “Our draft was wrong” and “the contract check could not run” are failures of Syntology's instrument, not of the code: the sample ran on Syntology's synthesized input, and then the drafted contract did not describe it, or the check itself raised an error (RAISES), lacked a dependency (DEP_MISSING) or ran out of time (TIMEOUT); hover the label for which. A metamorphic tier, where shown, is evidence of the output's shape, not that the sample implements the method.

Each sample ends with its code_sha256. A sample's code_sha256 is Syntology's identity for that exact code. It is printed in full (16 hexadecimal characters for every sample in this build), and get_code(code_sha256="…") takes it exactly as printed. An agent calls it on Syntology's MCP service (how to connect); click an identity to copy that call.

Repository labels, per sample. official repository: The archive marks this repository official for the paper. named in the paper: The archive records that the paper mentions this repository; it is not marked official. community (archive-listed): In the archive's code links for this paper, not marked official and not recorded as mentioned in the paper. found in paper text by Syntology: Syntology found this repository in the paper's own text; whether it is the authors' implementation is not asserted. community: Not in the archive's code links for this paper; a community repository Syntology harvested. Samples are grouped by repository: a repository marked official first, then by how directly the repository is tied to the paper, then in the archive's order; never by how many ran. Licence labels name the repository's licence as recorded at harvest. “Pointer only” means Syntology does not serve that copy's text, for one of six reasons: no licence file was found; the licence was not identified; the licence is recorded as permissive but that copy's record is not marked cleared; the licence is outside the permissive list Syntology serves text under (MIT, Apache-2.0, BSD and similar); this paper's copy was not located, so its licence is not recorded; or this paper's copy is cleared, but the stored copy of the same code that Syntology serves is not. Some licences outside that list permit redistribution, such as WTFPL, and GPL-3.0 under its conditions; they are simply not on the list. Hover a licence label for the reason. File links open the file on GitHub at the default branch, which may have changed since the harvest.

A function or class name links to its page when the name occurs in the harvested code of at least 5 papers; the name is a string, not an identity. A census tag appears when Syntology's census ran implementations with that name on one shared input per bucket: it gives how many were compared, from how many papers, and how many distinct outputs they produced, and names this sample's bucket when this sample was one of them.

KohakuBlueleaf/KohakuRAG found in paper text by Syntology 18 samples, 15 ran (6 instrument-failed) · 3 unverified
DocumentPayload src/kohakurag/indexer.py ran no licence file found · pointer only · 46e8ab27730924a9 · report fixture: returned DocumentPayload · level recorded 2026-09-22
JinaEmbeddingModel src/kohakurag/indexer.py ran no licence file found · pointer only · 320e151285bf8507 · report fixture: returned JinaEmbeddingModel · level recorded 2026-09-22
ParagraphPayload src/kohakurag/indexer.py ran no licence file found · pointer only · aea7e26e65d857e5 · report fixture: returned ParagraphPayload · level recorded 2026-09-22
SectionPayload src/kohakurag/indexer.py ran no licence file found · pointer only · 6a3228ba6030b84c · report fixture: returned SectionPayload · level recorded 2026-09-22
SentencePayload src/kohakurag/indexer.py ran no licence file found · pointer only · 069158d689ff80d8 · report fixture: returned SentencePayload · level recorded 2026-09-22
StoredNode src/kohakurag/indexer.py ran no licence file found · pointer only · 15c952712553def5 · report fixture: returned StoredNode · level recorded 2026-09-22
TreeNode in 11 papers src/kohakurag/indexer.py ran no licence file found · pointer only · 500778942c83248c · report fixture: returned TreeNode · level recorded 2026-09-22
_detect_device src/kohakurag/indexer.py ran no licence file found · pointer only · e08819c54ed28b5a · report fixture: returned device · level recorded 2026-09-22
_normalize in 10 papers
census: 6 implementations from 6 papers, 3 distinct outputs on one shared input this sample: bucket 1 of 1, arg 1: rank 2, kind float, dtype float32
src/kohakurag/indexer.py ran · violated contract fingerprinted no licence file found · pointer only · 01bc94c373659103 · report fixture: signature vectors:ndarray/2/float · returned ndarray · level recorded 2026-09-22
average_embeddings src/kohakurag/indexer.py ran; the contract check could not run (RAISES) fingerprinted no licence file found · pointer only · 1bb38824b3bd6c48 · report fixture: signature child_vectors:list/1/ndarray · returned ndarray · level recorded 2026-09-22
paragraph_payload_from_text src/kohakurag/indexer.py ran · our draft was wrong no licence file found · pointer only · 0287add59cf39750 · report fixture: signature text:str/0/str · returned ParagraphPayload · level recorded 2026-09-22
sections_from_text src/kohakurag/indexer.py ran · our draft was wrong no licence file found · pointer only · f087c84a8cc6ed08 · report fixture: signature document:DocumentPayload/0/? · returned list · level recorded 2026-09-22
sentence_payloads_from_text src/kohakurag/indexer.py ran · our draft was wrong fingerprinted no licence file found · pointer only · aebc0efc1e03e644 · report fixture: signature text:str/0/str · returned list · level recorded 2026-09-22
split_paragraphs src/kohakurag/indexer.py ran · our draft was wrong fingerprinted no licence file found · pointer only · 80f1ea2827f23418 · report fixture: signature text:str/0/str · returned list · level recorded 2026-09-22
split_sentences in 14 papers src/kohakurag/indexer.py ran · our draft was wrong fingerprinted no licence file found · pointer only · 7d740ec94a7e44e8 · report fixture: signature text:str/0/str · returned list · level recorded 2026-09-22
DocumentIndexer src/kohakurag/indexer.py unverified no licence file found · pointer only · c3d5d1849212a614 · report
EmbeddingModel src/kohakurag/indexer.py unverified no licence file found · pointer only · 1d1accc5bae7d216 · report
NodeKind src/kohakurag/indexer.py unverified no licence file found · pointer only · 1bf84862f6855b5b · report

Method as code Syntology

What Syntology's graph records as this paper's claimed method, lifted into code: each assembly names its bricks (functions and classes), each with its own role and its own verification level. An assembly is not a check that the code implements the method correctly or reproduces the paper's results. Levels are each brick's own verification level in Syntology's graph (level 0: no recorded run), listed brick by brick and never combined into one level; “ran” means the brick executed on a synthesized input, not that its output is correct, and the instrument figure counts failures of Syntology's instrument, not of the code. Where a model read the code against the paper's claim, each assembly's label verdict is one model's judgement, kept in this page's JSON twin; it is not calibrated, so no card prints it.

1 assembly on this paper: 1 harvested, 0 generated.

harvested Assembly for KohakuRAG (graph method: KohakuRAG). 18 bricks; individually on a fixture: 15 ran (of which 7 constructed an object rather than computing a result; 9 with no instrument failure: 0 honoured, 1 violated, 8 with no contract checked; 6 where Syntology's instrument failed) · 3 unverified. The assembly has not been run end-to-end.

  1. DocumentIndexer entry · level 0 · unverified · c3d5d1849212a614
  2. DocumentPayload helper · level 1 · ran · 46e8ab27730924a9
  3. EmbeddingModel helper · level 0 · unverified · 1d1accc5bae7d216
  4. JinaEmbeddingModel model · level 1 · ran · 320e151285bf8507
  5. NodeKind helper · level 0 · unverified · 1bf84862f6855b5b
  6. StoredNode helper · level 1 · ran · 15c952712553def5
  7. TreeNode helper · level 1 · ran · 500778942c83248c
  8. average_embeddings helper · level 1 · ran; the contract check could not run (RAISES) · 1bb38824b3bd6c48
  9. sections_from_text helper · level 1 · ran · our draft was wrong · f087c84a8cc6ed08
  10. sentence_payloads_from_text helper · level 1 · ran · our draft was wrong · aebc0efc1e03e644
  11. SectionPayload helper · level 1 · ran · 6a3228ba6030b84c
  12. _detect_device helper · level 1 · ran · e08819c54ed28b5a
  13. _normalize helper · level 1 · ran · violated contract · 01bc94c373659103
  14. paragraph_payload_from_text helper · level 1 · ran · our draft was wrong · 0287add59cf39750
  15. split_paragraphs helper · level 1 · ran · our draft was wrong · 80f1ea2827f23418
  16. SentencePayload helper · level 1 · ran · 069158d689ff80d8
  17. split_sentences helper · level 1 · ran · our draft was wrong · 7d740ec94a7e44e8
  18. ParagraphPayload helper · level 1 · ran · aea7e26e65d857e5

Each brick ends with its code_sha256, Syntology's identity for that exact code; click one to copy the get_code call that returns it. For agents, on Syntology's MCP service: assembly(arxiv_id="2603.07612") returns these assemblies with each brick's role and wiring (how to connect).

Results from the paper

The Papers with Code archive ends with its 2025-07-28 snapshot. This paper's arXiv identifier, 2603.07612, was issued in March 2026, after that date, so the archive has no leaderboard rows for it.

Report a problem or propose a change · a person checks every report against the paper or source before anything changes; decisions are listed on /corrections