# Ask your library

`sponge ask` answers a question from what you have saved. The answer is a few short statements, and each one is shown with the words of the saved item that support it. Everything runs on your computer: search, the model, and the check that each quote is really there.

```sh
sponge ask "what temperature should green tea be steeped at?"
```

The output has this shape (an illustration, not a captured run):

```text
Green tea is steeped at about eighty degrees, cooler than black tea. [1]
The lower temperature keeps the leaves from turning bitter. [1]

[1] Tea notes
    0a57a26ade13…
    “Green tea is steeped at a lower temperature than black tea, usually around eighty degrees”
    “so the leaves do not turn bitter”
```

The line under each title is the item id, for `sponge show ITEM`. A quote from a PDF names its page, and one from a transcript names its time.

## What it needs

- The model from `sponge setup --digest`, the same one that drafts [summaries](/docs/summaries). Or pass `--endpoint http://127.0.0.1:PORT --model NAME` to use a local model server you started.
- Nothing else. With `sponge setup --embedding` and a search index, items are found by meaning as well as by keywords; without them `ask` uses keyword search and says `Warning: semantic-unavailable`.

An answer takes about half a minute on an Apple Silicon Mac, most of it the model starting.

## How an answer is made

1. Search picks up to 8 items (`--limit` sets 1 to 20), the same way `sponge search` does.
2. Every paragraph of those items is ranked against the question. The paragraph meaning search matched counts too. Up to four paragraphs per item are kept, about 12,000 characters in all.
3. The model reads only those paragraphs. It writes at most six statements, and for each it must name one paragraph and copy a quote from it.
4. Sponge looks for each quote in the saved item. A statement is shown only when its quote is found there. The rest are counted on a `Left out:` line and never shown.

So every quote you see is in your library, word for word, and you can open the item to read around it. The statement above a quote is the model's wording: read the quote to judge it.

When the paragraphs do not answer the question, `ask` says `Nothing in your library answers that.` and lists the closest items instead of guessing.

## Passages without a model

```sh
sponge ask "what halts oxidation in tea leaves?" --passages
```

`--passages` stops after step 2 and prints the ranked paragraphs, each with its item, heading, and page or time. It needs no model and returns in well under a second. Coding agents get the same list from the `find_passages` tool of [`sponge mcp`](/docs/agents), and can write the answer themselves.

## JSON

`--json` returns `question`, `answered`, `claims` (each with `text`, `quote`, `itemId`, `passage`, and `page` or `startMs` when known), `passages` (the numbered paragraphs the model read), `dropped`, `warnings` and `model`.

## Limits

- Paragraphs are ranked by the question's words, so an answer phrased very differently from the question can be missed unless meaning search found its paragraph. Asking with the source's own terms helps.
- The check proves a quote is in the source. It does not prove the statement follows from the quote.
- Word matching drops common English endings only. Questions in other languages work, with exact word matching.
- Images, and text inside images, are not read.
- Answers are not saved or synced.
