01Ground the request in available analytics
The router receives conversation history and selects an allowed route. For analysis, the model sees operations, available columns, metric definitions and the period, giving follow-up questions their domain context.
02Form the analytical contract
The model output specifies the analysis and calculation parameters: table, columns, filter, grouping, aggregations, having, sorting and join instructions. Pydantic checks structure and types; the executor looks up the key in the analysis catalogue.
03Normalize tool-call representations
The LLM adapter supports native function calls and JSON calls in text, normalizing names and arguments. Analysis selection cleans and parses JSON against its schema; unrecognized formats take a fallback path.
04Execute against portfolio tables
The execution node loads registered tables for the agent, supplies parameters and runs selected catalogue code. It supports specialized analyses and a general path for pandas filtering, joining, grouping and aggregation.
05Bring the result back into the conversation
The numerical result remains in a separate state field. The answer uses the data, metric definitions and sort order. Recommendations and wording review follow as separate stages.
06Improve the model’s use of tools
Applied SFT for fine-tuning, GRPO for behavior optimization and SGR for structured reasoning. The objective was better analytical tool selection and call formation.
07Explain metric changes through cards
A separate calculation path builds a metadata-defined metric tree. Recursive sequential substitution expresses contributions in root units and retains a residual. What-if recalculates dependent branches; cards expose deviations and their contributing factors.