Q&A Agent
Q&A Agent
Section titled “Q&A Agent”Generate an action plan and execute it. Can use external tools.
What it does
Section titled “What it does”Answers questions using a knowledge base by retrieving relevant context and generating responses.
When to use it
Section titled “When to use it”Use this agent to build question-answering systems that reference specific documents or knowledge bases.
Run on-device
Section titled “Run on-device”What you connect to the Model port decides the engine — there is no setting to switch:
- A chat model (e.g. Chat OpenAI, Web LLM) — retrieves passages from the connected Knowledge and writes an answer from them.
- A Local Q&A Model — answers in your browser: free, private, offline. It retrieves the top passages from the connected Knowledge and quotes the best-scoring answer span, so the answer always comes verbatim from your documents. System message and Output Parser don’t apply.
The on-device path needs a Knowledge: an extractive model can only quote from a passage, so connect a Local Knowledge (pair it with Local Embeddings to keep everything on-device).
Inputs and settings
Section titled “Inputs and settings”| Setting | Notes |
|---|---|
| Options → System message | Extra instructions appended to the Q&A prompt (chat model only). |
| Options → Knowledge documents (k) | How many passages to retrieve from the Knowledge (default 4). |
| Options → Max knowledge context length | Maximum characters of retrieved knowledge to use (default 4000). On-device, each passage is capped to this length. |
| Options → Fail on knowledge error | Chat model only: fail when retrieval errors instead of answering without context (default off). |
Outputs
Section titled “Outputs”- Chat model — returns
{ response }, the generated answer. - Local Q&A Model — returns
{ response, answer, score, source }:responseandanswerare the quoted answer (empty if none was found),scoreis the model’s confidence, andsourcenames the document it came from (when its metadata has a source, file name, title, or URL).
Dependencies and credentials
Section titled “Dependencies and credentials”- Model (required) — a chat model, or a Local Q&A Model to answer on-device.
- Knowledge — optional with a chat model, required with a Local Q&A Model.
- Output Parser (optional) — chat model only.
Example workflow
Section titled “Example workflow”Connect Local Embeddings → Local Knowledge → the Q&A Agent’s Knowledge port, and a Local Q&A Model to its Model port. Index your documents into the knowledge store, then send questions to the agent — the answer and its source document come back without anything leaving the browser.
Troubleshooting
Section titled “Troubleshooting”- ”… it needs a context: connect a Knowledge to the Q&A Agent.” — the Local Q&A Model is connected but no Knowledge is.
- Empty
answeron-device — no retrieved passage contained an answer (a warning is logged). Raise Knowledge documents (k) or rephrase the question. - “Knowledge retrieval failed: …” — the knowledge store couldn’t be searched; check the Local Knowledge node and its embeddings.
- If it calls an external service, verify credentials, permissions, and rate limits.
Related nodes
Section titled “Related nodes”- Local Q&A Model
- Local Knowledge
- RAG Agent
- Answer Question — on-device Q&A over a passage you provide.
- Chat OpenAI