RAGFlow and Langfuse integration

Connect RAGFlow to your self-hosted Langfuse so interactive, scheduled and API retrieval runs appear as traces you can debug. This page covers the native integration, its prerequisites, configuration sequence and failure points.

On this page

How RAGFlow's native Langfuse integration traces retrieval runs

A team running RAGFlow knowledge bases usually needs one answer first: why a particular answer was poor. RAGFlow has a native Langfuse integration, configured in its API settings after an LLM has been set up in RAGFlow. Once it is enabled, the integration covers interactive UI runs, scheduled jobs and API calls, so the traces you review in Langfuse come from the same paths your users and automations take. Confirm in your own RAGFlow version that the settings screen and the covered run types match the Langfuse RAGFlow documentation before you plan around them.

The data flow is straightforward to describe. RAGFlow sends trace data for each covered run to the Langfuse host and key you enter in its settings, so the host must be your self-hosted Langfuse instance, reachable from wherever RAGFlow runs. Langfuse Web receives the data and Langfuse Worker processes it asynchronously into the stores that your deployment runs, including ClickHouse for trace analytics. Ask your RAGFlow operators which project keys they will use, whether one key covers all knowledge bases or each team has its own project, and where the RAGFlow container and the Langfuse endpoint sit on your network, since egress rules often decide whether traces arrive at all.

The integration does not replace the checks you still need. Langfuse shows what was sent and returned at the points the integration instruments, but it does not validate your documents, chunking choices or answer correctness, and it does not give you an independent quality score. Keep your own evaluation set, record which RAGFlow version and knowledge base configuration produced each run, and plan who reviews traces when answers degrade. Treat the trace as evidence for a diagnosis, then confirm the cause by re-running the same question against a changed setting.

What you need running before you connect RAGFlow to Langfuse

The integration is a configuration step, but it only works when both platforms are already healthy and can reach each other. Confirm the Langfuse stack, the RAGFlow host sizing and the network path first, so that a missing trace is not confused with a broken integration.

Self-hosted Langfuse stack

Langfuse needs its Web and Worker containers running, with PostgreSQL, ClickHouse, Redis or Valkey and S3-compatible blob storage behind them. RAGFlow sends traces to Langfuse's ingestion path, so a Worker that is down or a ClickHouse that is out of disk will make traces look missing even though RAGFlow is sending them. Check that the UI loads and that the instance is healthy before you touch RAGFlow.

Langfuse self-hosting docs

RAGFlow host sizing

The RAGFlow README recommends starting with 4 CPU cores, 16 GB of RAM and 50 GB of disk. RAGFlow runs its own dependency services, including a document engine, MySQL, MinIO, NATS and Kvrocks, and DeepDoc layout analysis and OCR run on CPU in the 1.0 open-source release, so ingestion-heavy workloads will need more than the starting figures. Treat these numbers as a floor and measure before you commit to a size.

Docker and Compose versions

Install Docker 24.0.0 or later and Docker Compose v2.26.1 or later on the RAGFlow host. Older Docker or Compose releases can fail on the stack's compose file in ways that look like application errors. The README also notes that macOS is not currently supported for the RAGFlow Docker image, so use a Linux host or VM for any environment that will carry traces.

RAGFlow version to confirm

The latest release supplied for this guide is v1.0.0-rc2, published October 16, 2026, and the release candidate line followed v0.27.2. Confirm the exact tag you will deploy on the RAGFlow releases page and record it with your change ticket. Release candidates can change configuration, so pin the version rather than tracking a moving image tag.

RAGFlow releases

Langfuse project keys

In Langfuse, create a project and generate a public and secret API key pair for it. RAGFlow asks for these keys in its API settings after an LLM is configured, so keep them in your secrets manager rather than in a compose file committed to source control. Use a separate project for test traces so that experiments do not mix with production retrieval data.

Network reachability to Langfuse

The RAGFlow containers must resolve and reach the Langfuse host name on the port that serves its UI and API. Test from inside the RAGFlow container, not only from the host, because Docker networks, proxies and firewall rules often differ between the two. If Langfuse sits behind a private load balancer or a TLS certificate issued by an internal CA, confirm that the RAGFlow container trusts that certificate before you configure keys.

Configure Langfuse keys and host in RAGFlow API settings

