CLI¶
All commands run from inside the repository so relative settings,
migrations, domain/, and data paths resolve predictably.
Command map¶
| Command | Purpose |
|---|---|
sci-rag new |
Create a new Sci RAG Kit project. |
sci-rag init |
Configure an existing Sci RAG Kit checkout in place. |
sci-rag doctor |
Diagnose the environment: config, domain, database, corpus, credentials. |
sci-rag ingest |
Ingest documents: parse, chunk, embed, and store them. |
sci-rag build |
Build the knowledge base in one go: ingest, then extract the graph and its summaries. |
sci-rag retrieve |
Search the corpus and show the evidence: which layer found each result, and why it ranked. |
sci-rag answer |
Answer a question from your documents, with numbered citations. |
sci-rag stats |
Show what is in the knowledge base: documents, chunks, graph size, licenses. |
sci-rag profile |
Time each retrieval stage (median and 95th percentile) under each profile. |
sci-rag serve |
Start the web service: REST API under /v1 (docs at /docs) and MCP tools at /mcp. |
sci-rag mcp |
Let a local agent such as Claude Code use the corpus as tools (MCP over stdio). |
sci-rag db |
Create or upgrade the database tables. |
sci-rag db upgrade |
Create or upgrade the database schema (runs the Alembic migrations). |
sci-rag graph |
Build the knowledge graph: extract concepts and relationships from your documents, then summarize the clusters they form. |
sci-rag graph extract |
Extract concepts and relationships from ingested chunks. |
sci-rag graph communities |
Group related entities into clusters and write a summary of each (rebuilds all). |
sci-rag graph citations |
Link corpus documents that cite each other, from the reference lists corpus enrich fetched. |
sci-rag graph resolve-entities |
Resolve duplicate graph entities conservatively and audit every merge. |
sci-rag graph gc |
Remove graph leftovers: entities with no evidence, relationships with a missing end, and communities whose members are gone. |
sci-rag campaign |
Find papers to add: search by topic or DOI list, check each one's rights, and download the open-access PDFs into a manifest you can ingest. |
sci-rag campaign discover |
Discover a deduplicated DOI list and save resumable state. |
sci-rag campaign build |
Check each candidate's rights, download the open-access PDFs, and write a manifest to ingest. |
sci-rag campaign screen |
Screen discovered abstracts and queue uncertain rows for human review. |
sci-rag campaign review |
Walk pending screening rows and append explicit human decisions. |
sci-rag manifest |
Check a corpus manifest (data/corpus.jsonl) before you ingest it. |
sci-rag manifest lint |
Check a corpus manifest before ingesting it. |
sci-rag draft |
Draft the domain files you would otherwise hand-write. |
sci-rag draft questions |
Draft seed questions grounded in your own documents, and verify them. |
sci-rag draft seed-from-answers |
Draft seed rows for questions you already have, from the kit's own answers. |
sci-rag draft manifest |
Read title, authors, year, and source off your documents. |
sci-rag draft ontology |
Redraft or refine the ontology against what your documents actually say. |
sci-rag draft prompts |
Reword a prompt for your field. |
sci-rag eval |
Measure quality against your seed questions: retrieval scores, what each retrieval layer contributes, and graded answers. |
sci-rag eval retrieval |
Score retrieval against your seed questions: did the right documents come back? |
sci-rag eval answers |
Answer every seed question and grade each answer for grounding, citations, and correctness. |
sci-rag eval diff |
Compare two eval runs: per-question rank moves and paired metric deltas. |
sci-rag eval html |
Render an eval run as one self-contained HTML page. |
sci-rag eval calibrate |
Compare a person's scores with the grader's, per dimension (reported as Cohen's kappa). |
sci-rag embed |
Re-embed rows left behind after an embedding model change. |
sci-rag embed reindex |
Re-embed chunks and community summaries that an older embedding model produced. |
sci-rag corpus |
Look after the corpus: rights report, publication metadata, snapshots, export, and deletion. |
sci-rag corpus enrich |
Add Crossref citation, journal, and retraction metadata to the corpus. |
sci-rag corpus delete |
Delete documents, their chunks, and every graph entry that relied on them. |
sci-rag corpus snapshot |
Record exactly which documents the corpus holds right now, under data/snapshots/. |
sci-rag corpus license-report |
Count documents and chunks by license class, and name the ones still unknown. |
sci-rag corpus export |
Export documents, chunks, entities, and relationships to files. |
sci-rag new¶
Create a new Sci RAG Kit project.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--output-dir, -o |
path | . | Where to create the project directory. Defaults to the current directory. |
--defaults |
boolean | false | Take every default without asking. Useful in CI. |
--answers-file |
path | unset | A YAML file of answers, for reproducible generation. Unanswered questions take their default. Answers that need a person, such as accepting a drafted ontology, must be supplied explicitly. |
--quick, --advanced |
boolean | unset | Ask six setup questions, or expose every option. |
--no-tty |
boolean | false | Use plain numbered prompts even in a supported terminal. |
--no-preflight |
boolean | false | Skip the live credential check before downloading the template. |
--ref |
text | unset | Fetch the template at this tag or branch, overriding the tag that matches this generator's version. |
--template-path |
path | unset | Generate from a local checkout with no network access. Copies what the checkout tracks, so local state stays local. |
sci-rag init¶
Configure an existing Sci RAG Kit checkout in place. The setup wizard asks about your project, LLM provider credentials, domain, corpus, and stack, then updates the target checkout's configuration files. It writes editable configuration files.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--target |
path | . | The checkout to configure. Defaults to the current directory. |
--defaults |
boolean | false | Take every default without asking. Useful in CI. |
--answers-file |
path | unset | A YAML file of answers, for reproducible generation. Unanswered questions take their default. Answers that need a person, such as accepting a drafted ontology, must be supplied explicitly. |
--quick, --advanced |
boolean | unset | Ask six setup questions, or expose every option. |
--no-tty |
boolean | false | Use plain numbered prompts even in a supported terminal. |
--dry-run |
boolean | false | Show what would change without writing anything. |
sci-rag doctor¶
Diagnose the environment: config, domain, database, corpus, credentials.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--probe |
boolean | false | Also make one tiny live embedding and generation call. |
sci-rag ingest¶
Ingest documents: parse, chunk, embed, and store them. Pass a folder for a first run (every document is recorded with license_class "unknown"), or a manifest once you have declared each document's rights. sci-rag build runs this and the graph steps together.
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
PATH |
path | unset | Folder of documents to ingest (PDF, HTML, Markdown, or plain text). |
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--manifest, -m |
path | unset | A JSONL corpus manifest: one line per document with title, authors, and rights. |
--source |
text | local | Source label recorded on documents ingested from a folder. |
--no-docling |
boolean | false | Skip Docling even if installed (use the pypdf fallback). |
--chunk-tokens |
integer | 800 | Target tokens per chunk. |
--overlap-tokens |
integer | 150 | Overlap tokens between chunks. |
sci-rag build¶
Build the knowledge base in one go: ingest, then extract the graph and its summaries. Ingestion works with any embedding setup, including offline. The graph steps need LLM provider credentials; without them, or with --no-graph, they are skipped and the command says so. Re-running only processes new chunks.
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
PATH |
path | unset | Folder of documents to ingest (PDF, HTML, Markdown, or plain text). |
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--manifest, -m |
path | unset | A JSONL corpus manifest: one line per document with title, authors, and rights. |
--source |
text | local | Source label recorded on documents ingested from a folder. |
--no-docling |
boolean | false | Skip Docling even if installed (use the pypdf fallback). |
--no-graph |
boolean | false | Stop after ingestion; skip the knowledge graph. |
--batch-size |
integer | 10 | Chunks per graph-extraction model call. |
sci-rag retrieve¶
Search the corpus and show the evidence: which layer found each result, and why it ranked.
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
QUERY |
text | required | The question to search for. |
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--profile |
text | deep | Which retrieval layers run: interactive (vector and keyword, fast), deep (all five), or auto (a router picks per question). |
--limit |
integer | 8 | How many results to return after the layers are combined. |
--license |
text | unset | Comma-separated license allowlist (e.g. public,open_commercial). |
--source |
text | unset | Comma-separated source allowlist. |
--year-min |
integer | unset | Earliest publication year to include. |
--year-max |
integer | unset | Latest publication year to include. |
--author |
text | unset | Comma-separated author allowlist (exact strings). |
--journal |
text | unset | Comma-separated journal allowlist. |
--exclude-doi |
text | unset | Comma-separated DOIs to drop. |
--explain-routing |
boolean | false | Print what the auto router decides for this query (and why) before retrieving. |
sci-rag answer¶
Answer a question from your documents, with numbered citations. Needs LLM provider credentials.
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
QUERY |
text | required | The question to answer. |
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--profile |
text | deep | Which retrieval layers run: interactive (vector and keyword, fast), deep (all five), or auto (a router picks per question). |
--limit |
integer | 8 | How many sources to give the model. |
--license |
text | unset | Comma-separated license allowlist (e.g. public,open_commercial). |
--source |
text | unset | Comma-separated source allowlist. |
--year-min |
integer | unset | Earliest publication year to include. |
--year-max |
integer | unset | Latest publication year to include. |
--author |
text | unset | Comma-separated author allowlist (exact strings). |
--journal |
text | unset | Comma-separated journal allowlist. |
--exclude-doi |
text | unset | Comma-separated DOIs to drop. |
--include-retracted |
boolean | false | Deliberately allow known retracted papers as answer evidence. |
--compression, --no-compression |
boolean | unset | Summarize each retrieved source before answering, or send the full text. Omit to use the domain profile's setting. |
sci-rag stats¶
Show what is in the knowledge base: documents, chunks, graph size, licenses.
sci-rag profile¶
Time each retrieval stage (median and 95th percentile) under each profile. Replays the seed questions against interactive, deep, and auto, and aggregates the per-stage timings every request already records. Stages run concurrently, so their durations do not sum to the request; wall-clock is measured separately and reported beside them.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--questions |
path | unset | Seed questions JSONL. Defaults to the domain's. |
--runs |
integer | 3 | Replays per question, per profile. |
--limit |
integer | 8 | Results per request. |
--json |
boolean | false | Machine-readable output. |
sci-rag serve¶
Start the web service: REST API under /v1 (docs at /docs) and MCP tools at /mcp.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--host |
text | unset | Bind address (default from settings). |
--port |
integer | unset | Port (default from settings; Cloud Run sets PORT). |
sci-rag mcp¶
Let a local agent such as Claude Code use the corpus as tools (MCP over stdio). Add it to an agent with, for example: claude mcp add sci-rag -- uv run --directory /path/to/your/repo sci-rag mcp
sci-rag db¶
Create or upgrade the database tables.
sci-rag db upgrade¶
Create or upgrade the database schema (runs the Alembic migrations).
sci-rag graph¶
Build the knowledge graph: extract concepts and relationships from your documents, then summarize the clusters they form.
sci-rag graph extract¶
Extract concepts and relationships from ingested chunks. Needs LLM provider credentials. Only chunks the extractor has not seen are processed, so re-running after a new ingest picks up just the new documents.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--batch-size |
integer | 10 | Chunks per extraction call. |
--all |
boolean | false | Re-read every chunk, including previously processed chunks. |
--max-chunks |
integer | unset | Stop after this many chunks (for trials). |
sci-rag graph communities¶
Group related entities into clusters and write a summary of each (rebuilds all). Summaries answer big-picture questions no single passage covers. Needs a LLM provider credentials.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--min-size |
integer | 3 | Smallest cluster worth summarizing. |
sci-rag graph citations¶
Link corpus documents that cite each other, from the reference lists corpus enrich fetched.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--dry-run, --apply |
boolean | true | Preview by default; --apply reconciles cached Crossref references. |
sci-rag graph resolve-entities¶
Resolve duplicate graph entities conservatively and audit every merge.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--dry-run, --apply |
boolean | true | Preview merges by default; --apply merges duplicates and records each merge in an audit table. |
--no-llm |
boolean | false | Skip borderline pairs. Nothing is sent to a model. |
--threshold |
float range | 0.92 | Minimum same-type similarity for an automatic fuzzy merge. |
--llm-threshold |
float range | 0.8 | Minimum similarity for a borderline pair to be reviewed by the LLM. |
sci-rag graph gc¶
Remove graph leftovers: entities with no evidence, relationships with a missing end, and communities whose members are gone.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--dry-run, --apply |
boolean | true | --dry-run (default) reports what would go; --apply removes it. |
sci-rag campaign¶
Find papers to add: search by topic or DOI list, check each one's rights, and download the open-access PDFs into a manifest you can ingest.
sci-rag campaign discover¶
Discover a deduplicated DOI list and save resumable state.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--topic |
text | unset | Search topic for OpenAlex discovery. |
--doi-file |
file | unset | Text file with one DOI or DOI URL per line. |
--name |
text | unset | Campaign directory name (derived from the input when omitted). |
--mailto |
text | required | Contact email sent to OpenAlex and Crossref. |
--max-results |
integer range | 100 | Maximum total candidates for a topic campaign. |
--campaign-root |
directory | data/campaigns | Parent directory for campaign state. |
sci-rag campaign build¶
Check each candidate's rights, download the open-access PDFs, and write a manifest to ingest.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--topic |
text | unset | Search topic for OpenAlex discovery. |
--doi-file |
file | unset | Text file with one DOI or DOI URL per line. |
--name |
text | unset | Campaign directory name (derived from the input when omitted). |
--mailto |
text | required | Contact email sent to OpenAlex, Crossref, and Unpaywall. |
--dry-run |
boolean | false | Resolve and report rights without downloading PDFs or writing a manifest. |
--max-results |
integer range | 100 | Work on at most this many candidates, including ones already in state. |
--all-candidates |
boolean | false | Ignore --max-results and process every candidate the campaign retains. |
--max-pdf-mb |
integer range | 25 | Reject a PDF larger than this many MiB. |
--campaign-root |
directory | data/campaigns | Parent directory for campaign state, PDFs, and manifest. |
sci-rag campaign screen¶
Screen discovered abstracts and queue uncertain rows for human review.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--name |
text | required | Campaign directory name to screen. |
--criteria-file |
file | required | Plain-text inclusion and exclusion criteria. |
--confidence-threshold |
float range | 0.8 | Model confidence below this value requires human review. |
--batch-size |
integer range | 20 | Maximum abstracts in one model request. |
--campaign-root |
directory | data/campaigns | Parent directory containing campaign state. |
sci-rag campaign review¶
Walk pending screening rows and append explicit human decisions.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--name |
text | required | Campaign directory name to review. |
--campaign-root |
directory | data/campaigns | Parent directory containing campaign state. |
sci-rag manifest¶
Check a corpus manifest (data/corpus.jsonl) before you ingest it.
sci-rag manifest lint¶
Check a corpus manifest before ingesting it. Ingestion reports a bad manifest one document at a time, after the run has already started. This reports every problem at once, before anything is parsed, embedded, or written.
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
PATH |
path | required | The JSONL corpus manifest to check. |
sci-rag draft¶
Draft the domain files you would otherwise hand-write. Every drafter can also print its corpus-bearing prompt for local use or an approved assistant (--print-prompt), then read the reply back (--from-file).
sci-rag draft questions¶
Draft seed questions grounded in your own documents, and verify them.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--count |
integer | 10 | How many questions to ask for. |
--folder |
path | unset | Draft from documents in this folder, before anything is ingested. |
--print-prompt |
boolean | false | Print the rendered prompt and exit. It may contain corpus text; send it only to an approved destination. |
--from-file |
path | unset | Read the model's reply from this file, with no model call. |
--output |
path | unset | Where to write the proposal. Defaults to |
--apply |
boolean | false | Append the verified questions to the seed file. |
--dry-run |
boolean | false | Show what would be drafted without writing anything. |
--repair, --no-repair |
boolean | true | Ask the model once more to replace rows that failed grounding verification. |
sci-rag draft seed-from-answers¶
Draft seed rows for questions you already have, from the kit's own answers. draft questions invents the questions. This takes yours, answers each one, and proposes ground truth from the evidence that answer cited. Nothing is taken on the model's word: evidence phrases are extracted from the retrieved chunk text and every row is checked against the same relevance predicate the evaluation uses, so a row that would score zero against its own evidence is dropped and never proposed.
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
QUESTIONS_FILE |
path | required | Plain text file of questions, one per line. # comments are skipped. |
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--profile |
text | deep | Retrieval profile to answer with. |
--limit |
integer | 8 | Sources per answer. |
--output |
path | unset | Where to write the proposal. Defaults to |
--apply |
boolean | false | Append the proposed rows to the seed file. |
--dry-run |
boolean | false | Show what would be proposed without writing anything. |
sci-rag draft manifest¶
Read title, authors, year, and source off your documents. Rights stay yours.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--folder |
path | unset | Documents to describe. Defaults to |
--print-prompt |
boolean | false | Print the rendered prompt and exit. It may contain corpus text; send it only to an approved destination. |
--from-file |
path | unset | Read the model's reply from this file, with no model call. |
--output |
path | unset | Where to write the proposal. Defaults to |
--manifest |
path | unset | The manifest being drafted. Defaults to |
--apply |
boolean | false | Write the manifest directly, with no .proposed file to review. |
--dry-run |
boolean | false | Show what would be drafted without writing anything. |
--batch-size |
integer | unset | Documents per model call. Defaults to 12. |
sci-rag draft ontology¶
Redraft or refine the ontology against what your documents actually say.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--from-corpus |
boolean | false | Draft from passages in your ingested corpus (or data/raw before ingestion). This is the default; the flag names it explicitly. |
--refine |
boolean | false | Show the model your ontology and ask only what it would add and remove. |
--cold |
boolean | false | Draft from the description alone, without reading any document. |
--folder |
path | unset | Draft from documents in this folder, before anything is ingested. |
--print-prompt |
boolean | false | Print the rendered prompt and exit. It may contain corpus text; send it only to an approved destination. |
--from-file |
path | unset | Read the model's reply from this file, with no model call. |
--output |
path | unset | Where to write the proposal. Defaults to |
--apply |
boolean | false | Write domain.yaml directly, with no .proposed file to review. |
--dry-run |
boolean | false | Show what would change without writing anything. |
sci-rag draft prompts¶
Reword a prompt for your field. Judge prompts are refused by name.
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
NAME |
text | required | Which prompt to reword: entity_extraction or answer. |
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--print-prompt |
boolean | false | Print the rendered prompt and exit. It may contain corpus text; send it only to an approved destination. |
--from-file |
path | unset | Read the model's reply from this file, with no model call. |
--output |
path | unset | Where to write the proposal. Defaults to |
--apply |
boolean | false | Write the prompt file directly, with no .proposed file to review. |
--dry-run |
boolean | false | Show the rewrite without writing anything. |
sci-rag eval¶
Measure quality against your seed questions: retrieval scores, what each retrieval layer contributes, and graded answers.
sci-rag eval retrieval¶
Score retrieval against your seed questions: did the right documents come back?
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--questions |
path | unset | Seed questions JSONL. |
--limit |
integer | 10 | Results retrieved per question. |
--ablation |
boolean | false | Also score each retrieval layer switched off in turn, to see what each contributes. |
--condition |
text | unset | Label an established corpus condition (currently: resolved_entities). |
--snapshot |
text | unset | Record this corpus snapshot name in the report. |
sci-rag eval answers¶
Answer every seed question and grade each answer for grounding, citations, and correctness. Needs LLM provider credentials. The grader scores grounding without seeing the reference answer, then scores correctness against it in a separate pass.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--questions |
path | unset | Seed questions JSONL. |
--profile |
text | deep | Retrieval profile for answer generation. |
--limit |
integer | 8 | Sources per answer. |
--judge-model |
text | unset | Judge model spec, 'model' or 'provider:model'. Overrides SCI_RAG_JUDGE_MODEL. |
--snapshot |
text | unset | Record this corpus snapshot name in the report. |
--compressed |
boolean | false | Summarize each retrieved source before answering, as a separate condition to compare. |
sci-rag eval diff¶
Compare two eval runs: per-question rank moves and paired metric deltas. Deltas are B minus A. Run it after any retrieval-affecting change to see whether the improvement is real or inside the noise.
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
REPORT_A |
path | required | Baseline report.json (or its run directory). |
REPORT_B |
path | required | Comparison report.json (or its run directory). |
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--config |
text | unset | Diff only this ablation config (default: every common config). |
--output |
path | unset | Also write the markdown diff to this path. |
sci-rag eval html¶
Render an eval run as one self-contained HTML page. For sharing with a collaborator who will never open a terminal. Inline styles, nothing fetched when the page is opened, and the small-sample and drafted-ground-truth warnings travel with the numbers. Picks up calibration.json automatically when it sits beside the report.
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
RUN |
path | required | Run directory, or the report.json inside one. |
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--output |
path | unset | Where to write the page (default: report.html beside the report). |
sci-rag eval calibrate¶
Compare a person's scores with the grader's, per dimension (reported as Cohen's kappa). Appends a calibration section to the report's markdown (report.md) and writes calibration.json next to it, so the kappa travels with the eval numbers it qualifies.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--labels |
path | required | Human labels (labels.jsonl). |
--report |
path | unset | Answers report.json (or its run directory) to calibrate against. Defaults to the newest answers run under eval_results/. |
--output |
path | unset | Also write the calibration markdown to this path. |
sci-rag embed¶
Re-embed rows left behind after an embedding model change.
sci-rag embed reindex¶
Re-embed chunks and community summaries that an older embedding model produced. A dimension change is refused outright: that is a schema migration plus a full re-ingest, never a reindex.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--dry-run, --apply |
boolean | true | --dry-run (default) reports what is stale; --apply re-embeds it. |
--batch-size |
integer | 32 | Rows re-embedded per batch (one commit per batch). |
sci-rag corpus¶
Look after the corpus: rights report, publication metadata, snapshots, export, and deletion.
sci-rag corpus enrich¶
Add Crossref citation, journal, and retraction metadata to the corpus.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--mailto |
text | required | Contact email sent with each Crossref request; identified callers get faster service. |
--dry-run |
boolean | false | List eligible DOI records without network calls or writes. |
--limit |
integer range | unset | Process at most this many documents. |
sci-rag corpus delete¶
Delete documents, their chunks, and every graph entry that relied on them. Communities built from that evidence are dropped too; rebuild them with sci-rag graph communities. Run sci-rag graph gc afterwards to remove entities left with no evidence at all.
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
DOCUMENT_IDS |
text, repeatable | required | Document id(s) to delete. |
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--yes, -y |
boolean | false | Skip the confirmation prompt. |
sci-rag corpus snapshot¶
Record exactly which documents the corpus holds right now, under data/snapshots/. Records counts, per-document content hashes, embedding versions, the git commit, and a single corpus digest. Reference it from eval runs with --snapshot NAME so reported numbers stay tied to exactly the corpus that produced them.
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
NAME |
text | unset | Snapshot name (default: UTC timestamp). |
sci-rag corpus license-report¶
Count documents and chunks by license class, and name the ones still unknown. License classes decide what a scoped request may see, so this is the report to read before you share the service.
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--json |
boolean | false | Machine-readable output. |
--strict |
boolean | false | Exit 1 when any document is still 'unknown'. For CI; the report itself never fails. |
sci-rag corpus export¶
Export documents, chunks, entities, and relationships to files. A scope leaves out anything it cannot vouch for, and applies to the graph too: an entity is exported only when every document it was extracted from is in scope, because its description is written from all of them. Communities are never exported; they aggregate with no per-document attribution to check.
Arguments¶
| Name | Type | Default | Description |
|---|---|---|---|
OUTDIR |
path | required | Directory to write the export files into. |
Options¶
| Option | Type | Default | Description |
|---|---|---|---|
--format |
text | jsonl | jsonl (no extra dependency) or parquet (needs --extra export). |
--license |
text | empty | Export only these license classes (repeatable). Omit for everything. An export is a redistribution, so a scope excludes 'unknown' unless you name it. |
--include-embeddings |
boolean | false | Include chunk vectors (large, rarely wanted). |
Shell help is authoritative too¶
Run uv run sci-rag COMMAND --help for the same current command tree
in the terminal. The generated page is a browsing aid; Click remains
the parser that decides whether a concrete invocation is valid.