UltraRAG Documentation

repository·main·Indexed 26 days ago

https://github.com/openbmb/ultrarag

A lightweight RAG development framework for research and industrial prototyping. UltraRAG utilizes a Model Context Protocol (MCP) architecture to decouple components into independent servers, enabling complex workflow orchestration via YAML configuration and a visual IDE. It features a Pipeline Builder for bidirectional synchronization between canvas and code, built-in evaluation workflows, and a structured four-layer debugging method covering Input & Retrieval, Reasoning & Planning, State & Context, and Deployment & Runtime.

Tokens
17K
Snippets
22
Records
132
Agent score
90%

What's inside UltraRAG

  1. Overview of UltraRAG Architecture and Features

    main

    UltraRAG is a lightweight RAG (Retrieval-Augmented Generation) development framework based on the Model Context Protocol (MCP) architecture.

    Core Concepts

    • MCP Servers: Standardized core RAG components (Retriever, Generation, etc.) act as independent servers.
    • MCP Client: Orchestrates workflows using the components.
    • Low-Code Orchestration: Complex control structures like sequential execution, loops, and conditional branches are implemented via YAML configuration files.

    Key Capabilities

    • Modular Extension: New features can be registered as function-level Tools to integrate into workflows.
    • UltraRAG UI: A visual RAG IDE featuring a Pipeline Builder for bidirectional synchronization between canvas construction and code editing, and an Intelligent AI Assistant for parameter tuning.
    • Rapid Prototyping: Pipeline logic can be converted into interactive conversational Web UIs with a single command.
    • Unified Evaluation: Built-in standardized evaluation workflows and mainstream research benchmarks.
  2. Overview of UltraRAG

    main
    UltraRAG is a lightweight RAG (Retrieval-Augmented Generation) development framework designed for research exploration and industrial prototyping. It is built on the Model Context Protocol (MCP) architecture, where core components like Retrievers and Generators are encapsulated as independent MCP Servers. Developers can orchestrate complex workflows (including loops and conditional branches) using YAML configurations managed by an MCP Client.
  3. Explore UltraRAG Research and Demo Workflows

    main

    UltraRAG provides specialized workflows for two primary user groups:

    For Researchers

    • Standard RAG Workflows: Quickly run experimental workflows.
    • Evaluation Datasets: Access public evaluation datasets and large-scale retrieval corpora for benchmark testing.
    • Case Analysis: Use the visual Case Study interface to track intermediate outputs and perform error attribution.
    • Structured Debugging: Troubleshoot across four layers: input & retrieval, reasoning & planning, state & context, and deployment & runtime.
    • Code Integration: Call UltraRAG components directly in Python for customized development.

    For Developers and End Users

    • UltraRAG UI: Start the UI and configure advanced settings in administrator mode.
    • Production Deployment: Set up Retriever, Generation models (LLM), and Milvus vector databases.
    • Deep Research Pipeline: Deploy a flagship case using the AgentCPM-Report model to automate multi-step retrieval and generate long-form survey reports.
  4. Report a security vulnerability in UltraRAG

    main

    If you discover a security vulnerability in UltraRAG, please report it privately to the development team via email. Do not disclose the vulnerability publicly until a fix has been released or the team has declined to address it.

    Steps to report:

    1. Send a detailed security report to ultarag.team@gmail.com.
    2. Describe the vulnerability in detail.
    3. If you have a potential fix, include it or a summary of it in your email.

    The team will evaluate the report, contact you with the outcome, and provide credit in the report if a fix is released.

  5. Troubleshoot UltraRAG workflows using the four-layer method

    main

    When encountering issues like suspicious answers, drifting multi-step workflows, or inconsistent deployment results, use the structured four-layer troubleshooting method to isolate the root cause before applying fixes.

    Troubleshooting Principles

    1. Locate the layer before modifying implementation: Identify if the issue is in Input/Retrieval, Reasoning/Planning, State/Context, or Deployment/Runtime. Only modify the suspected layer.
    2. Prioritize intermediate outputs: Do not just look at the final answer. Check if the user input was parsed correctly, if the query was rewritten accurately, if retrieved chunks support the question, and if intermediate states were lost.
    3. Apply minimal fixes: Change only one parameter or prompt at a time to confirm exactly what fixed the issue.
    4. Treat "model issues" as "workflow issues" first: Many errors are caused by retrieval, prompt construction, state inheritance, or deployment configuration rather than the model's inherent capability.
  6. Set up UltraRAG Frontend for local development

    main

    To develop the UltraRAG frontend locally, you must run both the backend and the frontend dev server in separate terminals. The Vite dev server is configured to proxy /api requests to http://127.0.0.1:5050.

    # Terminal 1: Start backend
    ultrarag show ui --host 127.0.0.1 --port 5050
    
    # Terminal 2: Start frontend dev server
    cd ui/frontend
    npm install
    npm run dev
  7. Install UltraRAG via Docker

    main

    If you prefer not to configure a local Python environment, you can use Docker to deploy UltraRAG.

    1. Get Code and Images

    git clone https://github.com/OpenBMB/UltraRAG.git --depth 1
    cd UltraRAG

    2. Prepare Image (Choose one)

    Option A: Pull from Docker Hub

    • Base (CPU): docker pull hdxin2002/ultrarag:v0.3.0-base-cpu
    • Base (GPU): docker pull hdxin2002/ultrarag:v0.3.0-base-gpu
    • Full (GPU): docker pull hdxin2002/ultrarag:v0.3.0

    Option B: Build locally

    docker build -t ultrarag:v0.3.0 .

    3. Start Container

    Run the container with port 5050 mapped. If using GPU, include the --gpus all flag:

    docker run -it --gpus all -p 5050:5050 <docker_image_name>

    Once started, the UltraRAG UI is automatically running and accessible at http://localhost:5050.

  8. Verify UltraRAG Installation

    main

    After installation, verify that your environment is correctly configured by running the provided hello-world example command:

    ultrarag run examples/experiments/sayhello.yaml

    If successful, the output should be: Hello, UltraRAG v3!

    ultrarag run examples/experiments/sayhello.yaml
  9. Install UltraRAG via Source Code (using uv)

    main

    The recommended way to install UltraRAG is using uv for Python environment and dependency management.

    1. Prepare Environment

    Install uv first:

    pip install uv
    # OR
    curl -LsSf https://astral.sh/uv/install.sh | sh

    2. Download Source

    git clone https://github.com/OpenBMB/UltraRAG.git --depth 1
    cd UltraRAG

    3. Install Dependencies

    Choose one of the following modes:

    Option A: Create a new environment (using uv sync)

    • Core dependencies only (e.g., for UltraRAG UI):
      uv sync
    • Full installation (Retrieval, Generation, Corpus processing, and Evaluation):
      uv sync --all-extras
    • On-demand installation (specific modules):
      uv sync --extra retriever   # retriever module
      uv sync --extra generation  # generation module

    After installation, activate the virtual environment:

    • Windows CMD: .venv\Scripts\activate.bat
    • Windows Powershell: .venv\Scripts\Activate.ps1
    • macOS / Linux: source .venv/bin/activate

    Option B: Install into an existing environment (using uv pip)

    • Core: uv pip install -e .
    • Full: uv pip install -e ".[all]"
    • On-demand: uv pip install -e ".[retriever]"
    # Example: Full installation with uv sync
    git clone https://github.com/OpenBMB/UltraRAG.git --depth 1
    cd UltraRAG
    uv sync --all-extras
    source .venv/bin/activate
  10. Use the Frontend Mobile Optimization Baseline for Regression Testing

    main

    When applying mobile-only optimizations to the UltraRAG frontend, use this baseline to ensure that desktop UX remains unchanged. This baseline covers the /chat route and specific UI components.

    Scope of Testing

    • Route: /chat
    • Main Page: ui/frontend/src/pages/ChatPage.tsx
    • Desktop Layout Styles: ui/frontend/public/theme/style.css
    • Dialog and Shared UI Styles: ui/frontend/src/app/styles/globals.css

    Desktop Regression Checklist

    Ensure the following behaviors remain intact after mobile optimizations:

    • Sidebar: Collapse/expand functionality and session list interactions (open, rename, delete).
    • Header: Pipeline selector layout/dropdown and Status badge (Ready / Loading / Failed) positioning.
    • Chat Area: Message list spacing, scroll behavior, input container layout, send/stop button positions, and KB selector behavior.
    • Menus & Dialogs: Settings dropdown, language submenu, Auth dialog, and Account settings dialog (dimensions and scrolling).
    • Detail Panel: Reference detail sidebar open/close behavior.
    • Chat Flow: Citation click and detail panel interaction.
  11. Contact UltraRAG Support and Community

    main

    For technical issues, feature requests, or general feedback regarding UltraRAG, use the following channels:

    • Technical Issues & Feature Requests: Open a GitHub Issue.
    • Community Discussion: Join the WeChat, Feishu, or Discord groups for discussions on RAG technology and usage.
    • Direct Contact: Send emails to yanyk.thu@gmail.com for questions or feedback.