UltraRAG 2.0 Logo

Less Code, Lower Barrier, Faster Deployment

UltraRAG 2.0: Accelerating RAG Research

Retrieval-Augmented Generation (RAG) systems are evolving from early-stage simple concatenations of “retrieval + generation” to complex knowledge systems integrating adaptive knowledge organization, multi-turn reasoning, and dynamic retrieval (e.g., DeepResearch, Search-o1). This rising complexity raises implementation costs for reproducibility and rapid iteration.

To address this challenge, THUNLP, NEUIR, OpenBMB, and AI9Stars jointly launched UltraRAG 2.0 (UR-2.0) — the first RAG framework based on the Model Context Protocol (MCP) architecture design. This design allows researchers to declare complex logic such as sequential, loop, and conditional branching simply by writing YAML files, enabling rapid implementation of multi-stage reasoning systems with minimal code.

Its core ideas are:

  • Modular encapsulation: Encapsulate RAG core components as standardized independent MCP Servers;
  • Flexible invocation and extension: Provide function-level Tool interfaces to support flexible function calls and extensions;
  • Lightweight workflow orchestration: Use MCP Client to build a top-down simplified linkage;

Compared with traditional frameworks, UltraRAG 2.0 significantly lowers the technical threshold and learning cost of complex RAG systems, allowing researchers to focus more on experimental design and algorithm innovation rather than lengthy engineering implementations.

Simplicity First: Focus on Ideas, Not Engineering

The value of simplicity becomes especially evident in practice. Take IRCoT, a classic method that relies on model-generated CoT to perform multi-round retrieval until reaching a final answer—an inherently complex workflow.

IRCoT Workflow Diagram

IRCoT Workflow

In the official implementation, the Pipeline alone requires nearly 900 lines of handwritten logic. Even with a benchmark RAG framework such as FlashRAG, it still takes over 110 lines of code. In contrast, UltraRAG 2.0 achieves the same functionality with just around 50 lines of code—and notably, nearly half of these are simply Yaml pseudo-code for pipeline orchestration. This dramatically lowers the development barrier and implementation cost.

Total code lines across frameworks
Code composition split

How Different Frameworks Implement IRCoT: Code Scale and Structure Compared

We showcase how frameworks differ in implementing the same functionality. FlashRAG requires lengthy control logic with explicit loops, conditionals, and state updates. UltraRAG 2.0, on the other hand, simplifies everything into just a few lines of Pipeline YAML—branches and loops are expressed declaratively, removing the burden of manual coding.

FlashRAG
PythonBranch + Loop
# 1. Initial retrieval
questions = [item.question for item in items]
retrieval_results, scoress = self.retriever.batch_search(questions, return_score=True)
for retrieval_result, scores in zip(retrieval_results,scoress):   
    doc2score = {doc_item['id']: score for doc_item, score in zip(retrieval_result, scores)}
    id2doc = {doc_item['id']: doc_item for doc_item in retrieval_result}
    batch_retrieval_results.append(retrieval_result)
    doc2score_batch.append(doc2score)
    id2doc_batch.append(id2doc)
# 2. Start the iterative process
active_item_ids = list(range(len(items)))  # Track items that need more iterations
while iter_num < self.max_iter:
    # 3. Construct prompts
    input_prompts = [
        self.prompt_template.get_string(
            question=items[item_id].question,
            retrieval_result=batch_retrieval_results[item_id],
            previous_gen=' '.join(batch_thoughts[item_id])
        )
        for item_id in active_item_ids
    ]
    # 4. Generate cot
    new_thoughts_batch = self.generator.generate(input_prompts, stop=['.', '\n'])
    # 5. determine loop or end
    new_active_item_ids = []
    for idx, item_id in enumerate(active_item_ids):
        new_thought = new_thoughts_batch[idx]
        batch_thoughts[item_id].append(new_thought)
        items[item_id].update_output(
                f'intermediate_output_iter{iter_num}', 
                {
                    'input_prompt': input_prompts[idx],
                    'new_thought': new_thought,
                },
            )
        if "So the answer is:" not in new_thought:
            new_active_item_ids.append(item_id)
    # 6. contiue loop
    active_item_ids = new_active_item_ids
    if active_item_ids:
        new_thoughts_for_retrieval = [batch_thoughts[item_id][-1] for item_id in active_item_ids]
        new_retrieval_results, new_scoress = self.retriever.batch_search(new_thoughts_for_retrieval, return_score=True)
        for i, item_id in enumerate(active_item_ids):
            new_retrieval_result, new_scores = new_retrieval_results[i],new_scoress[i]
            for doc_item, score in zip(new_retrieval_result, new_scores):
                doc_id = doc_item['id']
                id2doc_batch[item_id][doc_id] = doc_item
                if doc_id in doc2score_batch[item_id]:
                    doc2score_batch[item_id][doc_id] = max(doc2score_batch[item_id][doc_id], score)
                else:
                    doc2score_batch[item_id][doc_id] = score
            sorted_doc_score = sorted(doc2score_batch[item_id].items(), key=lambda x: x[1], reverse=False)
            sorted_doc_id = [t[0] for t in sorted_doc_score]
            batch_retrieval_results[item_id] = [id2doc_batch[item_id][id] for id in sorted_doc_id]
    iter_num += 1
