โš™ Configuration

Status: reference.

Written for anyone setting this pipeline up on their own machine. Assumed: CLI.md for the commands these settings change. Not covered here: what each setting costs, which is measured in PERFORMANCE.md, and why the defaults are what they are, which is DESIGN.md's job.

Every setting, what values it accepts, and what it defaults to.

๐Ÿ“ฅ How configuration is loaded

config.toml is not in the repository. chitragupta init writes it for an installed project; in a git checkout you create it, once:

cp config.toml.example config.toml

chitragupta/core/config.py reads it at import time and fails with that exact command if it is missing, instead of silently falling back to the example: a machine running settings its owner never chose is a worse failure than one that refuses to start.

config.toml.example is the tracked template, with longer commentary; this page is the authoritative list of accepted values.

๐Ÿ“ A minimal config.toml

The smallest valid file is an empty file: the whole pipeline runs on defaults, expecting your bibliography at papers/bibliography.bib. A realistic small config opts into the higher-fidelity parser and some parallelism:

[bib]
path = "papers/bibliography.bib"

[parser]
backend = "docling"   # "pdftotext" (default) or "docling"
workers = "auto"      # as many as this machine can sustain

๐Ÿ“‹ Every setting

Paths resolve relative to the project directory (the one holding config.toml); an absolute path is used as given.

๐Ÿ“ Paths

Key Env var Accepts Default
[bib] path BIB_FILE path papers/bibliography.bib
[content] dir CONTENT_DIR path content

The enrichment layer's artefacts (content/docling/, content/chroma/, content/topics.json) and every DOCLING_* environment variable keep those names and are not derived from the [enrich] table's name: renaming them would invalidate work already on disk.

There is no key for "extra PDFs to enrich": the enrichment layer indexes the bibliography and nothing else, so everything it can retrieve is something a draft may cite. To add a paper, catalogue it in your reference manager, re-export, and re-run sync; see ZOTERO.md.

๐Ÿ“ [render] -- citation style

Used only by chitragupta/core/draft/render_output/, never by sync or the citation gate.

Key Env var Accepts Default
csl CSL_STYLE path assets/csl/ieee.csl
collapse_citations RENDER_COLLAPSE_CITATIONS boolean true

๐Ÿท [style] -- prose conformance and the acronym vocabulary

vale_config and language are used only by python -m chitragupta.draft style, a review aid that exits 0 whatever it finds. acronyms is also read by the genre-writing skills (docs/GENRE.md) and by [retrieval].acronym_expansion.

Key Env var Accepts Default
vale_config VALE_CONFIG path assets/vale/vale.ini
language STYLE_LANGUAGE BCP-47 tag unset
acronyms ACRONYMS path assets/style/acronyms.toml

๐Ÿ“„ [parser] -- PDF text extraction

Key Env var Accepts Default
backend PARSER "pdftotext" | "docling" "pdftotext"
ocr PARSER_OCR boolean false
formulas PARSER_FORMULAS boolean false
workers PARSER_WORKERS positive integer, or "auto" 1
start_method PARSER_START_METHOD "auto" | "forkserver" | "spawn" "auto"
document_timeout PARSER_DOCUMENT_TIMEOUT positive number of seconds, or "off" "off"
stall_timeout PARSER_STALL_TIMEOUT positive number of seconds, or "off" 1800
long_word_chars PARSE_LONG_WORD_CHARS number, used as an integer 20
long_word_ratio PARSE_LONG_WORD_RATIO number, a fraction 0.0-1.0 0.01
min_tokens PARSE_MIN_TOKENS number, used as an integer 200

The values in full:

๐Ÿชต [logging] -- the pipeline log file

Key Env var Accepts Default
level LOGGING_LEVEL "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL" "INFO"

The log directory, logs/ beside the repo root, has no config.toml key but honours a LOGS_DIR environment variable.

๐Ÿ“– [provenance] -- citation-support bands

Key Env var Accepts Default
weak_score PROVENANCE_WEAK_SCORE number, a fraction 0.0-1.0 0.20
good_score PROVENANCE_GOOD_SCORE number, a fraction 0.0-1.0 0.50

