82 Commits
Author SHA1 Message Date
Ricardo-M-L df3af45fb9 feat(parser): support genuine BIFF8 XLS workbooks (#20573) 2026-10-10 10:17:46 +08:00
qinling0210 7e6a8e3674 Bump Infinity to v0.7.4 (#20652)
### Summary

Bump Infinity to v0.7.4
2026-10-09 15:02:00 +08:00
Jin Hai 1257baaa14 Go: go mod tidy (#20605)
Signed-off-by: Jin Hai <[email protected]>
2026-10-08 17:45:37 +08:00
Zhichang Yu 98b48a0857 Port agentic RAG to Go, expose it as a chat mode, and add per-dialog failover (#20503)
## Background

This branch started as a focused fix to agentic RAG regexp retrieval
semantics (`f80556585`) and grew into the full agentic RAG path. The
title no longer describes the contents, so it has been rewritten.

The PR now covers three largely independent lines of work:

### 1. The agentic RAG is reachable from the UI

`internal/agentic_rag` (the eino-ADK ReAct explorer) was already built
and wired, but only reachable by hand-crafting an `agent_mode` kwarg. It
is now the sixth option in the chat mode selector (`reasoning` level 5).

One subtlety worth stating plainly: **levels 1-4 and level 5 are not the
same agent.** Levels 1-4 go through `internal/rag/agentic-rag` (the
harness graph) with a depth chosen by `harnessModeForLevel`; level 5
switches engines outright to `internal/agentic_rag`. That is why level 5
must never reach `harnessModeForLevel` — its `level >= 4` case would
silently answer "ultra" for a level outside its domain.

### 2. Per-dialog failover chain

`agenticModelChain` resolved exactly one model and the caller then used
`chain[0]`, so a "chain" was never more than a single element. A dialog
can now configure an ordered list of fallback models in Chat Settings,
handed to `NewFailoverEinoChatModel` (sticky cursor plus a 30s
full-chain cooldown).

The list lives in the dialog's own `llm_setting.failover_llm_ids`, so no
new table is involved. A member that no longer resolves is skipped with
a warning rather than failing the turn.

Also removed: `tenant_model_group` / `tenant_model_group_mapping`, which
nothing ever read (the DAOs were constructed but never called, and no
frontend or Python code referenced the concept). Their removal takes an
explicit drop migration with it, plus the account-deletion cascade that
queried them.

### 3. A hung MiniMax stream (independent of the agentic work)

With any mode selected, a chat rendered its whole answer and then sat on
"thinking" forever. Root cause is `minimax.go:256`: MiniMax sends `data:
[DONE]` but leaves the HTTP connection open, and the code waited for the
scanner goroutine's EOF *after* `HandleStreamingResponse` had already
returned. That receive can only end when `streamCallTimeout` (20
minutes) expires.

Diagnosed by capturing a real SSE stream (the complete answer arrives,
the terminal `final: true` never does) and a goroutine dump (6 requests
parked in `chan receive`).

## Two review findings fixed on the way through

- **KB-scope authorization**: the agentic branch bypassed quote
resolution, and an empty KB scope made `buildBoolQueryFromCondition`
drop the `kb_id` filter — so a citation could resolve a chunk belonging
to a different KB in the same tenant. The agentic branch now requires a
non-empty scope and otherwise falls through to the regular path.
- **Stale documentation**: `agentic-rag-failover-groups.md` described
the "automatically include every tenant model" strategy that upstream
had already removed. It was rewritten for the per-dialog scope and then
dropped entirely, since the design now lives in the code it describes.

## Verification

- `bash build.sh --test`: `admin`, `dao`, `service`, `service/dataset`
and `entity/models` all pass
- The MiniMax fix was verified end-to-end against a live server: before,
the turn hung indefinitely; after, it completes in **1.9s** with `final:
true` present
- Frontend: 9 tests added; type-check and lint clean on the touched
files

## Not included

- **Attachment support in agentic mode.** Text attachments could be
appended safely, but images have no safe fix: the agent's toolset is
built around corpus retrieval and has no image input channel. Fixing
only the text path would leave the feature half-supported and harder to
diagnose than now. Planned as a follow-up PR, with the design synced
here first.
- Tool-calling is not enforced as a group constraint. `is_tools` is a
provider-declared flag rather than a measured capability (187 of 659
chat models do not declare it), so gating on it would reject working
configurations while admitting broken ones.
2026-10-02 23:00:16 +08:00
jay77721 6304825676 fix(parser): preserve DOCX XML character references (#20359) 2026-09-30 12:03:58 +08:00
Jin Hai c1a680e905 refactor: remove unused code and doc (#20392)
Signed-off-by: Jin Hai <[email protected]>
2026-09-29 22:56:42 +08:00
xugangqiang 3bff368602 docs: align onnxruntime_go binding version in comments with go.mod (v1.29.0) (#20370) 2026-09-29 17:27:14 +08:00
dependabot[bot] 24baee2bf2 chore(deps): bump go.opentelemetry.io/otel/sdk from 1.44.0 to 1.45.0 (#20088) 2026-09-23 15:18:02 +08:00
xugangqiang 3a23ba00a5 feat(deepdoc): share ONNX model weights across pooled native sessions (#20035) 2026-09-22 20:12:38 +08:00
Jin Hai c69960bc26 Go CLI: show hardware (#19991)
```
RAGFlow(admin)> show hardware
+----------+-------------+
| field    | value       |
+----------+-------------+
| Memory   | 33045229568 |
| OS       | linux       |
| Arch     | amd64       |
| CPUCores | 14          |
+----------+-------------+
```

---------

Signed-off-by: Jin Hai <[email protected]>
2026-09-21 19:25:11 +08:00
Jin Hai 3e360ac4fa Go: update go.mod (#19963)
Signed-off-by: Jin Hai <[email protected]>
2026-09-21 14:37:33 +08:00
Zhichang Yu 44b8d366ba feat(go,web): port tokenizer counters, embedding limits and multi-provider web search (#19802) 2026-09-18 19:11:28 +08:00
Sbaaoui Idriss d36dc659ec feat(mcp): add SDK-backed native Go MCP runtime (#19673) 2026-09-17 11:44:15 +08:00
buua436 0a00a73290 fix: align mindmap relations with Python (#19579) 2026-09-14 16:30:20 +08:00
Jin Hai 3e30a47623 Go: add integration test (#19485)
```
$ go test -v ./test/api/...

InitServerTestConfig start
InitServerTestConfig init successfully
TearUp
=== RUN   TestCreateDataset
    dataset_api_test.go:12: Skip TestCreateDataset
    dataset_api_test.go:17: TestCreateDataset 1
--- PASS: TestCreateDataset (0.00s)
=== RUN   TestCreateUser
    user_api_test.go:14: TestCreateUser
--- PASS: TestCreateUser (0.00s)
PASS
TearDown
```

---------

Signed-off-by: Jin Hai <[email protected]>
2026-09-10 22:57:18 +08:00
qinling0210 ef800ba5c2 Port agentic RAG to GO (#19500)
### Summary

Port agentic RAG to GO
2026-09-10 20:02:48 +08:00
dependabot[bot] c178cdd5b9 build(deps): bump github.com/buger/jsonparser from 1.1.1 to 1.1.2 (#19463) 2026-09-09 23:58:28 +08:00
xugangqiang f1c42e85e3 build: use a stable dynamic-list path for OrtGetApiBase export (#19302) 2026-09-08 10:47:18 +08:00
Jin Hai 426246f159 Go: refactor (#19312)
use sonic to replace goccy/go-json

---------

Signed-off-by: Jin Hai <[email protected]>
2026-09-07 13:59:56 +08:00
xugangqiang aaed9fd40e Perf: link onnxruntime without --whole-archive to cut binary size (#19277) 2026-09-07 10:01:36 +08:00
xugangqiang 4298700cb2 chore(deps): depend on org mirror infiniflow/onnxruntime_go (#19169) 2026-09-04 15:26:46 +08:00
dependabot[bot]andJin Hai 1a63251c63 build(deps): bump google.golang.org/grpc from 1.82.1 to 1.83.1 (#19127)
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from
1.82.1 to 1.83.1.

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jin Hai <[email protected]>
2026-09-02 12:36:47 +08:00
xugangqiangandCodeBuddy e95e4af961 build: bump office_oxide to v0.1.9 and pdf_oxide to v0.3.73 (#19124)
## Summary

- **office_oxide**: 0.1.8 → 0.1.9
- **pdf_oxide**: 0.3.67 → 0.3.73

Co-authored-by: CodeBuddy <[email protected]>
2026-09-02 11:27:09 +08:00
mkaaad c63c237480 feat(go-syncer): add BigQuery connector (#19106) 2026-09-01 17:39:54 +08:00
xugangqiang c28edde895 feat(deepdoc): in-process static-linked ONNX Runtime DeepDoc backend (#18731) 2026-08-31 13:18:12 +08:00
euvre 9d90077455 fix(dataflow): decode non-UTF-8 HTML files before parsing in Go pipeline (#18801) 2026-08-28 17:01:58 +08:00
jay77721 88e5a8b0ec fix(parser): support webp in image OCR and correct rune count for VLM gate (#18785) 2026-08-26 15:49:29 +08:00
mkaaadandcoderabbitai[bot] e5b1adc9fa feat(go-syncer): add Azure Blob Storage connector with checkpoint resume (#18701)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-08-25 17:17:10 +08:00
Jin Hai 23a071157d Revert "port smart-reasoning agentic RAG to eino ADK" (#18670)
Reverts infiniflow/ragflow#18654
2026-08-24 12:03:11 +08:00
Zhichang Yu 2db8eb6c91 port smart-reasoning agentic RAG to eino ADK (#18654)
Ports the smart-reasoning (agentic RAG) conversation mode to the eino ADK, with Go retrieval tools (grep_chunks, search_chunks, list_chunks), deep-read XML output, and frontend agent-mode wiring.
2026-08-23 20:54:40 +08:00
mkaaadandcoderabbitai[bot] cab70fdac3 feat(syncer): add Moodle connector with checkpoint resume (#18554)
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-08-20 19:05:16 +08:00
mkaaadandcoderabbitai[bot] a3170af846 Feat: connector go imap (#18513)
add imap connector to go

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-08-19 19:23:26 +08:00
Jack c23d5fc819 fix(parser): support .msg parsing and make email attachments retrievable (#18198)
- Add Go `EmailParser` support for Outlook `.msg` (OLE2/CFB) files via
the `gomsg` library, in addition to the existing `.eml` (RFC 5322)
support. The `.msg` hard-error is gone; emails with `.msg` attachments
are now ingested end-to-end.
- Re-chunk email attachments into retrievable text (user-oriented). Each
attachment is re-parsed by its file extension through the shared parser
registry and folded back into the same document, so attachment content
becomes searchable. This mirrors Python's legacy `rag/app/email.py`.
Binary attachments (images/audio/video/folders) are skipped by design.
- Restore a corrupted `sample.msg` test fixture and add guards so binary
fixtures are never mangled again (`.gitattributes` marks `*.msg` binary;
`check_files.py` skips NUL-byte files). Also made `check_files.py`
ruff-clean.
2026-08-14 10:38:38 +08:00
Zhichang Yu 620f807cb5 Port agentic search high/ultra research loop to Go (#18242)
Implement two-level research loop, sufficiency ladder, AutoRater, grounded review, pipeline, inspector tools, and graph exploration for high/ultra agentic search modes.
2026-08-14 10:16:46 +08:00
mkaaadandJin Hai 3ce1b9be3d Add MySQL and PostgreSQL connectors to Go syncer (#18162)
As title

---------

Co-authored-by: Jin Hai <[email protected]>
2026-08-13 20:16:44 +08:00
wenqian c589a5d050 feat: add UCloud agent sandbox provider (#18088) 2026-08-13 15:33:03 +08:00
qinling0210 0c225b0c39 Bump to infinity v0.7.3 and update go sdk version (#18137)
### Summary

Bump to infinity v0.7.3 and update go sdk version
2026-08-12 11:30:34 +08:00
Carl Calaquian ad6fdfd7b4 fix(sandbox): update Tenki SDKs and drop removed project_id (#18117)
### Summary

Brings both halves of the Tenki sandbox provider onto current SDKs and
removes `project_id`, which Tenki deleted from its API.

**Go:** `github.com/LuxorLabs/tenki-sdk-go/sandbox` `v0.5.2` → `v0.7.0`
(current latest).
**Python:** the provider's SDK was renamed on PyPI — `tenki-sandbox` is
frozen at 0.4.0 and everything from 0.5 ships as
[`tenki`](https://pypi.org/project/tenki/). The docs told operators to
`pip install tenki-sandbox`, which installs a stale SDK that no longer
matches this provider's expectations.

**`project_id` is gone.** Tenki removed project scoping from the sandbox
API in 0.5.x: `Client.create()` no longer accepts `project_id`, so the
current code path would raise `TypeError` against a current SDK. It was
also marked `required: True` in the config schema, so the Admin >
Sandbox Settings form asked for a value that no longer exists.
2026-08-11 20:37:21 +08:00
Jack a399b93143 Test(chunker): add golden parity harness, fixtures, and live Go<->Python tool (#17735)
Golden-parity test infrastructure for the **Go `TokenChunker` ↔ Python alignment**.
It runs the Go chunker over a committed case set (`testdata/parity/cases/`) and diffs each output against a captured Python golden (`testdata/parity/golden/`), honoring a `known_diffs.json` ratchet (`extra_fields` / `chunk_count` / `chunk_text`) so accepted divergences are tracked rather than silently widening.
2026-08-11 17:46:34 +08:00
Zhichang Yu 64533e5b5e Refactor splitByTokens and wire wiki incremental compile (#18083)
Port dataset-level wiki incremental compile and refactor splitByTokens
token budgeting. Includes replace-only wiki merge, KNN dedup routing,
and template/config wiring.
2026-08-11 13:46:55 +08:00
Zhichang Yu f12c0ec08a feat(knowledge_compile): materialize wiki page graph (wiki_entity/wiki_relation) (#17976)
Re-materialize wiki page graph from merged wiki_page rows after each
batch merge. Adds ProjectWikiGraph/DropWikiGraph, full page_type/slug
identity, delete-then-insert, tests.
2026-08-07 17:47:59 +08:00
Wang Qi eb9b621061 Fix go generated token expired in python - 2 (#906) (#17875) 2026-08-05 17:29:08 +08:00
Haruko386 5249de53da feat[Go]: add feishu chat bot for chat channel (#17561)
### Summary

As title, related to #17520
2026-07-31 11:40:25 +08:00
Haruko386andcoderabbitai[bot] 0db46e552b feat[Go]: add dingtalk chat bot for chat channel (#17565)
### Summary

As title, related to #17520

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2026-07-31 10:06:01 +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
yiming wangandyiming.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 <[email protected]>
2026-07-28 19:24:39 +08:00
qinling0210 a84d2ae3d2 fix(infinity): avoid hangs with pooled connections and bounded timeouts (#17287)
### Summary

**Issue**
When calling Infinity under concurrent load, one shared connection was
reused across concurrent operations, it just hangs.
 

**Solution**
Avoid hangs with pooled connections and bounded timeouts
2026-07-23 20:37:38 +08:00
Jack f7446cae7b Feat: upgrade office_oxide from 0.1.2 to 0.1.8 (#17262) 2026-07-23 09:59:34 +08:00
Jin Hai f8474a67f5 Go: tracing framework (#17004)
### Summary

Tracing framework

---------

Signed-off-by: Jin Hai <[email protected]>
2026-07-16 19:35:43 +08:00
Jin Hai c7a623ff81 Go: introduce clickhouse (#16996)
### Summary

Introduce Clickhouse for data statistics.

Signed-off-by: Jin Hai <[email protected]>
2026-07-16 18:36:56 +08:00