ParSer Query
Category: AI & ML
Node id: parser-query
Maturity: beta
Risk tier: C
Answers a question over a long document by reading it in parallel: the document is chunked into a reader bank, a cheap reader model quotes verbatim evidence per chunk, and a lead model that never sees the document reasons over the verified findings and answers with chunk citations
What it does
- Length-invariant multi-hop QA: latency scales with reasoning depth, not document length
- Verbatim-evidence verification in Go and chunk-id citations on the answer
- Conflict detection across chunks with a disambiguation hint to the lead
- Optional contradiction-probe verify round
- FHIR Bundle packing on resource boundaries so citations resolve to resources
- Text tool protocol for models without function calling
Use cases
- Whole-patient longitudinal record question answering (FHIR bundle plus notes)
- Cohort questions over batches of patient summaries
- Recall-critical audits over note corpora where every chunk must be read
Runtime
- Performance tier:
slow
Input ports
| Name | Type | Required | Description |
|---|---|---|---|
question | text | Yes | Question to answer (overrides the config question) |
document | any | Yes | The long document: plain text, clinical notes, or a FHIR Bundle (string or JSON; bundles are packed on resource boundaries) |
Output ports
| Name | Type | Required | Description |
|---|---|---|---|
result | json | No | answer, status (completed | max_turns | timeout | budget_exhausted | error), turns, reader_calls, chunks, tokens_in, tokens_out, cached_tokens, duration_ms, citation_status (cited | uncited | unresolved), citations (chunk id, verbatim evidence, answer), verification when verify_round is set, trace when include_trace is set |
success | boolean | No | True when the lead answered inside the answer sentinel (status completed) |
Settings
Basic
| Setting | Name | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|---|
| Provider | provider | enum | No | openai | openai, anthropic, vllm, local | Model provider for both models |
| Lead Model | lead_model | string | No | gpt-4o | Reasoning model that decomposes the question and answers (thinking-capable recommended) | |
| Reader Model | reader_model | string | No | gpt-4o-mini | Cheap model bound to each chunk (defaults to lead_model when empty) | |
| Question | question | text | No | Static question (overridden by input) |
Auth
| Setting | Name | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|---|
| API Key | api_key | secret | No | API key for the provider | ||
| API Base URL | api_base_url | string | No | OpenAI-compatible base URL; required for vllm/local providers |
Advanced
| Setting | Name | Type | Required | Default | Allowed values | Description |
|---|---|---|---|---|---|---|
| Document Type | document_type | enum | No | auto | auto, text, fhir_bundle | How the document input is packed: auto detects a FHIR Bundle, text chunks on paragraphs, fhir_bundle packs on resource boundaries |
| Chunk Tokens | chunk_tokens | number | No | 4096 | min 256; max 8192 | Chunk size in tokens (the paper's optimum is 4096) |
| Max Chunks | max_chunks | number | No | 256 | min 1; max 512 | Cap on the reader bank; the chunk size grows once before the run fails |
| Max Turns | max_turns | number | No | 12 | min 1; max 20 | Lead reasoning turns before forced finalization |
| Max Queries per Turn | max_queries_per_turn | number | No | 4 | min 1; max 8 | query_agents calls honoured in one lead turn |
| Concurrent Readers | max_concurrent_readers | number | No | 16 | min 1; max 64 | In-flight reader calls per scatter |
| Max Execution Time (s) | max_execution_time | number | No | 600 | min 10; max 1800 | Wall-clock budget for the whole run; expiry forces a finalization |
| Verify Round | verify_round | boolean | No | false | Probe every chunk for contradictions of the proposed answer before accepting it (+1 reader call per chunk) | |
| Tool Protocol | tool_protocol | enum | No | native | native, text | native uses provider function calling; text uses <query_agents> blocks for models without it |
| Include Trace | include_trace | boolean | No | false | Attach the per-turn trace (queries and findings; never chunk text) to the result |
Errors
| Code | Description |
|---|---|
QUESTION_REQUIRED | No question provided via input or config |
DOCUMENT_REQUIRED | No document provided via the document input |
CLIENT_BUILD_FAILED | A model client could not be constructed from provider/model/api settings |
BANK_BUILD_FAILED | The document could not be chunked (malformed bundle, or more chunks than max_chunks allows) |
PARSER_EXECUTION_FAILED | The run failed before producing a result (a non-transient lead model error) |
Runtime notes
- The lead model never receives the document; only verbatim-verified findings reach it. Findings whose quote is not found in the chunk are dropped before the lead sees them
- Reader calls scale with chunks × queries × turns (a 200-chunk document with 4 turns is ~800 reader calls); bound them with max_turns, max_queries_per_turn and max_execution_time
- PHI egress is not guarded on this node: point it only at endpoints allowed for the document's data, or use the graph execution mode (execution_mode: parser), which guards every hop
- Set tool_protocol to text for models without function calling (e.g. Gemma on vLLM); the lead then writes <query_agents> blocks instead of tool calls
- Reader prompts are byte-stable per chunk across rounds so provider prefix caches apply; cached_tokens in the result reports the hit volume
- The question input takes precedence over the static question in config
See Build any workflow for how to put nodes together and Ports, types and data flow for how port types connect.
Etwas unklar? Senden Sie Feedback zur Dokumentation per E-Mail..