Saltar al contenido principal

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​

NameTypeRequiredDescription
questiontextYesQuestion to answer (overrides the config question)
documentanyYesThe long document: plain text, clinical notes, or a FHIR Bundle (string or JSON; bundles are packed on resource boundaries)

Output ports​

NameTypeRequiredDescription
resultjsonNoanswer, 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
successbooleanNoTrue when the lead answered inside the answer sentinel (status completed)

Settings​

Basic​

SettingNameTypeRequiredDefaultAllowed valuesDescription
ProviderproviderenumNoopenaiopenai, anthropic, vllm, localModel provider for both models
Lead Modellead_modelstringNogpt-4oReasoning model that decomposes the question and answers (thinking-capable recommended)
Reader Modelreader_modelstringNogpt-4o-miniCheap model bound to each chunk (defaults to lead_model when empty)
QuestionquestiontextNoStatic question (overridden by input)

Auth​

SettingNameTypeRequiredDefaultAllowed valuesDescription
API Keyapi_keysecretNoAPI key for the provider
API Base URLapi_base_urlstringNoOpenAI-compatible base URL; required for vllm/local providers

Advanced​

SettingNameTypeRequiredDefaultAllowed valuesDescription
Document Typedocument_typeenumNoautoauto, text, fhir_bundleHow the document input is packed: auto detects a FHIR Bundle, text chunks on paragraphs, fhir_bundle packs on resource boundaries
Chunk Tokenschunk_tokensnumberNo4096min 256; max 8192Chunk size in tokens (the paper's optimum is 4096)
Max Chunksmax_chunksnumberNo256min 1; max 512Cap on the reader bank; the chunk size grows once before the run fails
Max Turnsmax_turnsnumberNo12min 1; max 20Lead reasoning turns before forced finalization
Max Queries per Turnmax_queries_per_turnnumberNo4min 1; max 8query_agents calls honoured in one lead turn
Concurrent Readersmax_concurrent_readersnumberNo16min 1; max 64In-flight reader calls per scatter
Max Execution Time (s)max_execution_timenumberNo600min 10; max 1800Wall-clock budget for the whole run; expiry forces a finalization
Verify Roundverify_roundbooleanNofalseProbe every chunk for contradictions of the proposed answer before accepting it (+1 reader call per chunk)
Tool Protocoltool_protocolenumNonativenative, textnative uses provider function calling; text uses <query_agents> blocks for models without it
Include Traceinclude_tracebooleanNofalseAttach the per-turn trace (queries and findings; never chunk text) to the result

Errors​

CodeDescription
QUESTION_REQUIREDNo question provided via input or config
DOCUMENT_REQUIREDNo document provided via the document input
CLIENT_BUILD_FAILEDA model client could not be constructed from provider/model/api settings
BANK_BUILD_FAILEDThe document could not be chunked (malformed bundle, or more chunks than max_chunks allows)
PARSER_EXECUTION_FAILEDThe 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.

¿Algo no está claro? Envíe sus comentarios sobre la documentación por correo electrónico..