CLI Reference¶
PaperRAG is invoked via the paperrag command. Running it without a subcommand starts the interactive REPL.
Global Options (REPL mode)¶
paperrag [OPTIONS]
Option |
Short |
Description |
|---|---|---|
|
|
Index directory (required unless set in |
|
|
PDF directory |
|
|
LLM model name. Ollama names (for example |
|
|
Number of chunks to retrieve (default: 3) |
|
|
Similarity score threshold (0.0-1.0) |
|
LLM temperature (0.0-2.0) |
|
|
Maximum response tokens (default: 256) |
|
|
LLM context window size (default: 2048) |
|
|
Override the default system prompt |
|
|
Show version and license |
|
|
|
Show help |
paperrag index¶
Index PDF files into the FAISS vector store.
paperrag index [OPTIONS]
Option |
Short |
Description |
|---|---|---|
|
|
PDF directory (default: |
|
|
Index directory (default: |
|
|
Force full re-index |
|
|
Save index every N PDFs (0 to disable) |
|
|
Number of parallel workers (0 = auto-detect) |
|
OCR mode: |
|
|
CSV manifest file with paper metadata |
Examples¶
# Index with default settings
paperrag index --input-dir ~/papers
# Index a single PDF into ~/papers/.paperrag-index
paperrag index --input-dir ~/papers/paper.pdf
# Force re-index with 4 workers, OCR disabled
paperrag index --input-dir ~/papers --force --workers 4 --ocr never
# Index with a metadata manifest
paperrag index --input-dir ~/papers --manifest papers.csv
paperrag review¶
Index a PDF file or directory, then drop directly into the interactive review session.
paperrag review INPUT_PATH [OPTIONS]
Option |
Short |
Description |
|---|---|---|
|
|
Index directory. If omitted, auto-derived from the input path. |
|
|
Number of chunks to retrieve (default: current config) |
|
|
Similarity score threshold (0.0-1.0) |
|
LLM temperature |
|
|
Maximum response tokens |
|
|
LLM context window size |
|
|
Override the default system prompt |
|
|
|
LLM model name |
Default index location:
Directory input:
<input-dir>/.paperrag-indexSingle PDF input:
<pdf-parent-dir>/.paperrag-index
Single-PDF behaviour: when a single PDF is passed, the REPL starts with queries automatically focused on that paper. If the index contains other papers (e.g. previously indexed alongside it), a one-line hint is shown:
Auto-focused on 'paper.pdf'
2 other paper(s) also indexed — /focus list to browse, /focus to search all
Use /focus (no argument) at any time to remove the filter and search across all indexed papers.
Examples:
# Review one paper — REPL auto-focuses on it
paperrag review ~/papers/paper.pdf
# Review a whole directory and increase answer length
paperrag review ~/papers --max-tokens 512
# Review using a custom index location
paperrag review ~/papers/paper.pdf --index-dir /tmp/paperrag-review
paperrag query¶
Run a one-off query against the indexed papers.
Use --no-llm to stop after retrieval and print chunk-level results directly.
paperrag query QUESTION [OPTIONS]
Option |
Short |
Description |
|---|---|---|
|
|
Index directory (required) |
|
|
PDF directory |
|
|
Number of results (default: 3) |
|
|
Similarity score threshold (0.0-1.0) |
|
Skip answer generation and print raw retrieval results |
|
|
LLM temperature (0.0-2.0) |
|
|
Maximum response tokens (default: 256) |
|
|
LLM context window size (default: 2048) |
|
|
Override the default system prompt |
|
|
|
LLM model name |
Examples¶
# Query with Ollama
paperrag query "what is speech chain?" --index-dir ~/papers -m qwen3:1.7b
# Query with a local GGUF model through llama.cpp
paperrag query "summarize the paper" --index-dir ~/papers -m ./models/qwen3-1.7b.gguf
# Query with a HuggingFace GGUF repo through llama.cpp
paperrag query "summarize the paper" --index-dir ~/papers -m Qwen/Qwen3-1.7B-GGUF
# Retrieval-only mode (no LLM call)
paperrag query "attention mechanism" --index-dir ~/papers --no-llm
# Adjust retrieval parameters
paperrag query "attention mechanism" --index-dir ~/papers -k 10 -t 0.3 --max-tokens 512
paperrag evaluate¶
Evaluate retrieval quality using a JSONL benchmark file.
paperrag evaluate BENCHMARK_FILE [OPTIONS]
Option |
Short |
Description |
|---|---|---|
|
|
Number of results (default: 3) |
|
|
PDF directory |
|
|
Index directory |
The benchmark file should be JSONL with each line containing:
{"question": "...", "relevant_documents": ["path1.pdf", "path2.pdf"]}
REPL Slash Commands¶
Inside the REPL, all control commands are slash-prefixed:
Command |
Description |
|---|---|
|
Query the indexed papers |
|
Re-index the current PDF directory or file |
|
Re-index a different PDF file or directory |
|
Focus queries on a specific paper (use |
|
Set top-k retrieval |
|
Set minimum similarity score |
|
Set LLM temperature |
|
Set maximum response tokens |
|
Set LLM context window size |
|
Set the system prompt |
|
Toggle retrieval-only mode for subsequent queries |
|
Explicitly enable or disable retrieval-only mode |
|
Switch the active LLM backend/model |
|
Show the current effective configuration |
|
Show loaded |
|
Show REPL help |
|
Exit the REPL |
When /no-llm mode is active, queries stop after retrieval and print scored chunk snippets instead of generating an answer. Use /no-llm on or /no-llm off when you want an explicit state change instead of a toggle.