chitragupta/core/review/citation_provenance.py bands the share of a citing sentence's distinctive words found in the best-matching source passage. Below weak_score a finding reads "no support found", which means go look at this one first, never "this citation is wrong". At or above good_score it is banded "supported". The defaults are round on purpose: the report sets a reading order for a human, not a pass/fail line. Neither is range-checked, and nothing enforces weak_score < good_score.

๐Ÿ”Ž [retrieval] -- BM25's field weights, cap and floor

Tier 1: stdlib only, no venv and no model, which is why these are not [enrich] keys.

Key Env var Accepts Default
weight_title RETRIEVAL_WEIGHT_TITLE number, finite and at least 0 1.0
weight_abstract RETRIEVAL_WEIGHT_ABSTRACT number, finite and at least 0 1.0
k1 RETRIEVAL_K1 number, finite and at least 0 1.5
b RETRIEVAL_B number between 0 and 1 0.75
acronym_expansion RETRIEVAL_ACRONYM_EXPANSION boolean true
spelling_correction RETRIEVAL_SPELLING_CORRECTION boolean false
max_passages_per_source MAX_PASSAGES_PER_SOURCE positive integer 3
min_passage_tokens MIN_PASSAGE_TOKENS positive integer 20

RETRIEVAL.md has the sweeps behind every default, including k1 and b, and the passage unit.

There is deliberately no over-fetch multiplier here, unlike [enrich].embed_overfetch_multiplier: BM25 scores every passage in memory, so the cap already walks the fully ranked list.

๐Ÿง  [enrich] -- the optional enrichment layer

