Documentation Index
Fetch the complete documentation index at: https://docs.contextual.ai/llms.txt
Use this file to discover all available pages before exploring further.
Description
Input mapping defines how nodes connect to each other in an Agent Composer workflow. It specifies which outputs from previous nodes flow into the inputs of subsequent nodes.
Syntax
Input mappings use the syntax source_node#output_key:
input_mapping:
current_node_input: earlier_node#output_key
This connects the output_key output from earlier_node to the current_node_input input of the current node.
Every graph has an implicit input node named __inputs__. Access graph-level inputs via:
input_mapping:
query: __inputs__#query
Example
nodes:
# First node receives input from the graph
search:
type: SearchUnstructuredDataStep
input_mapping:
query: __inputs__#query
# Second node receives input from the first node
rerank:
type: RerankRetrievalsStep
input_mapping:
query: __inputs__#query
retrievals: search#retrievals
# Third node receives inputs from multiple nodes
generate:
type: ResponseGenerationStep
input_mapping:
query: __inputs__#query
retrievals: rerank#retrievals
# Output node collects final outputs
__outputs__:
type: output
input_mapping:
response: generate#response
Rules
- All inputs of a node must be connected
- Unused outputs are allowed
- A node can receive inputs from multiple source nodes
- The same output can be connected to multiple downstream nodes
You can connect multiple inputs from the same source node:
generate:
type: ResponseGenerationStep
input_mapping:
query: __inputs__#query
retrievals: search#retrievals
translate_needed: translate#translate_needed
detected_language: translate#detected_language