Why Rename is Needed

In multi-agent systems or multi-role collaborative tasks, you may want multiple modules to reuse the same code logic but exhibit different behaviors or configurations in the inference process. For example, using two different large models in the same task to play the roles of “Responder” and “Reviewer” respectively. UltraRAG provides a simple mechanism: configure multiple logical aliases for the same Server module, enabling parallel, decoupled, and personalized execution flows.

How to Use

1. Configure Alias Servers

In pipeline.yaml, you can define multiple logical aliases for the same path under the servers field:
servers:
  agent1: servers/generation
  agent2: servers/generation
Here, agent1 and agent2 point to the same servers/generation module, but will be executed and configured independently later.

2. Call Separately in the Pipeline

In the pipeline, you can call these two aliases as different roles respectively:
pipeline:
- agent1.generate
- agent2.generate
UltraRAG treats these two calls as two independent server instances for construction and execution.

Example

Pipeline file example
/images/yaml.svgexamples/multi_agent.yaml
# MCP Server
servers:
  agent1: servers/generation
  agent2: servers/generation

# MCP Client Pipeline
pipeline:
- agent1.generate
- agent2.generate
Run the build command:
ultrarag build examples/multi_agent.yaml
The generated server configuration after building is as follows:
agent1:
  base_url: http://localhost:12301
  model_name: gpt-5
  sampling_params:
    temperature: 0.7
    top_p: 0.8
    top_k: 20
    max_tokens: 512
    stop: ["<|im_end|>", "<|end_search_query|>"]
    extra_body:
      chat_template_kwargs:
        enable_thinking: false

agent2:
  base_url: http://localhost:12302
  model_name: deepseek-r2
  sampling_params:
    temperature: 0.7
    top_p: 0.8
    top_k: 20
    max_tokens: 512
    stop: ["<|im_end|>", "<|end_search_query|>"]
    extra_body:
      chat_template_kwargs:
        enable_thinking: false
You can see that agent1 and agent2 have independent models, ports, and sampling parameter configurations.

Summary

By setting multiple aliases for the same Server module, UltraRAG supports highly flexible multi-agent task orchestration and concurrent execution capabilities. You can build complex collaborative scenarios like building blocks through renaming, without copying code or module logic. Furthermore, you can combine branch routing, loop repeated inference, and other mechanisms to create a complete Agent system.