This sequence connects a RAGFlow instance to your self-hosted Langfuse project and proves that interactive, scheduled and API runs all reach the tracing UI.

  1. Confirm the Langfuse host and project

    Your platform or AI team confirms the base URL of your self-hosted Langfuse instance, which must be reachable from the network where RAGFlow runs, and selects the project that will receive RAGFlow traces. Keep the project separate from production application traces if your governance model requires it. Done when someone with a Langfuse login opens the project's tracing page over the same network path RAGFlow will use.

  2. Create project API keys in Langfuse

    A project member with permission to manage API keys creates a public and secret key pair for the chosen project in the Langfuse project settings. Record the secret key in your organization's approved secret store, since it is shown in full only at creation. Done when you hold both keys and the key pair is listed under the project's API keys with a name that identifies RAGFlow as the consumer.

  3. Configure an LLM in RAGFlow first

    A RAGFlow administrator adds and tests at least one language model provider in RAGFlow's model settings before touching the Langfuse integration, because RAGFlow exposes the Langfuse configuration only after an LLM is set up. Confirm the model answers a simple prompt in RAGFlow. Done when the model is listed as configured and a test call succeeds, which means the Langfuse section of the API settings is now available.

  4. Enter the Langfuse host and keys in RAGFlow

    In RAGFlow's API settings, the administrator enters the Langfuse host URL confirmed in the first step along with the public and secret keys from the second step, then saves the configuration. Check the exact field labels against the version you run, since the integration is documented in Langfuse's RAGFlow guide. Done when the settings save without an error and reopening the panel shows the host and public key populated, with the secret masked.

  5. Run one interactive UI query

    A user runs a query in a RAGFlow chat or search session that uses a knowledge base with the configured LLM, so the retrieval and generation steps execute as they would for a normal user. Note the time and the query text used for later matching. Done when the query returns an answer in RAGFlow and a new trace with the matching input appears in the Langfuse tracing UI under the selected project.

  6. Run one scheduled job

    Trigger a RAGFlow run that executes without a user session, such as a scheduled task that uses the same knowledge base and model, and let it complete. Scheduled runs are a separate entry point that the Langfuse integration covers, so test them rather than assuming coverage. Done when the job finishes in RAGFlow and a trace from the scheduled run appears in Langfuse, distinguishable from the interactive trace by its input or metadata.

  7. Make one API call and verify all three traces

    Send one request to the RAGFlow API using a valid RAGFlow credential, then open the Langfuse tracing UI and confirm that the three runs, interactive, scheduled and API, each appear as a trace with retrieval and generation spans. If a run is missing, check the host, the key pair, network reachability from the RAGFlow containers and the RAGFlow logs before retrying. Done when all three traces are visible in the selected project and the sequence is recorded as passed.

Which RAGFlow run types appear in Langfuse and how to verify each

Interactive runs are the ones a person starts from the RAGFlow web interface, such as testing a knowledge base or a chat assistant. The Langfuse RAGFlow documentation describes setting up the integration in the RAGFlow API settings after an LLM is configured, and it states that interactive UI runs are covered. Verify these runs first because they are the simplest to reproduce.

  • Prepare the settings: Confirm the LLM is configured in RAGFlow before you enter the Langfuse keys and the host of your self-hosted instance.
  • Send one known question: Use a test question with a distinctive phrase so you can find the trace by its text in Langfuse.
  • Check where the trace lands: The trace should appear in the Langfuse project that owns the keys you entered. Inspect which steps it contains before assuming full coverage.
  • Check the host: If nothing arrives, confirm the RAGFlow server can reach your Langfuse host over the network and that the host value has no typo or wrong port.
  • Check the keys: Keys from another project, or keys that were rotated or deleted, will send traces to a place you are not watching.

Confirm that the trace appears in the expected project and time window, then check that the retrieval steps show the chunks you expected.

How RAGFlow run data maps to Langfuse traces, sessions and scores

This table pairs the main RAGFlow run objects with the Langfuse objects they most likely land in: traces, observations, user IDs, sessions, metadata and scores. Read the third column first, because the exact field mapping of the native integration should be verified in your own instance before you build dashboards or evaluations on it. Run one interactive chat, one scheduled job and one API call, then check each row against what appears in your Langfuse project.

