68 Commits
Author SHA1 Message Date
xugangqiang e5a51b680b Provision native libs from versioned user cache (offline CI, drop /opt pre-bake) (#22099) 2026-11-09 18:07:31 +08:00
xugangqiang ed7510638e Revert "Provision native libs from versioned user cache (offline CI, drop /opt pre-bake)" (#22097)
Reverts infiniflow/ragflow#22023
2026-11-06 16:33:19 +08:00
xugangqiang d6dbfd97d4 Provision native libs from versioned user cache (offline CI, drop /opt pre-bake) (#22023) 2026-11-06 14:48:00 +08:00
Sanderhoff-alt 819751a915 fix(build): adjust onnxruntime static link flags on Darwin arm64 (#21162)
Closes #21160
2026-11-02 17:15:24 +08:00
Jin Hai 12d9a38e24 add audit hooks to file APIs (#21807)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-10-31 14:09:55 +08:00
Jin Hai 298b06a22e fix build.sh (#21738)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-10-30 11:36:52 +08:00
Zhichang Yu 2fd857b128 build: build the server from ./cmd so build tags select the DeepDoc entry (#21704) 2026-10-30 10:33:17 +08:00
Zhichang Yu 9a71c10b09 refactor: keep the enterprise code out of the community build (#21614) 2026-10-29 11:35:50 +08:00
xugangqiang e45956c7a2 refactor(build): add empty build_ee.sh extension point + guarded hook (#21616) 2026-10-28 18:24:54 +08:00
xugangqiang 6a2ef7ec6b refactor(deps): rename ragflow_deps directory to deps (#21345)
## Summary

Rename the repository dependency-resource directory `ragflow_deps/` to
`deps/`, and update every hardcoded reference to that directory name so
the rename does not break resource loading at build/runtime.

This is not a purely cosmetic rename: the Go runtime hardcodes the
directory name as a resource search path (e.g.
`internal/common/model_assets.go` trimming the `deps/` prefix, and the
tokenizers joining `deps/` into candidate paths), and the Dockerfiles
copy assets into `/ragflow/deps`. Those literals must move together with
the directory, otherwise assets fail to resolve.

## Two intentional exceptions (kept unchanged)

The rename deliberately keeps two names that only *coincidentally*
contained the old string:

- The published image tag `infiniflow/ragflow_deps:latest` (used by
`Dockerfile`, `Dockerfile_base`, docs, and CI `image inspect` checks).
- The CI install path `/opt/ragflow_deps` inside the CI runner image
(`build.sh` `SYSTEM_DEPS_TOKENIZER`).

## Changes

- `git mv ragflow_deps deps`.
- `build.sh`: `CL100K_TABLE_RELPATH`, native asset zip path, and related
references updated to `deps/`.
- `tools/scripts/download_dev_deps.py`: `RAGFLOW_DEPS_DIR` points at
`deps/`.
- Go runtime resource search paths (`internal/common`,
`internal/tokenizer`) updated to the `deps/` layout.
- `Dockerfile` / `Dockerfile_base`: container asset path changed to
`/ragflow/deps`; kept tag `infiniflow/ragflow_deps:latest` unchanged.
- Docs / `AGENTS.md` / CI workflow paths updated to the new directory
name.

## Test plan

- Go unit tests in `internal/common` and `internal/tokenizer` updated to
the new `deps/` layout and pass via `bash build.sh --test`.
- Python download scripts import and build URLs correctly (`py_compile`
clean).
- Added `tools/scripts/test_dep_rename_invariants.py` as a regression
guard asserting the two intentional exceptions (`/opt/ragflow_deps` and
`infiniflow/ragflow_deps`) stay intact, so a future blanket rename
cannot silently regress them.

---

## Follow-up fix (commit 2f6857095d)

The original rename used a blanket `sed s/ragflow_deps/deps/g` and only
selectively reverted `build.sh`. That left two intentionally-kept names
rewritten, which this follow-up restores:

- CI install path `/opt/ragflow_deps` — `sep-tests.yml` had been changed
to read `/opt/deps`, breaking the offline cl100k table fallback (the
cached-image path pointed at a directory that never receives the file).
Restored to `/opt/ragflow_deps`.
- Published image tag `infiniflow/ragflow_deps` — left as bare
`infiniflow/deps` in `sep-tests.yml` comments/echo, `.dockerignore`, and
`Dockerfile` / `Dockerfile_base` error messages. Restored to
`infiniflow/ragflow_deps`.

The regression guard `tools/scripts/test_dep_rename_invariants.py` was
added to prevent recurrence.
2026-10-22 19:20:42 +08:00
xugangqiang 9cca46ac1c Fix(deps): use onnxruntime-v1.29.0-patch2 to restore Clip@13 in minimal ORT (#21051) 2026-10-20 13:34:46 +08:00
xugangqiang b44e852e6b Build: add multi-platform native build support (linux/arm64, darwin) (#19247) 2026-10-16 14:26:31 +08:00
xugangqiang c754300366 refactor(deps): split dependency download into two Python scripts (#20861) 2026-10-13 20:44:56 +08:00
jay77721 4071451ea4 refactor(deps): use Go dependency downloader as sole entrypoint (#20360) 2026-09-30 18:02:03 +08:00
Sourav Rajvi bc8ee6a967 fix(parser): wire MinerU server_url through Go PDF parser (#19445) 2026-09-30 14:28:03 +08:00
jay77721 6304825676 fix(parser): preserve DOCX XML character references (#20359) 2026-09-30 12:03:58 +08:00
Jin Hai 60016b39c9 refactor: move res into internal (#20390)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-09-30 10:49:17 +08:00
maoyifeng ef939fbaff add Dockerfile docker-compose.yml and modify workflow (#20305) 2026-09-28 18:59:06 +08:00
Jin Hai 7c102247c6 refactor: update go verion server port to 9380 and 9381 (#20298)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-09-28 17:35:16 +08:00
xugangqiang 893fc7801c build(sh): pin ONNX Runtime archive sha256 instead of fetching it online (#20082) 2026-09-23 12:25:11 +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 3b7cc76ef3 Go: add deepdoc server framework (#19988)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-09-22 10:15:06 +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
xugangqiang 4b055c5996 Go: add generic Go integration test CI job (infinity) (#19702) 2026-09-18 15:40:33 +08:00
xugangqiang 60f3347ba6 fix(build): anchor pdf_oxide version gate against suffix versions (#19152) 2026-09-11 16:43:12 +08:00
xugangqiangandmaoyifeng 2e6003cfd4 Unify ONNX Runtime native to 1.29.0 from infiniflow/ragflow-build (#19446)
Switch Go DeepDoc's static ONNX Runtime to our own infiniflow/ragflow-build release (v1.29.0) instead of third-party. Keeps fused kernels; normalizes dir naming; added ORT version consistency check.

---------

Co-authored-by: maoyifeng <myfbee5@163.com>
2026-09-11 12:12:34 +08:00
Jin Hai d5a89c324c Go: update build.sh and development.md (#19448)
Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-09-09 21:03:48 +08:00
xugangqiang 8c8253a3be chore(deps): let download_go_deps.py fetch Go DeepDoc .ort weights (#19376)
Go DeepDoc now uses .ort weights downloaded via download_go_deps.py — no MODEL_DIR needed from repo root. Script fetches 5 model files into rag/res/deepdoc/; supports mirrors; CI updated. .onnx path unchanged.
2026-09-09 16:07:43 +08:00
xugangqiang 6de46a233c feat(deepdoc): switch in-process Go backend from .onnx to FlatBuffer (.ort) models (#19318) 2026-09-08 12:54:10 +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 <haijin.chn@gmail.com>
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
xugangqiang 0d1338d63e fix(deepdoc): harden ORT build guard, OCR test contract (#19082) 2026-09-02 12:13:19 +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 <noreply@codebuddy.ai>
2026-09-02 11:27:09 +08:00
xugangqiang c28edde895 feat(deepdoc): in-process static-linked ONNX Runtime DeepDoc backend (#18731) 2026-08-31 13:18:12 +08:00
MarMar Labs 5a9d14925a fix(build): pass GOPROXY to the ragflow-cli go build (#18925)
The fix adds the trailing `\`. `bash -n build.sh`
2026-08-28 11:28:39 +08:00
MarMar Labs dec9b2e316 fix(build): keep the admin server in build.sh's cleanup trap (#18816)
Fix trap overwrite in build.sh --run where the ingestor cleanup trap replaced the admin one, leaving admin server running on port 9383. Combined both PIDs into a single trap covering both processes. Empty PID case handled.
2026-08-26 21:08:51 +08:00
MarMar Labs d3ccfbdc60 fix(build): name the compiler the check requires, and the option that failed (#18594) 2026-08-21 16:52:04 +08:00
JackandCodeBuddy 5ba8c4febb chore(go): classify tests into unit/integration/e2e/manual tiers via build tags (#17586)
## Summary
Classify the Go test suite by dependency level using build tags so the
default
`go test ./...` run stays self-contained, and add local convenience
commands
plus a documented convention.

- Add build tags to 5 real-service tests that were previously un-tagged
and only
soft-isolated via `t.Skip`: `kg_test.go` (integration), `minio_test.go`
  (integration), `template_integration_test.go` (integration),
`stagehand_runtime_integration_test.go` (integration),
`pipeline_e2e_test.go` (e2e).
  The default unit run no longer compiles/attempts these.
- Reclassify the full-pipeline `real_consumer` tests from `integration`
to `e2e`.
- Add `build.sh` shortcuts: `--test-integration`, `--test-e2e`,
`--test-manual`,
`--test-all` (integration + e2e; `manual` is excluded and is local
opt-in only,
  never run in CI).
- Document the tier scheme (unit / integration / e2e / manual +
orthogonal cgo) in
  `AGENTS.md`.

## Tier definitions
| Tier | Build tag | Runs by default? |
|---|---|---|
| Unit | (none) | Yes — in-memory SQLite / miniredis / httptest stubs |
| Integration | `integration` | No (`-tags integration`) — single real
service |
| E2E | `e2e` | No (`-tags e2e`) — full ingest→index→retrieve pipeline |
| Manual | `manual` | No (`-tags manual`) — very slow; never in CI |

## Verification
- `gofmt -l` clean on all changed files; `bash -n build.sh` OK.
- `go list` confirms the default set excludes the tagged files, and
  `-tags integration` / `-tags e2e` include them.
- Full regression: unit / integration / e2e each **97 ok, 0 FAIL**.
- Fixed a regression where `pipeline_knowledge_compiler_test.go` relied
on a
transitive import side-effect from `template_integration_test.go` to
register
the `File`/`Parser`/`TokenChunker` components; it now blank-imports the
  component packages directly.

## Test plan
- [ ] `./build.sh --test` (unit) passes
- [ ] `./build.sh --test-integration` passes (needs real services; skips
otherwise)
- [ ] `./build.sh --test-e2e` passes (needs real services; skips
otherwise)

---------

Co-authored-by: CodeBuddy <noreply@cnb.cool>
2026-07-31 11:52:48 +08:00
Jin Hai 5478f955ab Go: add context to DAO (#17269)
### Summary

DAO layer doesn't use context, this PR is to fix it.

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-23 12:15:58 +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
zcxGGmuandzq a7b193d77b fix: align pdf table structure coordinates (#17016)
### What problem does this PR solve?

Table structure recognition rows, columns, headers, and spans are
produced in cropped table image coordinates, while OCR boxes are matched
later in page-cumulative coordinates. Comparing those boxes without
normalization can skip or misassign table row and column metadata.

Closes #16992.

### What is changed?

- Map TSR components from cropped or rotated table-image coordinates
back into page-cumulative coordinates before matching OCR boxes.
- Reuse one inverse rotation transform for rotated OCR boxes and TSR
components.
- Keep TSR layout ids in the same `table-N` form used by table OCR
boxes.
- Sort columns by mapped page x-coordinate after coordinate
normalization.
- Add focused unit coverage for page offsets, zoom scaling, and
90/180/270 degree rotated tables.

### Type of change

- [x] Bug fix
- [x] Test coverage

### How has this been tested?

- `uv run --group test pytest
test/unit_test/deepdoc/parser/test_pdf_parser_table_coordinates.py -q`
- `uv run --no-sync --group test pytest
--confcutdir=test/unit_test/deepdoc/parser
test/unit_test/deepdoc/parser/test_pdf_parser_table_coordinates.py -q`
- `uv run ruff check deepdoc/parser/pdf_parser.py
test/unit_test/deepdoc/parser/test_pdf_parser_table_coordinates.py`
- `uv run --no-sync python -m py_compile deepdoc/parser/pdf_parser.py
test/unit_test/deepdoc/parser/test_pdf_parser_table_coordinates.py`
- `git diff --check`

A later dependency-sync attempt was blocked while resolving the
`en-core-web-sm` wheel from GitHub, and the repository-level unit-test
conftest can try to download missing NLTK `wordnet` data when it is not
already present locally. The focused parser test above does not require
that data fixture.

---------

Co-authored-by: zq <zhouquan1511@163.com>
2026-07-18 18:22:33 +08:00
euvre 699a25c19c fix(service): allow updating memory_type when memory is empty (#16668) 2026-07-08 10:03:58 +08:00
Jin Hai 9e87fc6036 Go: fix ragflow-cli building (#16721) 2026-07-07 20:44:10 +08:00
Jin Hai 9eba45249c Go: fix development guide (#16678)
### Summary

Go development guide

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-07 15:09:39 +08:00
Zhichang Yu 014c3f634f Align Go ingestion boundaries with Python (#16647)
Moves doc_id blob resolution into Parser, tightens chunker/tokenizer to
Python output_format semantics, updates extractor list handling, and
fixes real-template integration tests.
2026-07-05 20:43:52 +08:00
Wang Qi 06aa169df7 Update development script (#16623) 2026-07-03 20:34:30 +08:00
Jin Hai 1880e65e99 Go: refactor (#16602)
### Summary

1. update doc
2. refactor route code

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-03 17:00:43 +08:00
Jin Hai 7d64a78f83 Go: unify three services into one binary (#16462)
### Summary

Plan to start api_server, admin_server and ingestor in one binary:
- ./ragflow_main --admin
- ./ragflow_main --api
- ./ragflow_main --ingestor

---------

Signed-off-by: Jin Hai <haijin.chn@gmail.com>
2026-07-02 21:21:10 +08:00