# 7. Stop and save results
for item_id, item in enumerate(items):
    item.update_output('retrieval_result', batch_retrieval_results[item_id])
    item.update_output('pred', ' '.join(batch_thoughts[item_id]))
UltraRAG
YAMLBranch + Loop
# 1. Initial retrieval
- benchmark.get_data
- loop:
    times: 2
    # 2. Start the iterative process
    steps:
    - retriever.retriever_deploy_search
    # 3. Construct prompts
    - prompt.ircot_next_prompt
    # 4. Generate cot
    - generation.generate
    # 5. determine loop or end
    - branch:
        router:
        - router.ircot_check_end
        branches:
          # 6. contiue loop
          incomplete:
          - custom.ircot_get_first_sent
          # 7. Stop and save results
          complete: []
- retriever.retriever_deploy_search
- prompt.ircot_next_prompt
- generation.generate
- custom.ircot_extract_ans
    

FlashRAG vs. UltraRAG: A Comparison in Code Implementation

Simplicity with Power: High-Performance RAG in Dozens of Lines

In UltraRAG 2.0, simplicity never comes at the cost of functionality. With the MCP architecture and flexible YAML workflows, it empowers researchers with a high-performance, scalable platform. Complex multi-stage reasoning systems—like DeepResearch—can be built in minutes, supporting dynamic retrieval, conditional logic, and multi-turn interactions.

In our example, Retriever, Generation, and Router modules are orchestrated with YAML to form a reasoning workflow featuring both loops and conditional branches. It covers essential steps like plan generation, knowledge structuring, and sub-question creation—achieved in less than 100 lines of code.

Workflow demo

Illustration of System Workflow

In terms of performance, the system achieves a ~12% improvement over Vanilla RAG on complex multi-hop questions, demonstrating the potential of UltraRAG 2.0 for rapidly building advanced reasoning systems.

Performance

Performance of the Example System

Below are cases generated by our example system for two real user questions from RedNote platform.

Case 1: Job Hunting for EIE Graduate

Case 1

Electronics & Information Job Hunting in the Fall

❓Problem Input

My background is roughly as follows: I didn’t study well during my undergraduate years and had poor grades. Later, I went on to a one-year master’s program that wasn’t very rigorous. During my master’s, my grades improved, but I didn’t really gain much solid knowledge. I only have one internship experience and no projects. Now I feel that finding a technical position is very difficult for me. I’m feeling quite lost and would appreciate some career direction advice. #freshgraduatejobsearch #freshgraduate #campusrecruitment #Fall2026 #masterprogram

✅Model Output

Career Guidance for Electronics and Information Engineering Graduates in Fall Recruitment

Job Market Analysis

Fresh graduates in Electronics and Information Engineering often face multiple challenges during job hunting. A lack of focus during undergraduate studies and poor academic performance can lead to weak fundamentals and limited theoretical grounding. Although grades may improve at the master’s level, many programs are considered less rigorous, offering limited opportunities for genuine technical growth and systematic training[1]. Internship experience is often narrow, with little exposure to real-world projects or technical depth, making it difficult to stand out in technical roles. Meanwhile, the industry’s expectations for technical competence are rising. With the rapid adoption of AI and other emerging technologies, the demand for entry-level technical positions has decreased, further intensifying the challenges for graduates[2]. Therefore, job seekers must acknowledge gaps in their technical skill sets while actively seeking employment directions aligned with their background to enhance competitiveness.

Industry Overview: Fall 2026 Recruitment