RAGFlow conceptLangfuse conceptStatus and what to confirm
Chat or agent runTrace, one per runConfirm whether UI, scheduled and API runs each create a separate trace.
LLM call inside a runGeneration observation under the traceConfirm model name and token counts arrive. Cost needs a model price in Langfuse.
Knowledge base retrieval stepSpan or observation within the traceConfirm retrieval appears as its own observation with its query and settings.
Retrieved chunks and citationsObservation input and output, or metadataConfirm where chunk text and citation IDs are stored and whether masking applies.
Signed-in user or API callerUser IDConfirm which identity RAGFlow sends. An API key may map to a shared service user.
Multi-turn conversationSession IDConfirm RAGFlow groups turns into one session. If it does not, plan grouping by metadata.
Scheduled job or knowledge base nameMetadata key on the traceConfirm the field names and that they can be filtered in the Langfuse UI.
Answer quality judgmentsScores attached to the traceConfirm whether RAGFlow sends any scores by default. Otherwise add them through feedback or evaluators.

Securing the RAGFlow to Langfuse connection

A RAGFlow to Langfuse connection moves prompts, retrieved passages and model answers into a second system, so it inherits security obligations from both. The cards below cover the credentials that link them, the access around them and the content that ends up in traces.

Protect the Langfuse secret key in RAGFlow

RAGFlow stores the Langfuse keys in its API settings after an LLM is configured, so anyone who can read those settings can send or read traces under that project. Confirm where RAGFlow keeps the stored values, whether they appear in logs, exports or database backups, and who can view them. Plan a rotation procedure that updates RAGFlow and Langfuse together, and check that the key is not pasted into shared documentation or tickets.

RAGFlow docs

Scope keys to one project

Create a dedicated Langfuse project for RAGFlow traces and issue its keys only for that project. A key that covers other projects lets a compromised RAGFlow instance read prompts and traces from unrelated applications. Project-level RBAC roles, which the Langfuse license key docs list as an Enterprise feature, let you limit which Langfuse users can open the RAGFlow project. Confirm which role options your license tier provides before you design the access model.

Serve Langfuse only over TLS

RAGFlow sends trace data to the Langfuse host over the network, and the keys travel with each request. Terminate TLS at the Langfuse ingress or load balancer, use certificates issued by your internal or public CA, and point RAGFlow at the HTTPS address. Check that no path to the Langfuse web or worker containers accepts plain HTTP from outside your trusted network, and verify the certificate chain from the RAGFlow host, not only from a browser.

Restrict who can edit RAGFlow API settings

Whoever can edit the Langfuse configuration in RAGFlow can redirect traces to another host or swap in keys from a different project. Limit edit rights for the RAGFlow admin settings to a small named group, and record changes through your RAGFlow change process. Review who holds administrator access to the RAGFlow deployment itself, since that access also reaches the stored keys, and confirm that the RAGFlow admin accounts are protected by SSO and strong sign-in controls.

Assess what retrieved content exposes

RAGFlow traces can contain user questions, retrieved document chunks and generated answers, so a single trace may hold customer records, contract text or personal data taken from ingested files. Review which knowledge bases feed the pipeline and classify them before turning tracing on. Ask your team to test a sample trace in Langfuse and confirm which fields hold document text.

Mask and limit retention of traces

Server-side data masking and data retention policies are Enterprise license features in self-hosted Langfuse, so the controls that reduce exposure of retrieved content may depend on your license tier. If your tier does not include them, decide whether tracing for sensitive knowledge bases should be disabled, limited to a separate project, or run with a documented retention period set by operators. Ask the vendor to confirm the feature list for your specific edition before you commit to a design.

License key docs

Using traces to debug weak retrieval in RAGFlow

The first decision when an answer looks wrong is whether the failure happened in retrieval or in generation, because the fix for each is different. In a traced RAGFlow run, open the Langfuse trace for the failing question and compare two things side by side: the chunks the retrieval step returned and the answer the model produced from them. If the right information is absent from the retrieved chunks, the problem is retrieval, and changing the prompt or model will not repair it. If the right information is present but the answer ignores or misstates it, the problem sits in generation. Record this split for a sample of failing questions before changing any setting, so that you tune the component that is actually failing.