Used only by chitragupta/core/corpus/enrich/* (the enrich dependency group), never by sync or the citation gate.

Key Env var Accepts Default in code In config.toml.example
embedding_model EMBEDDING_MODEL a sentence-transformers model id sentence-transformers/all-MiniLM-L6-v2 sentence-transformers/all-mpnet-base-v2
embed_top_k EMBED_TOP_K integer >= 1 5 5
embed_max_passages_per_source EMBED_MAX_PASSAGES_PER_SOURCE integer >= 1 3 3
embed_overfetch_multiplier EMBED_OVERFETCH_MULTIPLIER integer >= 1 4 4
rerank RERANK boolean false false
rerank_model RERANK_MODEL a sentence-transformers cross-encoder id cross-encoder/ms-marco-MiniLM-L6-v2 cross-encoder/ms-marco-MiniLM-L6-v2
entailment_model ENTAILMENT_MODEL a sentence_transformers.CrossEncoder model id cross-encoder/nli-deberta-v3-small cross-encoder/nli-deberta-v3-base
support_premise_topk SUPPORT_PREMISE_TOPK integer >= 1, or "off" off (uncapped) off (uncapped)
docling_images DOCLING_IMAGES boolean false false
docling_image_scale DOCLING_IMAGE_SCALE number 2.0 2.0
docling_formulas DOCLING_FORMULAS boolean false false
keywords_path KEYWORDS_PATH a path, resolved under content/ unless absolute keywords.toml keywords.toml
keyword_top_n KEYWORD_TOP_N integer 40 40
keyword_min_df KEYWORD_MIN_DF integer 2 2
seed_topic_max_papers SEED_TOPIC_MAX_PAPERS integer 25 25
seed_topic_min_similarity SEED_TOPIC_MIN_SIMILARITY number, cosine similarity 0.15 0.15
topic_distribution TOPIC_DISTRIBUTION boolean true true
topic_converge_similarity TOPIC_CONVERGE_SIMILARITY number, cosine similarity 0.45 0.45
topic_exclude_author_names TOPIC_EXCLUDE_AUTHOR_NAMES boolean true true
topic_graph_neighbors TOPIC_GRAPH_NEIGHBORS integer 5 5
topic_graph_p_value TOPIC_GRAPH_P_VALUE number, significance level 0.01 0.01
topic_min_cluster_size TOPIC_MIN_CLUSTER_SIZE integer 3 3
topic_min_samples TOPIC_MIN_SAMPLES integer 2 2
topic_neighbors TOPIC_NEIGHBORS integer 5 5
topic_membership_ratio TOPIC_MEMBERSHIP_RATIO number, 0-1 0.5 0.5
topic_membership_max TOPIC_MEMBERSHIP_MAX integer 8 8

The two embedding_model and entailment_model columns differ on purpose. The code's fallback is the smaller, faster model, which is what you get if the key is absent; the shipped example sets the larger, more accurate one, so anyone who copied config.toml.example runs that. Check your own file. See Choosing an embedding model and Choosing an entailment model.

docling_formulas is not the only formula switch, and probably not the one you want first. It configures the enrichment parse, which writes content/docling/. The corpus parse, the one chitragupta/core/draft/retrieval.py indexes and a drafting skill reads, has its own [parser].formulas.

keywords_path names a generated artefact, not a file you write. The extract-keywords stage regenerates it on every run from the papers' own Keywords:/Index Terms lines, so a hand-edit is overwritten. Promote a phrase worth keeping into content/seed_topics.toml (Seed topics).

embed_top_k, embed_max_passages_per_source and embed_overfetch_multiplier are the stages of chitragupta.core.corpus.enrich.embed_index.search(), in order:

over-fetch (k x multiplier)  ->  [rerank]  ->  cap per citekey  ->  keep k

CORPUS-SEARCH.md draws that and explains the order.

All three are validated at load: a value below 1 raises, because embed_top_k = 0 would otherwise read like an empty corpus.

rerank turns on a cross-encoder that reorders the over-fetched passages before the cap. Off by default because it leaves recall@5 and diversity unchanged at 2.5x a search call's cost on a GPU (5.75x on a CPU); recall@3 rises from 129 to 139 of 256, so turn it on if you read only the top three hits. It rebuilds nothing. It also gates python -m chitragupta.corpus discover's precision tier: off, that tier is skipped and the model is never loaded; on, but with a model that will not load, the fused order stands with a note.

rerank_model names that cross-encoder, and is read only when rerank is on. The bge-* / e5-* prefix warning under the embedding model does not apply here, because a reranker scores both texts jointly. CORPUS-SEARCH.md has the measured candidates and the rejected ones.

support_premise_topk caps how many premises review support scores per citation. Uncapped, the entailment model sees one pair per quotable passage, 725-887 pairs per citation, which is what a review pass costs (PERFORMANCE.md). A number pre-ranks premises by the lexical overlap [provenance] bands and sends only the top k, 5.3x to 102x fewer pairs. It is off because it was measured and damages the report: over two real drafts the pre-ranker agreed with the entailment model on the supporting passage for only 56.5% of citations at k = 128 (14.6% at k = 8), and claims scoring 0.995 uncapped came back at 0.138, the draft's worst finding (bench/RESULTS.md, 2026-09-09). There is no recommended value; bench/bench_support_topk.py compares a capped run with the uncapped one on your drafts, which is not the same as being right (issue #757).

๐Ÿงญ [discover] -- from a phrase to a topic

Read by python -m chitragupta.corpus discover's resolution ladder.

Key Env var Accepts Default in code In config.toml.example
min_similarity DISCOVER_MIN_SIMILARITY number, cosine similarity 0.35 0.35

How close the best topic centroid must sit to a free phrase before the hybrid rung claims the phrase for that topic instead of falling back to paper search. It gates only the semantic evidence: a BM25 hit on the topic's own vocabulary claims the phrase regardless, and without the enrich group the floor has no effect. 0.35 is a starting point, not a measurement; TOPIC-DISCOVERY.md has the ladder and the gold set meant to tune it.

๐Ÿ–ฅ [webapp] -- what the webapp shows

Read by chitragupta webapp and nothing else: the parse, the ledger and retrieval never see it.

Key Env var Accepts Default
min_passage_chars WEBAPP_MIN_PASSAGE_CHARS whole number >= 0 60

The Paper pane hides a passage shorter than this many characters: in a Docling parse that is mostly author lists, affiliations and page furniture such as a "Check for updates" badge. Headings are never hidden, however short. The pane says how many passages it hid and has a control to show them all, and a search match inside a hidden passage still counts and shows that passage. 0 shows every passage. The value reaches the page through /api/status, so the page never guesses it.

๐Ÿ”ค How values are parsed

Booleans from the environment. In TOML, write true / false. From an environment variable, 1, true, yes and on mean true, and 0, false, no, off and an empty value mean false (case-insensitive). Any other word raises, naming the setting, so PARSER_OCR=ture is reported rather than read as false. The words are parsed, not cast, because bool("false") is True in Python.

A wrong TOML type raises, once a value is present. A missing key takes its default, but ocr = "true" (a string), path = 123, or timeout = "9.5" and timeout = true raise, naming the key, the environment variable and what was expected. Quote strings; don't quote booleans or plain numbers.

Whole-number settings reject a fractional value but tolerate a quoted whole number. topic_min_cluster_size = 3.9 raises instead of truncating; topic_min_cluster_size = "3" works, the same as workers and the three search-sizing settings.

๐Ÿ—’ Notes on individual settings

โš– backend: pdftotext or docling

Backend Dependency Page boundaries? Quotable passages? Speed
pdftotext (default) poppler-utils on PATH Yes: form feeds between pages No: reading order is lost Fastest
docling docling, enrich group Yes: form feeds between pages Yes: writes a passage sidecar ~42x slower; see PERFORMANCE.md

Both keep page boundaries, which chitragupta/core/review/verbatim_check/ splits on to report a verbatim run's page. What separates them is quoting: pdftotext -layout loses reading order, so an excerpt can splice two columns and the passage ladder refuses to quote from it. docling keeps reading order in content/parsed/<citekey>.passages.json, so this setting alone buys quotable passages (CITATION-PROVENANCE.md, LADDERS.md); PDF-PARSER.md has the full comparison.

backend = "docling" does not fold docling into the enrichment layer. The corpus layer (chitragupta/core/corpus/pdf_text/, on sync) writes content/parsed/ for BM25; the opt-in chitragupta/core/corpus/enrich/docling_parse.py writes structured Markdown into content/docling/, always with docling, over the same ledger documents. With this setting on docling, the enrichment stage adopts the corpus layer's output, a file copy in place of 6.65s per document, and parses for real only when the corpus layer wrote no text, when [enrich].docling_images is on, or when the PDF is newer than the artefacts.

๐Ÿ‘ท workers, and how it is clamped

The resolved count is the smallest of what you asked for, what the machine can sustain, and how many documents need parsing, never below 1. "What the machine can sustain" counts the CPUs this process may run on, and for docling divides it by 4:

CPUs available to the process 4 8 16 48
workers = "auto" resolves to 1 2 4 12

That divisor of 4 is measurably too conservative: 32 workers run 1.41x faster than the 12 it allows on 48 CPUs, and 48 are no worse. The data supports "much smaller than 4", not a specific value, so it has not been changed; see PERFORMANCE.md.

Asking for more than the machine allows is clamped and said out loud on stderr, never silently obeyed or ignored. docling's internal thread count is divided down to match. The clamp cannot see a cgroup CPU quota (docker --cpus=2) or RAM; set an explicit number for either.

docling gets processes and pdftotext threads. Ledger writes stay on the main process, and results print in bibliography order.

๐Ÿ–ฅ Using more than one GPU

There is nothing to configure. With docling and more than one worker, each worker claims one CUDA device round-robin; without this, docling's AcceleratorDevice.AUTO would put every worker on cuda:0. Restrict the cards with CUDA_VISIBLE_DEVICES. Figures in PERFORMANCE.md.

A card with under 2.5 GiB free is skipped (a worker's ~1.7 GiB of models plus its CUDA context), and the run says so on stderr:

  WARNING skipping cuda:0 (0.6 GiB free) -- under 2.5 GiB free, which is
  not enough for a docling worker. Parsing on cuda:1,2,3.

Without the check, workers that cannot get device memory fail documents in seconds and so take most of the corpus. If every card is busy the run parses on the CPU, as does a worker that runs out of device memory mid-run.

๐Ÿšซ Why fork is not an option

By the time the pool is built the process holds two live sqlite connections (the run lock and the ledger), and SQLite's documentation says not to carry an open connection across fork(). forkserver starts its server as a fresh interpreter and measured no slower than fork, so nothing is given up.

Both available start methods re-import the calling program's __main__ in each worker, so a script of your own driving sync or parse_corpus must guard its top level with if __name__ == "__main__":.

โฑ The two timeouts are not the same guard

Either way a timed-out document is reported as a failure, never silently truncated. Choosing a safe value means knowing your slowest legitimate document; see PERFORMANCE.md.

โš  The parse-quality guard

sync warns when an implausible share of a freshly extracted document's words are unusually long, the signature of a backend that lost the spaces between words. chitragupta/core/draft/retrieval.py tokenises on runs of [a-z0-9], so two run-together words become one token that matches neither. long_word_chars, long_word_ratio and min_tokens are its thresholds. It is a warning, never a failure, and it will not catch a bad ocr choice: it finds run-together words, not content that never arrived.

๐Ÿงฎ formulas, and why it is not the [enrich] key

Docling drops an equation's content unless its formula-recognition model runs, leaving the literal <!-- formula-not-decoded --> where the mathematics was:

โ€ฆwe define the Network Overhead (NO) metric asโ€ฆ More formally:

<!-- formula-not-decoded -->

We clarify that the NO(tk) metric above quantifiesโ€ฆ

On a 497-document corpus with this key off, 148 documents carried the marker. chitragupta/core/draft/retrieval.py indexes content/parsed/*.txt and nothing else (RETRIEVAL.md), so with this off an equation is absent from the only artefact a drafting skill reads. On, it is LaTeX, which the index already handles.

Why this is not [enrich].docling_formulas. The two keys set the same docling option on two different parses: this one writes content/parsed/, the [enrich] one content/docling/. They are deliberately separate: the corpus parse matters to someone who never installs the enrichment group, and chitragupta/core/corpus/pdf_text/ reading an [enrich] setting would cross the layer boundary ARCHITECTURE.md draws. Set both for decoded formulae in both places.

Off by default for the same economics as ocr: an extra model download and an extra pass per page. Run python -m chitragupta.corpus sync --reparse after changing it.

On a GPU host it can fail silently without python3-dev and gcc (installed by the os-deps stage): every formula comes out as the marker on a run that reported success. PDF-PARSER.md has the diagnosis and the recovery for both keys, which differ.

๐Ÿ–ผ docling_images

Extracts figure bitmaps into content/docling/<doc>_artifacts/, plus a <doc>.figures.json giving each figure's page, caption, bounding box and the exact string to cite it by. The box is in page points, exact and independent of the render scale; a crop's pixel size is that box times docling_image_scale.

It indexes figures, not every picture. A picture both caption-less and under 33 points (about 12mm) on either side gets no record and no PNG: publisher logos, ORCID icons and badges, 38.5% of the 8,769 crops across 497 papers. Both tests apply together because neither alone discriminates, and the floor is in page points, so changing the scale does not reclassify the corpus.

The images are a reading aid for checking a draft against its sources. They are never inserted into a draft: having a paper in your library grants no right to reproduce its figures, and a figure's copyright is not the paper's citekey to grant. See DEVELOPER.md's "Figures and copyright" (git checkout only).

Changing this invalidates the whole docling cache, so the next run re-parses the corpus. Costs in PERFORMANCE.md.

๐Ÿง  Choosing an embedding model

Documents are cleaned before they are chunked: the reference list, which makes two papers similar for citing the same work, is dropped along with bare emails, URLs, DOIs, copyright lines and page numbers. Nothing else is removed: stop-word removal and lowercasing destroy multiword domain terms. A document with no detectable References heading (9% here) keeps its whole text.

chitragupta/core/corpus/enrich/embed_index.py calls SentenceTransformer(config.EMBEDDING_MODEL).encode(...) symmetrically: the same call embeds a 200-word chunk (40-word overlap) and a query, with no prefix on either side. That decides which models are drop-in.

โœ… Drop-in

Model Dimensions Cost Best for
sentence-transformers/all-MiniLM-L6-v2 (code default) 384 ~22M params, fast even on CPU Small corpora, quick iteration, CPU-only machines
sentence-transformers/all-mpnet-base-v2 (example default) 768 ~109M params, ~4-5x MiniLM; slower on CPU Better general-purpose semantic quality
sentence-transformers/multi-qa-mpnet-base-dot-v1 768 Same as all-mpnet-base-v2 Short query against long passage, the closest match to search(); slightly weaker on generic similarity

All three are trained for prefix-free use, which is what the symmetric call needs. The 768-dimension models double per-chunk storage in Chroma.

๐Ÿšซ Not without a code change first

๐Ÿ”„ Switching

Edit [enrich].embedding_model, or set EMBEDDING_MODEL=... for one run, then rebuild the index:

python -m chitragupta.enrich --stages embed

The model downloads on first use (needs network), and Chroma's existing collection is not re-embedded automatically.

๐Ÿง  Choosing an entailment model

chitragupta/core/review/entailment.py scores (premise, hypothesis) pairs with CrossEncoder(config.ENTAILMENT_MODEL).predict(pairs): a citing sentence's claim against a passage of the cited source (never a section_header, which asserts nothing). It reads the probability by looking up "entailment", case-insensitively, in the model's own id2label, not by column index, which makes every candidate below a drop-in.

A checkpoint that names no entailment label is refused, not guessed at. LABEL_0/LABEL_1/LABEL_2, or a non-NLI cross-encoder such as a reranker, raises entailment.EntailmentLabelError naming this setting, the model and its labels. Which column is entailment is not recoverable from LABEL_2, and guessing would decide on a coin flip whether a claim reads as supported.

โœ… Drop-in cross-encoders

All three were loaded via sentence_transformers.CrossEncoder (no extra install beyond the enrich group) and timed on a batch of 8 pairs; accuracy is the published MNLI-mismatched figure.

Model Parameters Batch of 8 MNLI-mm
cross-encoder/nli-deberta-v3-small (code default) 141,897,219 0.337s 87.55
cross-encoder/nli-deberta-v3-base (example default) 184,424,451 0.346s / 0.351s 90.04
cross-encoder/nli-MiniLM2-L6-H768 82,120,707 0.234s 86.89

At this batch size fixed overhead dominates, so -base costs memory and download, not latency, for +2.49 points. MiniLM2 suits a CPU-constrained machine but is not the default: the accuracy it gives up is real on a citation-integrity aid. cross-encoder/nli-deberta-v3-xsmall publishes 87.77 but was not measured, so it stays an open question.

๐Ÿšซ Not without a code change first, for entailment

facebook/bart-large-mnli and the MoritzLaurer/* zero-shot-MNLI models are transformers.pipeline("zero-shot-classification") models (per their model-card metadata), not CrossEncoder-wrapped ones. Using one would mean a second ML code path beside the CrossEncoder path chitragupta/core/review/entailment.py and chitragupta/core/overlap_chroma.py share. This is an API-shape rejection; no claim is made about their accuracy.

๐Ÿ”„ Switching entailment models

Edit [enrich].entailment_model, or set ENTAILMENT_MODEL=... for one run. There is no index to rebuild: the model loads lazily and nothing it produces is cached, so a switch takes effect on the next claim-support check. It downloads on first use, like an embedding model.

๐ŸŒฑ Seed topics: organising the corpus by phrases you wrote

content/seed_topics.toml is an optional list of topic phrases in your own words. Without it, the bertopic stage clusters unsteered and the seed-topics stage reports itself skipped.

# content/seed_topics.toml -- start from assets/style/topics.toml.example
topics = [
    "digital twin",
    "structural health monitoring",
]

A phrase is one topic and is never split into words: it is embedded whole and compared against each document, unlike BERTopic's seed_topic_list, where "monitoring" alone would match every paper with a monitoring section.

You write them. Your collection names (chitragupta corpus ledger --collections, with a bib from chitragupta-importer) are a good start, minus shelves such as "To read": nothing can tell those apart mechanically, which is why the file is hand-written.

Two files feed the matching. The seed-topics and converge stages read the union of content/seed_topics.toml (yours, never overwritten) and content/keywords.toml (the extract-keywords stage's output, regenerated on every run), deduplicated case-insensitively with your spelling winning. On this project's 497 documents your list alone reached 69.4% coverage and the union 98.6% (bench/RESULTS.md, 2026-09-03c). With neither file the stage reports itself skipped.

There is no limit to the number of phrases, and they cost one cosine per document each. Seeds are matched after clustering, never fed into it, so naming a topic does not consume an emergent one. Feeding them in through BERTopic's zeroshot_topic_list was measured and rejected: nine phrases took the corpus from 81 emergent topics to 53.

โ–ถ Running it, and reading the result

chitragupta enrich --stages seed-topics   # needs the enrich group
chitragupta corpus topics                 # stdlib only, no venv, no GPU
chitragupta corpus topics --topic "digital twin"

The report goes to content/topic_seeds.json. A paper appears under every topic it matched, unlike content/topics.json, where BERTopic assigns one id. The report also lists every document that matched no topic: the part of your corpus your list does not yet describe.

[enrich].seed_topic_max_papers (25) is the selection rule: each phrase is ranked against its own scores and the best N kept. seed_topic_min_similarity (0.15) is only a noise floor. A single absolute cutoff was rejected because every phrase has its own score scale: at 0.35, Standards (a real 25-paper collection, max 0.295) returned nothing while Digital Twin (median 0.338) returned half the corpus. The report prints how many papers were considered ("25 of 340 papers"). The floor drops labels with no semantic content but not a shelf label that also describes papers, such as Reviews and Surveys.

๐Ÿ”— One topic set, from your phrases and the corpus's own

The converge stage writes content/topic_set.json, joining your phrases and the emergent topics into one shape:

{"label": "structural health monitoring", "provenance": "seed",
 "topic_id": 41, "members": [{"citekey": "...", "score": 0.62}]}

Your name wins: an emergent topic within [enrich].topic_converge_similarity of one of your phrases is renamed by it. When several phrases match one topic the closest wins (ties broken on the phrase text); when several topics match one phrase each keeps its own row, since merging would discard granularity the clustering found. A phrase matching no topic still appears with "topic_id": null, and uncovered names papers no topic reached. The stage re-runs no clustering; run it after bertopic and seed-topics.

๐Ÿ•ธ The topic graph

The topic-graph stage writes content/topic_graph.json after converge; only display reads it. TOPIC-DISCOVERY.md has the reasoning behind its two settings:

๐Ÿท What a topic is called

A topic's name comes from its most distinguishing terms. Two things are excluded from that vocabulary, without changing which papers group together:

Without them the top-ranked topic was named werner kritzinger, fraunhofer austria, a name in the prose of papers discussing his work, which dropping the reference list cannot fix. The cost: 5 of 1,277 surnames are ordinary words (black, brown, can, park, wood). A cited author not in your library (drath, kockmann) can still name a topic, since widening the list would mean guessing names from reference prose.

๐Ÿ”ฌ How many topics, and how deep

[enrich].topic_min_cluster_size (3), topic_min_samples (2) and topic_neighbors (5) set the granularity of the emergent topics, measured on this project's 497-paper corpus with everything else fixed:

topic_min_cluster_size topics outliers median topic size
10 13 27% 19
5 25 19% 13
3 50 12% 6
3, with topic_min_samples = 2 75 10% 5

The outlier rate falls as topics get finer. Small-corpus clamps only ever reduce these values, since UMAP's spectral initialisation fails when n_neighbors >= n_samples.

๐Ÿงฉ Topics a paper belongs to, beyond the one it is assigned

content/topics.json records assignments (one topic id per document) and, with [enrich].topic_distribution on, memberships: every topic a document belongs to, with its strength. Here 140 of 497 papers belong to more than one topic, and the scalar discards 222 memberships.

assignments is which cluster a document was put in (density, what HDBSCAN decided); memberships is what the paper is about (similarity to each topic's descriptor). They can differ, so the assigned topic is always present in a document's memberships.

The strengths are cosine to each topic's descriptor (its members' centroid, on mean-centred embeddings, since raw cosines bunch together in a one-subject corpus), recorded as membership_mechanism. Three alternatives were measured and rejected: HDBSCAN's own soft clustering answers the density question nearly binarily for a core point (1.64 topics per paper, 25% of papers plural, on a library where 637 of 642 papers carry hand-made labels across 95 collections); BERTopic's approximate_distribution separated almost nothing (top-share 0.03); and a Gaussian mixture returned near-certain single assignments (bench/RESULTS.md has the table).

topic_membership_ratio (0.5) is how strong a topic must be relative to the document's strongest, and topic_membership_max (8) caps the list for a document similar to almost everything. A cap of 3 was measured too low: it put 387 of 497 documents at exactly 3, so the cap decided instead of the ratio.

None of these gate anything: no run fails on them and no draft is blocked by one (docs/HOUSE-STYLE.md R3).