The Fall 2026 recruitment season in the electronics and information industry is characterized by strong demand for technical talent, especially in AI-related roles. Leading internet companies such as Alibaba, ByteDance, Tencent, and Meituan are all expanding hiring, with technical positions forming the core. For example, ByteDance plans to recruit over 5,000 positions, with a significant share in R&D, and particularly strong demand growth in algorithms and front-end development; Alibaba has increased the proportion of AI-related roles to over 60%[3]. Core requirements for fresh graduates center around technical ability, project experience, and proficiency in AI tools[4]. Internship experience has also become a critical screening criterion—undergraduates with internships at top tech firms are sometimes preferred over graduates from elite universities without such experience. In addition, non-technical roles now also require higher levels of digital literacy, such as the ability to use AI tools for data analysis or content creation.

Exploring Career Directions

For graduates with weak fundamentals at the undergraduate level, less rigorous master’s programs, and limited internship experience, competitiveness in purely technical roles is indeed constrained. However, multiple pathways remain available. One option is to consider technical positions that place less emphasis on project experience, such as embedded software engineer, hardware testing engineer, or technical support engineer—roles that value practical skills and hands-on ability over complex project portfolios[5]. Another option is non-technical positions, such as product manager, marketing operations, or sales support, particularly roles where a technical background is valued but communication skills and market awareness are more important. Furthermore, the electronics and information background provides advantages in cross-industry opportunities, such as working in consumer electronics, smart hardware, or new energy companies in roles like product planning, technical support, or customer service[6]. With careful presentation of internship experience and targeted skill-building, graduates can still secure suitable positions in the fall recruitment season.

Resume and Interview Preparation

When optimizing resumes, graduates should highlight internship experience and strategically compensate for a lack of project work. Internship descriptions should be specific and measurable, emphasizing the tools learned, tasks completed, and concrete contributions to the team or project[7]. If project experience is lacking, candidates can highlight coursework, competitions, or open-source contributions, framing them as projects and emphasizing technical challenges and solutions[8]. The skills section should be tailored to match job requirements, listing only relevant abilities rather than generic skills. Clear and concise formatting should be used to highlight key information for recruiters. For interviews, candidates should be well-prepared to discuss resume content in depth, confidently articulating internship and project experience while also demonstrating enthusiasm and understanding of the target role.

Mindset and Resource Support

During the job search, graduates in Electronics and Information Engineering often feel lost or anxious, especially in the face of intense competition and uncertainty about the future. It is important to cultivate a growth mindset, recognizing that abilities can improve through effort rather than being fixed[9]. Graduates should also leverage weak-tie networks by attending events and engaging with people from diverse backgrounds to expand opportunities. Maintaining a positive mindset is essential—through sports, socializing, or self-expression—to relieve stress and avoid “giving up.” In addition, resources such as university career centers, alumni networks, and counseling services can provide valuable guidance and support[10]. Most importantly, setting clear goals and actionable plans will help graduates steadily build competitiveness and approach the fall recruitment season with greater confidence and resilience.

Reference
  1. CSDN Blog: Job Hunting Reflections of 2024 Electronics and Information Graduates. Link
  2. WeChat: Detailed Explanation of 12 Areas in the Electronics (0854) Professional Degree and Employment Directions. Link
  3. WeChat: Graduation Season | How to Get a Dream Offer! Link
  4. WeChat: Job Hunting Stories of Nanjing University of Aeronautics and Astronautics Graduate Students. Link
  5. MBAChina: How to Secure an Ideal Offer—Career Experience Sharing from Central South University Students. Link
  6. Hangzhou Dianzi University: Graduate Story of 2025 Class—Dreams Take Flight, Strive for Success. Link
  7. Nowcoder: Why Did I Get Zero Offers Despite Three Years of Self-Learning and Coding Practice? Link
  8. WeChat: Graduation Season | How to Get a Dream Offer! Link
  9. WeChat: Job Hunting Stories of Nanjing University of Aeronautics and Astronautics Graduate Students. Link
  10. CSDN Blog: Job Hunting Reflections of 2024 Electronics and Information Graduates. Link

Case 2: College Application Decision

Case 2

NCO School vs. Associate + Conscription

❓Problem Input

My younger brother just finished the college entrance exam and is about to choose his path. Which is better: enrolling in an NCO (non-commissioned officer) school or going through a junior college program with compulsory military service? Any advice from those with experience? #JustAsking #NeedAdvice #Xiaohongshu

