tracing.mdx


Overview

This documentation page introduces and explains the Tracing functionality integrated within the RAGFlow application via Langfuse, a specialized observability and tracing platform. The file outlines how RAGFlow users can enable detailed tracing of retrieval-augmented generation (RAG) pipelines to inspect, debug, and analyze every step—from retrieval through generation—in near real-time.

The primary purpose of this file is to guide users through:

This page is written in Markdown with embedded HTML and images, intended to be part of RAGFlow’s documentation site.


Detailed Content Breakdown

1. Introduction to Langfuse Tracing Integration


2. Credentials Collection for Langfuse

Purpose: To obtain the authentication credentials required to connect RAGFlow to Langfuse.

Process:

Key points:


3. Adding Langfuse Credentials to RAGFlow

Purpose: To configure RAGFlow with Langfuse credentials so it can send trace data.

How to configure:

Result:
RAGFlow begins emitting tracing data automatically without requiring code changes.


4. Running Pipelines and Viewing Traces

Purpose: To demonstrate how to observe trace data generated by RAGFlow pipelines.

Steps:

What you see:

Tip:
Use Langfuse’s diff views and drill-down capabilities to compare prompt versions and identify bottlenecks.


Implementation Details and Algorithms

This documentation file does not contain executable code or implement algorithms directly. Instead, it provides user guidance on configuring and using Langfuse tracing with RAGFlow. The underlying Langfuse integration leverages OpenTelemetry or a similar tracing standard to emit spans and traces from the RAGFlow backend.

The tracing data model includes:

The workflow is:


Interaction with Other System Components


Usage Examples

Configuring Langfuse Credentials in RAGFlow UI

  1. Navigate to API section in RAGFlow web UI.

  2. Scroll to Langfuse Configuration.

  3. Enter:

    • Host: https://cloud.langfuse.com

    • Public Key: abc123publickey

    • Secret Key: def456secretkey

  4. Click Save.

Viewing Traces


Visual Diagram

The file primarily describes a workflow involving user actions and data flow between RAGFlow and Langfuse. Below is a flowchart showing the key functions and interactions described in this documentation.

flowchart TD
    A[User] -->|1. Get Langfuse keys| B[Langfuse Dashboard]
    B -->|Project Public & Secret Keys| A
    A -->|2. Configure keys| C[RAGFlow Web UI]
    C -->|Save Keys| D[RAGFlow Backend]
    D -->|Emit Trace Data| E[Langfuse Backend]
    A -->|3. Run Pipeline| D
    A -->|4. View Traces| E
    E -->|Visualize & Analyze| A

Summary

This documentation file, tracing.mdx, serves as a comprehensive user guide for enabling and using Langfuse tracing within the RAGFlow platform. It covers credential setup, configuration, usage, and benefits of tracing for observability of retrieval-augmented generation pipelines. The integrated workflow empowers users to monitor, debug, and optimize their AI pipelines with minimal setup effort.


End of tracing.mdx documentation.