Commit Graph

7789 Commits

Author SHA1 Message Date
Jack
0cb4039be9 fix(ingestion): clamp unconfigured embedding limit; document chunker title parity (comment-only) (#17539)
## Summary
Fixes embedding inputs being emptied and documents chunker
heading-detection parity.

- `component/tokenizer.go`: `truncateForEmbedding` now mirrors Python
`common/token_utils.py:183-185` `truncate(string, max_len)` (keep the
first `max_len` tokens). For an unconfigured embedder reporting
`maxTokens <= 0`, instead of mirroring Python's `truncate` (which
returns `""` for `max_len <= 0` and would make the embeddings API reject
the batch with "inputs cannot be empty"), Go **clamps the limit to a
safe default** (`defaultEmbeddingTokenLimit = 8192`) so truncation stays
active and never produces empty inputs. The previous code returned `""`
for `maxTokens <= 10`, which emptied non-empty chunks into the batch and
triggered the API error.
- A **10-token safety margin** is reserved (mirroring Python's embedding
path `rag/svr/task_executor.py` which uses `mdl.max_length - 10`) so Go
does not over-send tokens to hard-capped embedding APIs; it is only
applied when the limit `> 10` so small limits remain non-empty.
- The clamp is applied **centrally inside `truncateForEmbedding`**,
covering both Builtin and generic callers — no separate
`model_service.go` change is required.
- `component/chunker/title.go`: comment-only — documents the
already-ported PDF-outline detection (omission 1.5 / Gap C) and the
hardcoded `BULLET_PATTERN` fallback (omission 1.7 / Gap C), porting
`common.py:_outline_similarity` and `rag/nlp` `BULLET_PATTERN`.
- `tokenizer_unit_test.go`: update truncation expectations to the new
positive-keeps-tokens / non-positive-clamps-to-default behaviour.

## Test plan
- `tokenizer_unit_test.go` updated for the new truncation behaviour
(`TestTruncateForEmbedding_SmallMaxTokens`,
`TestTruncateForEmbedding_UnconfiguredClampsToDefault`).
- `./build.sh --test ./internal/ingestion/component/` passes.