✅Model Output

Analysis of Pros and Cons Between NCO Schools and Junior Colleges with Conscription, and Suggestions for Choosing

Understanding the Basic Definitions and Features

NCO schools are a type of military academy, primarily recruiting active-duty soldiers to cultivate non-commissioned officers with strong technical expertise[1]. These schools feature strict military training and professional courses, aiming to supply the military with highly skilled technical personnel. Students enter as active-duty soldiers, receive military-style management and technical training, and directly serve in the military upon graduation.

Meaning and Policy Requirements of Junior College with Conscription
This pathway refers to candidates enrolling in designated NCO training programs through the national college entrance examination. Students spend 2.5 years at a civilian college, followed by a half-year of military internship and training[2]. After graduation, they directly become NCOs with full benefits. Applicants must pass physical and political examinations to be admitted, and are generally restricted to recent high school graduates, under 20 years old, and unmarried[3].

Similarities and Differences
Both paths aim to cultivate professional NCOs. The difference lies in admissions and training models: NCO schools admit active-duty soldiers, while junior college conscription recruits through the college entrance exam. The former emphasizes military-focused training, whereas the latter blends civilian higher education with military internship, offering more flexibility.

Analyzing Advantages and Disadvantages

Advantages and Limitations of NCO Schools
NCO schools offer immediate military status upon enrollment, stable treatment, strict management, and targeted technical training. Graduates transition directly into service without employment concerns, and promotion paths within the military are well-defined[1]. However, enrollment is limited to active-duty soldiers, excluding most high school graduates. The lifestyle is demanding and intense, suitable only for those with strong military aspirations and physical fitness.

Advantages and Risks of Junior College Conscription
The main advantage is accessibility: students can enter via the college entrance exam, receive tuition reimbursement, and directly become NCOs after graduation[5]. It suits candidates with modest scores but strong interest in a military career. The system provides both civilian education and military adaptation. Risks include strict health and political checks, as well as the demanding discipline of military life[6].

Impact on Future Career Development
NCO school graduates typically pursue long-term military careers with clear promotion tracks. Junior college conscription graduates may choose to continue serving or retire after a set number of years, benefiting from government resettlement or pursuing civilian careers[7]. Both enjoy stable treatment upon becoming NCOs, but the junior college pathway offers more flexibility for post-service transitions.

Developing a Choice Strategy Based on Personal Circumstances

Candidates should consider family background, interests, and financial situation. Families seeking stability may prefer either option since both ensure tuition reimbursement, direct service, and stable benefits[8]. Passion for military life, discipline, and resilience are also crucial: those with strong motivation will thrive[9]. For students less interested in military careers, or who aim for broader civilian opportunities, these pathways may be less suitable. Students from financially secure families may choose general higher education first, postponing military service decisions.

Insights and Suggestions from Experienced Individuals

Graduates of designated NCO training programs serve directly in the military, with clear promotion pathways. However, service commitments are often lengthy, typically 5 years or more, with some requiring up to 12 years before transfer[10]. NCO school graduates enjoy stability but must adapt well to strict discipline. Junior college conscription offers more flexibility—students may retire after 2 years, though their technical skills may have limited civilian application. Many experienced voices suggest NCO schools or designated NCO programs for those seeking long-term stability, while junior college conscription is more suitable for those wanting short-term service or the experience of military life[11].

Final Decision-Making and Action Guide

When deciding, candidates should weigh personal interests, family conditions, and career goals. Those committed to long-term military service with strong adaptability should choose NCO schools or designated training programs[12]. Those who prefer a blend of civilian education and military experience may opt for junior college conscription. Candidates should ensure they meet health and political requirements, prepare documentation in advance, and choose schools and majors aligning with their strengths[13]. Ultimately, whichever path is chosen, having clear career goals and preparation is essential for future success.