When retrieval is the suspect, check traceability before you change the index. RAGFlow's citations link each claim in an answer back to the source chunks, so a claim with no traceable chunk is a strong signal that the model drew on something other than retrieved context. Then open the chunk visualization in RAGFlow for the source document and review how it was split. Look for answers that span two chunks and therefore never appear whole, tables or headings separated from their content, and chunks that are too short to carry meaning. Document these findings against the template-based chunking choice used for that knowledge base, and confirm in your own environment which parser and template settings apply to each document type before you change them. Rerun the same questions after each change so the comparison stays controlled.

Why RAGFlow runs do not appear in Langfuse

This table lists the failures that most often leave RAGFlow runs missing from Langfuse, with the cause and fix for each. Work through the rows in order, since the first three checks (keys, LLM configuration and network path) account for most missing traces. Where a fix depends on a Langfuse setting, confirm the current behavior against the Langfuse operations documentation for your version.

Symptom or failureLikely causeFix
No traces at all after enabling the integrationWrong host URL, or public and secret keys copied from a different Langfuse projectConfirm the host in RAGFlow matches your self-hosted Langfuse address, then regenerate and re-enter the key pair from the project that should receive the traces
Integration saved but nothing appearsAn LLM was not configured in RAGFlow before the Langfuse integration was enabledConfigure the LLM first, then return to the API settings and enable or re-save the Langfuse integration
Requests fail with connection or certificate errors in RAGFlow logsNetwork path, proxy, firewall or TLS trust blocks traffic from the RAGFlow host to LangfuseTest connectivity from the RAGFlow container itself, not from your workstation, and add the internal certificate authority to the RAGFlow trust store if the Langfuse endpoint uses a private CA
Interactive UI runs traced but scheduled jobs are missingScheduled runs were not covered by your check, or the job ran before the integration was savedTrigger one scheduled job after the integration is saved, then check its run in Langfuse; re-run jobs created before the change if needed
API-triggered runs missing or partially tracedThe calling client sends requests to RAGFlow but the trace is incomplete, or the test used a different project or environmentCompare one API call against one UI run in the same Langfuse project and filter by time window and environment before assuming a fault
Traces arrive late or in burstsLangfuse ingestion backlog, with worker containers saturated under loadCheck worker CPU and queue health, scale the worker containers on CPU load as the Langfuse scaling guide recommends, and split web ingestion if volume is high
Traces stop after a platform upgradeVersion mismatch between RAGFlow, the Langfuse server and the Langfuse SDK or API expectationsConfirm the RAGFlow release and Langfuse version against each other's release notes, and complete any Langfuse migration steps before re-testing
Traces present but without expected inputs or outputsData masking or retention settings on the Langfuse side, which may need an Enterprise license key for some controlsReview masking configuration in Langfuse with the team that owns it, and confirm which features your license covers before changing settings

Questions buyers ask before connecting RAGFlow to Langfuse

Is there a native RAGFlow integration with Langfuse, and what does it cover?

Yes. RAGFlow has a native Langfuse integration that is configured in the RAGFlow API settings after an LLM is configured. According to Langfuse's documentation, it covers interactive UI runs, scheduled jobs and API calls, so traces from all three run types can reach your self-hosted Langfuse. Confirm the exact fields and the version you run against the Langfuse RAGFlow guide and your own RAGFlow build before you plan the rollout.

What does the team need to provide for this integration?

The integration needs a running self-hosted Langfuse instance reachable from RAGFlow, a Langfuse project with API keys, and a RAGFlow deployment with an LLM configured. On the Langfuse side, the deployment itself includes Langfuse Web, Langfuse Worker, PostgreSQL, ClickHouse, Redis or Valkey and S3-compatible blob storage. Your team should also decide who owns the keys, which network path RAGFlow uses to reach the Langfuse host, and who reviews traces that contain user documents or prompts.

Can our own team do this integration without an outside partner?

Often yes, because the setup is configuration rather than custom code. A team that already runs Docker or Kubernetes, manages secrets and can read RAGFlow logs can usually complete the key configuration and a first test run. The harder parts are the surrounding decisions: data retention for traces that contain document text, access to the Langfuse UI, and how RAGFlow's own dependencies (a document engine, MySQL, MinIO, NATS and Kvrocks) are sized alongside tracing. A partner is most useful when those decisions need to be documented for a compliance review.

