Skip to content
Agentic Workflowdocs
v0.8.2Install free

nodes / builtin / ai / localai

Answer Question

Extract an answer from a passage, on-device

AI ExtensionWeb app

Find the answer to a question inside a passage of text, with a model that runs in your browser.

Answer Question reads the Context passage and returns the piece of it that best answers the Question, with a confidence score. The answer is always copied word for word from the context: the model does not write new text, so it cannot make up facts that are not there.

It runs on your device with a question-answering model such as DistilBERT SQuAD or the TensorFlow.js MobileBERT Q&A. There is no cost per run and no API key.

  • Pull one fact out of an email, an invoice or a scraped page: an order number, a date, a price.
  • Ask the same question of many items, such as “Who is the sender?” for every message in a list.

When you need a written answer that combines several facts, use Q&A Agent with a chat model. To pull several named fields at once, use Information Extractor.

SettingTypeWhat it does
Model Model pickerAny installed question-answering model, across engines.
Question Text
Context TextThe passage to find the answer in.

Both Question and Context must have text. Ask short, direct questions (“What is the delivery date?”). Keep the context focused: these small models read a limited amount of text, so pass the relevant paragraph rather than a whole page.

  • Output

Each output item has these fields:

FieldTypeWhat it holds
answer Text
score Number
Shape of an output item
{
"answer": "…",
"score": 0
}

answer is the extracted text (empty when the model finds nothing). score is the model’s confidence from 0 to 1. Use an IF on {{ $input.score }} to skip low-confidence answers.

None. This node needs no connection and has no slots for other nodes.

The Model picker lists your installed models first, then models that download on first use. Manage them on the Local AI page.

Pull the order number from the email text you select:

  1. Context Menu with Menu Contexts set to Selection.
  2. Answer Question with Model DistilBERT SQuAD, Question What is the order number? and Context {{ $input.selectionText }}.
  3. Clipboard Write with Text {{ $input.answer }}.
  • “Choose a Q&A model.” Model is empty. Pick one.
  • “Provide both a question and a context passage.” Question or Context is empty after expressions run. Check the field names in your expressions.
  • The answer is wrong or very short. The answer must appear in the context. Rephrase the question with words used in the text, or trim the context to the relevant part.
  • “Model “…” isn’t available. Install it from Local AI.“ The saved model is no longer in your list, for example a removed custom model. Pick another model.
Edit page

Last updated:

Was this page useful?
Ask Aria about Answer Question