This walkthrough runs a compact teaching implementation of the method on a 12-chunk corpus, so that every step fits on screen. Its parameter values (budget, core size, selection weights, α) are chosen for that corpus and differ from the package defaults. Each step names the package function that does the same job.
The pipeline from the SpectRAG paper, run on a 12-chunk toy corpus. Every number below comes from an actual run of a compact teaching version of the method. Click a step, a chunk, or an edge to see what the method is doing and why.
Dense top-k fills the token budget in similarity order. SpectraFuse fills it with the set-level utility from Eq. 21. Move the sliders to see how each term changes what reaches the generator.
An ablation on this query, computed live in your browser with the same selector, at the default budget of 70 tokens.
The pip package runs the same stages; each step above names the function that does it. Its chunker keeps headings in the chunk text, and its entity rules and default settings differ from the teaching version, so on this toy corpus it picks different chunks. Start from the quick start.
from spectrafuse import SpectRAGIngestion, SpectRAGRetrieval SpectRAGIngestion("my_index").ingest("docs/") # Table 1: chunk, embed, graph, spectral search = SpectRAGRetrieval("my_index") result = search.search(QUESTION, token_budget=4000) # Table 2: seeds, expand, re-score, select print(result["prompt"]) # plug in any LLM for the last stage: a function prompt -> text out = search.answer(QUESTION, llm_fn=my_llm, token_budget=4000) print(out["answer"])