cookbook.corpora¶
cookbook.corpora
¶
Loaders for the four cookbook corpora.
Every recipe pulls its documents through one of the loaders here. The actual
files live under corpus/ and are downloaded reproducibly by
scripts/fetch_corpus.py. The loaders return iterables of Document dicts
with the schema below so every vector-store backend, chunker, and evaluator
speaks the same language.
Schema
{ "doc_id": str, # unique within the corpus "source": str, # human-readable origin "text": str, # plain text content "metadata": dict, # arbitrary; commonly {section, page, url} }
Document
dataclass
¶
load_arxiv_mamba()
¶
A recent arXiv survey of state-space sequence models.
Returns one Document per page. Used by recipes that want a dense, technical long document to chunk and reason over.
Source code in cookbook/corpora.py
load_wikipedia_superconductors()
¶
About 50 markdown pages on superconductivity from Wikipedia.
One Document per markdown file. Good for graph-RAG and multi-hop queries.
Source code in cookbook/corpora.py
load_sec_10k()
¶
Palantir Technologies 2024 SEC 10-K, plain text extract.
Yields one Document per section heading. Good for hybrid search and sub-question decomposition (the document is full of numbered items and tables).
Source code in cookbook/corpora.py
load_rust_book()
¶
A curated subset of The Rust Programming Language (CC-BY).
One Document per chapter, with the chapter heading in metadata. Good for code-aware chunking and step-back reasoning.
Source code in cookbook/corpora.py
load_eval_questions()
¶
The ~80-pair hand-curated evaluation set used by recipes 37–40.