How does effort change with RAGFlow run types and Langfuse topology?

Effort grows with the number of run types you want to trace and with how many environments send traces. Enabling UI runs alone is the smallest step. Scheduled jobs and API calls add more paths to verify, and each needs its own check that traces arrive with the expected names and metadata. On the Langfuse side, a single-VM Docker Compose test setup is simpler than a production Kubernetes deployment, and Langfuse's scaling guide says to scale workers on CPU load and split langfuse-web under heavy ingestion. Ask for the topology and run types in the quote so the verification scope is explicit.

What does a fixed-scope engagement for this integration cover?

A fixed-scope engagement is agreed in writing before work starts and lists the deliverables and timeline. For this integration, a typical scope would name the RAGFlow environments to connect, the run types to trace (UI, scheduled and API, as applicable), the Langfuse project structure, the key handling method, a verification checklist for each run type and a short operations note. Illustrative scope items are a test run with sample documents and a review of what appears in traces. Confirm with the vendor whether any Langfuse Enterprise features are needed for your governance requirements, since some of them require an Enterprise license key.

What should we request in a quote for RAGFlow and Langfuse?

Ask for a quote built from a written scope that names the following:

  • The RAGFlow version, deployment method and the environments in scope
  • The Langfuse topology, including whether it is a single VM test setup or a production deployment
  • The run types to trace and the verification steps for each
  • Who handles API key creation, secret storage and rotation
  • The handover material, such as configuration notes and a troubleshooting checklist
  • Any support period or retainer for upgrades when RAGFlow or Langfuse releases change

Also ask which items are one-time work and which recur. Upgrades of both products are separate work, so the quote should state whether they are included.

What version and upgrade risks should we check before connecting RAGFlow?

Check the version of each product against its current release notes before you configure anything. RAGFlow's GitHub releases list v1.0.0-rc2 published on October 16, 2026, and v1.0.0-rc1 published on September 29, 2026, after v0.27.2 on September 10, 2026. Langfuse's GitHub releases list v4.63.0, published October 16, 2026. Pin the versions you test, and confirm with each vendor whether the tracing configuration changes between the release you run and the one you plan to move to. Release candidates may change behavior, so test them in a non-production environment first.

How RAGFlow runs flow into self-hosted Langfuse

Requests start from UI users, scheduled jobs or API clients and reach RAGFlow, which calls its own LLM and retrieval services. The native Langfuse integration, configured in RAGFlow's API settings after an LLM is set up, sends traces over the network to Langfuse Web. Langfuse Worker then writes the data to ClickHouse, PostgreSQL and blob storage. Check that every hop that crosses a trust boundary uses the host and keys you intended, and that the Langfuse stores sit inside your own infrastructure.

RAGFlow traces reach self-hosted Langfuse through Web and Worker into its three stores.

How DeployOpen scopes and delivers the RAGFlow and Langfuse integration

DeployOpen plans, implements, hardens, documents and supports self-hosted open-source platforms inside your own infrastructure, including the Langfuse side of this integration. The work starts with a written scope that covers the RAGFlow instance, the self-hosted Langfuse instance and the connection between them.

How we scope

  • Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
  • The scope names which RAGFlow surfaces are traced: interactive UI runs, scheduled jobs and API calls.
  • We confirm the self-hosted Langfuse host, project layout and key ownership before any RAGFlow settings change.

How we build

  • We configure the Langfuse keys and host in the RAGFlow API settings after the LLM is configured.
  • We verify that retrieval and generation steps appear in Langfuse for each run type in the agreed scope.
  • We test failure cases such as wrong host, rotated keys and unreachable Langfuse, and document how RAGFlow behaves in each.

How we hand over

  • You receive a written record of the configuration, key handling steps and the Langfuse projects receiving traces.
  • We document how to read retrieval spans in Langfuse when chunks look wrong or answers cite the wrong source.
  • We walk your platform and security teams through the verification checks so they can repeat them after changes.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • We can plan RAGFlow and Langfuse version changes together, so tracing keeps working across upgrades.
  • Ask any provider which upgrade and support terms are included in the written quote before signing.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.