Reference
  1. Lejian Education: Analysis of Why NCO Schools Are Less Popular and Transfer Possibilities. Link
  2. Zhiyou Service: Differences Between Designated NCO Training and Junior College Conscription. Link
  3. Sohu: Is Enrolling in an NCO School After the College Entrance Exam a Good Choice? Link
  4. PLA WeChat: Advantages of Joining the Army After College Graduation (Junior College & Undergraduate). Link
  5. Tencent News: Is Designated NCO Training Worth Applying For? Pros and Cons. Link
  6. Liaoning Transportation Vocational College: Policy Explanation for Armed Police Designated NCO Training. Link
  7. Zhangshang Gaokao: Elimination Rates and Situations in Designated NCO Training. Link
  8. Hanbo Admissions: Elimination Rates and Common Reasons During Designated NCO Training. Link
  9. WeChat (Congyu Career Planning): Four Key Differences Between Designated NCO Training and Conscription. Link
  10. Sohu: The Path of Candidates with 300–450 Exam Scores: Designated NCO Training vs. Junior College Conscription. Link
  11. Jinzhou Military Entrepreneurship: Three Major Advantages of Joining the Army After College Graduation. Link
  12. Linghang Education: Where Do NCO School Graduates Go? Analysis of Technical, Management, and Cross-Branch Assignments. Link
  13. Bilibili: Is It Easier to Enter NCO Schools Compared to Officer Schools? Link

Showcase of System-Generated Cases

UltraRAG 2.0 makes building complex reasoning systems truly low-code, high-performance, and production-ready. Beyond boosting performance in research, it also empowers rapid deployment in real-world applications such as customer service, education, and healthcare, providing more reliable knowledge-augmented answers.

The Secret Sauce: MCP Architecture and Native Pipeline Control

In different RAG systems, core capabilities such as retrieval and generation share high functional similarity, but due to diverse implementation strategies by developers, modules often lack unified interfaces, making cross-project reuse difficult. The Model Context Protocol (MCP) is an open protocol that standardizes the way to provide context for large language models (LLMs) and adopts a Client–Server architecture, enabling MCP-compliant Server components to be seamlessly reused across different systems.

Inspired by this, UltraRAG 2.0 is based on the MCP architecture, abstracting and encapsulating core functions such as retrieval, generation, and evaluation in RAG systems into independent MCP Servers, and invoking them through standardized function-level Tool interfaces. This design ensures flexible module function extension and allows new modules to be “hot-plugged” without invasive modifications to global code. In scientific research scenarios, this architecture enables researchers to quickly adapt new models or algorithms with minimal code while maintaining overall system stability and consistency.

Architecture

Illustration of the UltraRAG 2.0 Framework

Developing complex RAG inference frameworks is significantly challenging. UltraRAG 2.0’s ability to support complex systems under low-code conditions lies in its native support for multi-structured pipeline workflow control. Whether sequential, loop, or conditional branching, all control logic can be defined and orchestrated at the YAML level, covering various workflow expression forms needed for complex inference tasks. During runtime, inference workflow scheduling is executed by the built-in Client, whose logic is fully described by user-written external Pipeline YAML scripts, achieving decoupling from the underlying implementation. Developers can call instructions like loop and step as if using programming language keywords, quickly constructing multi-stage inference workflows in a declarative manner.

Sequential
YAML Sequential
# Sequential: Tools are executed in order
pipeline:
- benchmark.get_data
- retriever.retriever_deploy_search
- prompt.qa_rag_boxed
- generation.generate
- custom.output_extract_from_boxed
- evaluation.evaluate
Loop
YAML Loop
# Loop: Iteratively execute a group of tools
pipeline:
- benchmark.get_data
- retriever.retriever_deploy_search
- loop:
    times: 3  
    steps: 
      - prompt.generate_subquery
      - generation.generate  
      - retriever.retriever_deploy_search
- prompt.generate_answer
- generation.generate
- evaluation.evaluate
  
Branch
YAML Branch-Router
# Branch: Execute different tools based on routing results
pipeline:
- benchmark.get_data
- retriever.retriever_deploy_search
- loop:
    times: 3         
    steps:
    - prompt.generate_query_or_answer
    - generation.generate
    - branch:
        router:
          - router.check_query_or_answer   
        branches:
          is_query:
            - retriever.retriever_deploy_search
          is_answer: []    
- evaluation.evaluate
      

Multi-structured Pipeline Control: Sequential, Loop, and Branching

By deeply integrating the MCP architecture with native workflow control, UltraRAG 2.0 makes building complex RAG systems as natural and efficient as “orchestrating workflows.” Additionally, the framework includes 17 mainstream benchmark tasks and multiple high-quality baselines, combined with a unified evaluation system and knowledge base support, further enhancing system development efficiency and experiment reproducibility.

Explore the tutorials and start building with UltraRAG 2.0!