nl2sql

AnswerSynthesizerNode

Overview


Responsibilities


Position in Execution Graph

Upstream:

Downstream:

Trigger conditions:

flowchart LR
    Aggregator[EngineAggregatorNode] --> Synthesizer[AnswerSynthesizerNode] --> EndNode[PipelineEnd]

Inputs

From GraphState:

Validation performed:


Outputs

Mutations to GraphState:

Side effects:


Internal Flow (Step-by-Step)

  1. Resolve aggregated result from aggregator_response.
  2. If missing, emit INVALID_STATE error and stop.
  3. Serialize results to JSON.
  4. Serialize unmapped sub‑queries to JSON.
  5. Invoke LLM chain with structured output.
  6. Return AnswerSynthesizerResponse.
  7. On exception, emit AGGREGATOR_FAILED.

Contracts & Interfaces

Implements a LangGraph node callable:

def __call__(self, state: GraphState) -> Dict[str, Any]

Key contracts:


Determinism Guarantees


Error Handling

Emits PipelineError with:

Logs failures via logger.error.


Retry + Idempotency


Performance Characteristics


Observability


Configuration


Extension Points


Known Limitations