🤖 Generated with [CodeBuddy Code](https://cnb.cool/codebuddy)
2026-07-29 21:10:19 +08:00
Zhichang Yu
90f46b0b4d Go port: doc-level metadata extraction and knowledge compiler (#17536)
Ports doc-level auto-metadata extraction to Go and adds the
knowledge_compiler component with scheduler/routing. Fixes Extractor
metadata injection type assertion and enable_metadata default-on.
2026-07-29 21:06:48 +08:00
YanZhang
7f85a5776e docs: update user guide (#17358)
add model config guide word and picture
add teams guide words
2026-07-29 20:46:04 +08:00
rayhan
a586998c35 fix: remediate CVE-2026-0994 by constraining protobuf to >=5.29.6 (#17543)
## Summary
  
Remediates CVE-2026-0994 (HIGH) in `protobuf` by adding
`protobuf>=5.29.6` to `constraint-dependencies` in `pyproject.toml`.
  
| CVE | Severity | Package | Installed | Fixed in |
|---|---|---|---|---|
| CVE-2026-0994 | HIGH | protobuf | 5.29.5 | 5.29.6 |
  
`protobuf` is a transitive dependency pulled in by `google-api-core`,
`googleapis-common-protos`, `grpcio-status`, and `opentelemetry-proto`.
It was stuck at 5.29.5 because the lockfile hadn't been re-resolved.
2026-07-29 19:35:44 +08:00
balibabu
ae312090c4 Feat: Click the icon in the top-right corner to delete the note node. (#17533) 2026-07-29 19:06:35 +08:00
jay77721
4258e4ea33 Fix: add StepFun china region base URL (api.stepfun.com) (#17528)
## Summary
- StepFun serves domestic (China) and international markets from
different domains.
- Add a `china` region URL (`api.stepfun.com`) alongside the existing
`default` (`api.stepfun.ai`) so tenants in China can route correctly.

## Change
- `conf/models/stepfun.json`: add `"china":
"https://api.stepfun.com/v1"` to the `url` map.

## Why
- Chinese AI/LLM providers commonly maintain separate URLs for domestic
vs. international markets. Keeping both options available matches the
existing pattern used by other providers (e.g. GiteeAI).

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:05:38 +08:00
Haruko386
c7b1b3a4d2 feat: make chat-channel and implement WhatsApp bot (#17518) 2026-07-29 18:55:22 +08:00
Hz_
d5604f8947 feat(go-llm): align provider responses and streaming usage (#17509)
## Summary

- Add provider-local Chat, Embedding, and Rerank response structures
with usage mapping.
- Align streaming usage and tool-call state handling across Gitee,
OpenRouter, Jiekou.AI, and Hunyuan.
- Preserve Jina's non-streaming behavior and explicit unsupported
streaming response, while fixing Jiekou.AI thinking=false handling.
2026-07-29 18:54:11 +08:00
Wang Qi
0583f8c79d Fix dataset selector to continue scoll if still have data (#17534)
1. controll scoll paging by total
2. show dataset but won't allow them to choose.
2026-07-29 18:48:47 +08:00
balibabu
2a4e77c5ae Feat: Store the dialogue reasoning level on the client side. (#17530)
### Summary

Feat: Store the dialogue reasoning level on the client side.
2026-07-29 18:40:12 +08:00
Kevin Hu
48a3280eac Refactor: merge dataset scope graph. (#17526)
### Summary

merge dataset scope graph.

---------

Co-authored-by: Yingfeng Zhang <yingfeng.zhang@gmail.com>
2026-07-29 18:23:51 +08:00
Jin Hai
1f90755c48 Go: refactor (#17511)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
dev-20260729-2
2026-07-29 18:00:59 +08:00
Lynn
317363e513 Fix: replace unsupported default qwen rerank model (#17535) 2026-07-29 17:40:02 +08:00
Yash Raj Pandey
33bfc11fa4 Fix QA DOCX table parser dropping cells between repeated text (#17497) 2026-07-29 17:18:54 +08:00
chanx
26f0dc234e fix: add tooltip to log button in AssistantGroupButton component (#17532) 2026-07-29 17:18:01 +08:00
chanx
f8e01d558e fix(search): adapt input shape and button position to content line count (#17529) 2026-07-29 17:15:19 +08:00
Yash Raj Pandey
c3aa8053c0 Fix tag CSV parser ignoring the documented TAB delimiter (#17496) 2026-07-29 17:01:07 +08:00
balibabu
e5a7bee9db Fix: Switching templates results in a few extra data entries in the entity specification. (#17514) 2026-07-29 16:25:46 +08:00
Lynn
803f44221f Fix: remove unsupported get-rerank model (#17527) 2026-07-29 16:23:00 +08:00
balibabu
9c8f4f5fe3 Fix: On the multi-model comparison chat page, if there is more than one window, each window can be deleted. (#17523) 2026-07-29 16:21:53 +08:00
chanx
b0bbf9fa7f fix: support provider-specific verify payload for per-model verify (#17522) 2026-07-29 16:20:31 +08:00
Kevin Hu
06562cb03d Refactor: the tool usage in agent search progress (#17490)
### Summary

Refactor: the tool usage in agent search progress
2026-07-29 15:39:20 +08:00
balibabu
1140db3b8c Fix: The multi-model comparison page cannot output messages. (#17507) 2026-07-29 15:16:40 +08:00
Wang Qi
3c59b707c2 Refactor: delete llm_app.py (#17517) 2026-07-29 14:54:32 +08:00
Wang Qi
3297b5c756 Fix: drop and add index for mysql (#17513)
Drop complile template not used index
2026-07-29 14:54:20 +08:00
Lynn
0d1cdf157c Fix: validate Mistral OCR model (#17515) 2026-07-29 14:53:32 +08:00
Sbaaoui Idriss
e9637c9f94 fix: list model function for nvidia on python/go not returning current models (#17501)
### Summary

fix the list model logic for nvidia models
2026-07-29 13:15:34 +08:00
Anupam Mediratta
43e73b3239 fix: upgrade axios to 1.15.2 (CVE-2026-42264) (#17508)
## Summary
Upgrade axios from 1.15.1 to 1.15.2 to fix CVE-2026-42264.

## Vulnerability
| Field | Value |
|-------|-------|
| **ID** | CVE-2026-42264 |
| **Severity** | HIGH |
| **Scanner** | trivy |
| **Rule** | `CVE-2026-42264` |
| **File** | `agent/sandbox/sandbox_base_image/nodejs/package-lock.json`
|
| **Assessment** | Likely exploitable |

**Description**: axios: Axios: Prototype pollution allows information
disclosure and request manipulation

---
*Automated security fix by [OrbisAI Security](https://orbisappsec.com)*
2026-07-29 12:25:02 +08:00
Wang Qi
989529c00a Fix filter dataset by owner_ids not working (#17499) 2026-07-29 11:48:40 +08:00
Jin Hai
0eb8e0b393 Go: refactor ragflow_server.go (#17494)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-29 11:38:27 +08:00
Wang Qi
d6f1475c5c Fix: no rate limit for sandbox run (#17503) 2026-07-29 11:19:06 +08:00
Harsh Kashyap
404a5cc33b fix(admin,api): honor STORAGE_IMPL when surfacing file_store backend (closes #17294) (#17441)
## Summary

When `STORAGE_IMPL=AWS_S3`, the Admin Service status page keeps showing
MinIO. Three things conspire:

1. `admin/server/config.py::load_configurations` only knows the
   `minio` and `minio_0` config keys. An `s3` block lands on the
   `case _:` branch and logs `Unknown configuration key: s3`
   (issue #17294).
2. `admin/server/services.py::ServiceMgr.get_all_services` filters
   retrieval services by `DOC_ENGINE` but has no equivalent filter
   for `file_store` services by `STORAGE_IMPL`. A stale MinIO block
   is returned regardless of the active backend.
3. The wired health check is hardcoded to `check_minio_alive`, which
   calls `settings.MINIO['host']`. With `STORAGE_IMPL=AWS_S3` that
   block is uninitialized, so the check always times out.


Fixes #17294
2026-07-29 11:13:20 +08:00
balibabu
ee388b0fa5 Feat: Optimize dataset-level wiki generation log display. (#17492) 2026-07-29 10:56:35 +08:00
Anupam Mediratta
2a187e607f fix: upgrade axios to 1.15.1, 0.31.1 (CVE-2026-42033) (#17498)
## Summary
Upgrade axios from 1.13.6 to 1.15.1, 0.31.1 to fix CVE-2026-42033.

## Vulnerability
| Field | Value |
|-------|-------|
| **ID** | CVE-2026-42033 |
| **Severity** | HIGH |
| **Scanner** | trivy |
| **Rule** | `CVE-2026-42033` |
| **File** | `agent/sandbox/sandbox_base_image/nodejs/package-lock.json`
|
| **Assessment** | Likely exploitable |

**Description**: axios: Axios: HTTP Transport Hijacking via Prototype
Pollution

---
*Automated security fix by [OrbisAI Security](https://orbisappsec.com)*
2026-07-29 10:37:18 +08:00
Wang Qi
c77741e7a8 Porting change from #17477 python to go, parse table into chunk for markdown file (#17488)
Porting change from #17477 python to go, parse table into chunk for
markdown file
Before:
<img width="3606" height="1805" alt="image"
src="https://github.com/user-attachments/assets/363698be-c182-40cf-a167-0f0c13a68b12"
/>

After:
<img width="3606" height="1805" alt="image"
src="https://github.com/user-attachments/assets/9d0d18cb-843e-4a1a-b176-16ac32998310"
/>
2026-07-29 09:39:47 +08:00
euvre
e5bb2b60c0 Fix: search input controls styling and restore mind map modal overlay (#17436) dev-20260729 2026-07-29 09:36:07 +08:00
Lynn
8d1eff6ea2 Fix: resolve model_id to model before judge parse method (#17493) 2026-07-29 09:34:52 +08:00
rayhan
75836cfc10 fix: remediate CVE's by bumping pyasn1 constraint to >=0.6.4 (#17495)
## Summary
  
Remediates three HIGH severity CVEs in `pyasn1` by bumping the existing
`constraint-dependencies` entry from `>=0.6.3` to `>=0.6.4` in
`pyproject.toml`.
  
  | CVE | Severity | Package | Installed | Fixed in |
  |---|---|---|---|---|
  | CVE-2026-59884 | HIGH | pyasn1 | 0.6.3 | 0.6.4 |
  | CVE-2026-59885 | HIGH | pyasn1 | 0.6.3 | 0.6.4 |
  | CVE-2026-59886 | HIGH | pyasn1 | 0.6.3 | 0.6.4 |


`pyasn1` is a transitive dependency (pulled in via `google-auth` / `rsa`
/ `pyasn1-modules`). A previous constraint (`>=0.6.3`) was added for
CVE-2026-30922 but two additional vulnerabilities were disclosed that
require 0.6.4.
2026-07-28 23:25:00 +08:00
Eugene
c1e1d012bb fix(aimlapi): send attribution headers on every aimlapi.com request (#17491)
### Summary

The **aimlapi.com** provider added in #17311 does not identify itself on
any of its outgoing requests, so its traffic cannot be attributed to the
integration. This PR adds the two headers AIMLAPI expects —
`X-AIMLAPI-Source` and `X-AIMLAPI-Partner-ID` — to every request the
provider makes.
2026-07-28 23:22:27 +08:00
Yingfeng
9460e6ba03 Fix parsing log display of infinity (#17479) 2026-07-28 23:04:56 +08:00
Abhay Yadav
e91da6b214 fix(go): implement Anthropic streaming (ChatStreamlyWithSender) (#17380)
### Summary

The Go Anthropic driver's `ChatStreamlyWithSender`
(internal/entity/models/anthropic.go) was a stub that always returned
`"no such method"`, so any caller requesting a streamed response from a
Claude model via the Go path failed outright — diverging from the Python
`AnthropicCV` driver, which already supports streaming.

This implements the method by opening the Messages API with
`stream=true` and parsing the SSE response via the shared
`ParseSSEStream` helper, forwarding `text_delta`/`thinking_delta`
content through the `sender` callback and treating `message_stop` as the
terminal event — consistent with the other Go drivers in this package
(e.g. Cohere).

Fixes #17333

---------

Co-authored-by: Abhay Yadav <abhayyadav@Abhays-MacBook-Air.local>
2026-07-28 21:10:28 +08:00
jay77721
b02df503ac Refactor(go-models)/llm token usage for longcat (#17480)
### Summary

Add token usage reporting for the LongCat (Meituan) model provider.
Related
  to #17284.

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-07-28 21:08:51 +08:00
euvre
996c5156e5 Fix: go back to previous page when last card on the last page is deleted (#17409) 2026-07-28 19:30:28 +08:00
euvre
679bce8f8d fix: reset selected documents on new search in search page (#17454) 2026-07-28 19:29:51 +08:00
yiming wang
dcadd8d837 feat: add Tenki sandbox provider (#17305)
### Summary

Adds a `tenki` sandbox provider that runs each agent code execution in a
disposable Tenki (https://tenki.cloud) microVM (create → exec → destroy,
no volumes or snapshots).
Registration mirrors PR #15039, configure `api_key` and `project_id` in
Admin > Sandbox Settings.

Both runtimes are covered:
- Python: `agent/sandbox/providers/tenki.py` (structured results +
artifact collection).
- Go: `internal/agent/sandbox/tenki.go`, mirroring the e2b provider and
wired into the provider manager.

`tenki-sandbox` is an optional dependency (it requires `protobuf>=6.31`,
which differs from RAGFlow's pinned gRPC stack), lazily imported with a
clear error when missing; installation is documented in the sandbox
quickstart.

Unit tests cover execution, structured results, artifacts
(symlink/size/extension limits), non-zero exit, timeout, error mapping,
and idempotent destroy.

---------

Co-authored-by: yiming.wang <yiming.wang@luxor.com>
2026-07-28 19:24:39 +08:00
euvre
73860170ae fix(admin): use POST for admin logout API (#17482) 2026-07-28 19:22:57 +08:00
Jack
76aaecc284 fix(ingestion): improve Extractor/LLM robustness and Python->Go parity (#17470)
## Summary

This PR hardens the Go ingestion **Extractor** and **LLM retry** paths
and closes several Python->Go parity gaps in the keyword/question/tag
extraction flow.

- **Generic retry utility** (`internal/common/retry.go`):
`RetryWithBackoff` with exponential backoff (default 3 retries, 2s
initial delay, capped at 1m), context-aware sleep, and a `maxRetries<=0`
fast path. Covered by `internal/common/retry_test.go`.
- **LLM retry reuse**: `agent/component/llm_retry.go` now delegates to
`common.RetryWithBackoff` instead of an inline loop (behavior preserved:
ctx cancellation short-circuits the backoff).
- **Extractor LLM calls** (`extractor.go`):
- `call()` now retries transient LLM failures via `RetryWithBackoff`
(retry exhaustion fails the chunk instead of silently skipping).
  - Sets `temperature = 0.2`, matching Python `generator.py:230,245`.
- Runs keyword and question extraction **concurrently** per chunk when
both are enabled (`task_executor.py:444-448`), with mutex-guarded map
writes to avoid data races.
- Substitutes `{field_name}` placeholders (including `{chunks}` -> chunk
text) in `prompt`/`system_prompt` before the call, mirroring Python
`string_format` (`extractor.py:102-103`); unmatched placeholders are
left as-is.
- Falls back to the **tenant default chat model** when `llm_id` is empty
(`task_executor.py:573-574`).
- Strips `` **greedily** (`strings.LastIndex`) in
`cleanExtractionResult`.
- **Auto-tagging** (`extractor_tag.go`): drops the `in.llmID != ""`
guards so an empty `llm_id` no longer skips tagging (uses the tenant
default model), and strips `` greedily in `parseTaggerResponse`.
- **Docs**: fixes a misleading `PresentationChunker` docstring that
claimed per-slide `image`/`position` output (the PPTX path emits none —
unlike PDF), and removes a stale `docs/migration_python_go_diff.md`
reference in `media_dispatch.go`.

## Test plan

- `bash build.sh --test ./internal/common/...` — passes (new retry
utility + tests).
- `bash build.sh --test ./internal/ingestion/component/...` — passes
(extractor/chunker/schema).
- `gofmt` and lefthook pre-commit checks pass.

Note: the personal `docs/migration_python_go_diff.md` working notebook
in the tree is intentionally **not** part of this PR.

---------

Co-authored-by: CodeBuddy <noreply@codebuddy.ai>
2026-07-28 19:22:18 +08:00
Robert Keus
7e1ab9741b feat: add GreenPT model provider (#17447)
## Summary

GreenPT is a European AI provider with an OpenAI-compatible API,
optimized infrastructure, and datacenters powered by 100% renewable
energy.

This adds native GreenPT support across RAGFlow’s Go-first provider
system and its Python compatibility layer:

- discovers the current catalog from `GET /v1/models`
- features `glm-5.2` and `kimi-k2.7-code` for chat and coding
- supports `green-embedding` through `/v1/embeddings`
- supports `green-rerank` through `/v1/rerank`
- supports `green-s` and `green-s-pro` speech-to-text through
`/v1/listen`
- adds provider configuration, UI icon, and supported-provider
documentation
2026-07-28 19:19:00 +08:00
Hz_
55a5254045 fix(go-agent): return configured retrieval empty responses (#17484)
## Summary

- Return the configured `empty_response` when retrieval has no query or
no chunks.
- Preserve `formalized_content` for downstream Message nodes.

## Testing

- `bash build.sh --go`
- `ok    ragflow/internal/agent/tool`
- `ok    ragflow/internal/agent/component`
2026-07-28 19:17:33 +08:00
rayhan
823e3dd871 fix: remediate CVE's by upgrading pdfplumber to 0.11.10 (#17489)
## Summary
  
Remediates two HIGH severity CVEs in `pdfminer.six` by upgrading its
parent dependency `pdfplumber` from `==0.10.4` to `==0.11.10` in
`pyproject.toml`.
  
  | CVE | Severity | Package | Installed | Fixed in |
  |---|---|---|---|---|
  | CVE-2025-64512 | HIGH | pdfminer.six | 20221105 | 20251107 |
  | CVE-2025-70559 | HIGH | pdfminer.six | 20221105 | 20251230 |

`pdfminer.six` is a transitive dependency exact-pinned by `pdfplumber`.
Version 0.10.4 pins `pdfminer.six==20221105` (vulnerable); version
0.11.10 pins `pdfminer.six==20260107` (patched).
2026-07-28 19:17:17 +08:00