mosaic ask
Answers a question from your indexed papers: it retrieves the most relevant ones and asks the configured LLM to answer from them alone, citing them as [n].
Usage
bash
mosaic ask "What causes anomalous electron transport in Hall thrusters?"
mosaic ask "What is still unexplained about the breathing mode?" --mode gaps
mosaic ask "PIC versus fluid models of the discharge" --mode compare --show-sources
mosaic ask "Which codes simulate the plume?" --mode extract --year 2015-2025
mosaic ask "wall effects on electron mobility" -q "hall thruster" -n 20
mosaic ask "anomalous transport" --from refs.bib -o answer.mdBehaviour
| Mode | Answer |
|---|---|
synthesis (default) | a state-of-the-art summary |
gaps | open problems, contradictions, methodological limits |
compare | methods, datasets, metrics and results side by side |
extract | per paper: task, method, dataset, metric, key result |
Retrieval returns rag.top_k papers (default 10; -n overrides it). --query and --from restrict it to the papers matching a query, or listed in a .bib/.csv file; --year filters them by year.
--output writes Markdown (.md: the question, the mode, the answer and the references) or JSON (.json).
Needs the index (mosaic index) and an LLM (mosaic config --llm-provider ...). Exit code 1 for an unknown mode, or when retrieval or the LLM call fails.
See also: tutorial 9, asking your library, AI recipes.
Options
mosaic ask [OPTIONS] QUESTION| Argument | Value | Description |
|---|---|---|
QUESTION | TEXT | Question or topic to analyse |
| Option | Value | Default | Description |
|---|---|---|---|
--mode | TEXT | synthesis | synthesis (default), gaps, compare, extract |
--query, -q | TEXT | Pre-filter: restrict to papers matching this FTS query | |
--from | PATH | Pre-filter: restrict to papers from a .bib or .csv file | |
--year, -y | TEXT | Year or range filter (e.g. 2020-2024) | |
-n, --top | INTEGER | Override rag.top_k for this query | |
--output, -o | PATH | Write answer to file (.md or .json) | |
--show-sources | Print retrieved papers before the answer |

