In UltraRAG, the Pipeline achieves data binding through variable names: each tool declares its input parameters and output variables during registration, and the Pipeline relies on these variable names to pass and share data between steps during execution.This mechanism is simple and intuitive, facilitating the construction of sequential data flows. However, in multi-turn calls or complex control structures, variable name conflicts or data overwriting issues may occur. For this reason, UltraRAG provides a parameter renaming mechanism, allowing developers to flexibly rename variables in the Pipeline without modifying the source code.
The tool receives two input variables: q_ls and top_k
The tool returns one output variable: ret_psg
If you call the same tool (such as retriever_search) multiple times and wish to pass in different data variables (e.g., q_ls for the first time, subq_ls for the second time),
you need a way to tell the Pipeline: these variables are actually “synonyms”.
To solve variable name conflicts and binding ambiguity issues, UltraRAG provides a flexible Parameter Renaming Mechanism.
You can directly use input: and output: fields in pipeline.yaml to explicitly specify the mapping relationship between parameters and variables — without modifying the internal code of the Server, you can complete data binding redirection.
This mechanism follows the principle of “explicit binding by name”:
input: maps the function’s input parameter names, and output: maps the output keys defined during tool registration.
The simplest way: keep the input and output parameter names consistent during function definition and tool registration to directly avoid distinguishing the above two binding rules.
Here, the tool originally expects to receive an input parameter named query_list, but we map it to the variable sub_q_ls in the Pipeline via input:, thereby achieving seamless binding.
Input parameter mapping is performed based on the parameter names in the function declaration.
At this time, regardless of the return variable name inside the function, as long as the output key is specified as ret_psg during registration,
the result will be mapped to round1_result for use in subsequent steps.
Output variable mapping is performed based on the output key specified during tool registration.
If a downstream module depends on this output result:
This way of writing is particularly common in loop structures — each round of retrieval can use new input and output variables to avoid naming conflicts.
Reasonable use of parameter renaming allows your RAG process to remain clean and controllable in complex scenarios such as multi-turn iterations and dynamic branches without modifying the source code.