Commit Graph

8252 Commits

Author SHA1 Message Date
Jack
b505437db5 fix(chunker): honor bare (non-backtick) delimiters in TokenChunker (#17723) (#18182)
Go's `TokenChunker` previously ignored **bare (non-backtick)
delimiters** such as `::`, `.`, or `;`. `compileDelimPattern` compiled
them with `keepBare=false`, so a bare delimiter produced a `nil` pattern
and the payload was routed to the single-section merge that never split
on it — diverging from Python's `naive_merge`, which splits on bare
delimiters and then merges by token size.
2026-08-12 22:36:11 +08:00
EthanZhang
1d8b9c7452 feat(agent): add Querit Contents tool (#18156)
### Summary

Add Querit Contents as a built-in page content tool for RAGFlow Agents
and Canvas workflows.

Querit Contents crawls one or more known URLs and returns their page
content and optional metadata. It complements the existing Querit Search
tool: Search discovers relevant pages, while Contents retrieves pages
already selected by an Agent or workflow.

This integration supports two usage modes:

- A standalone `QueritContents` node in Canvas workflows.
- An embedded content tool available to RAGFlow Agents.
nightly
2026-08-12 21:03:21 +08:00
Jack
c7db20b8d3 test(parser): pin figure-aware reading order in PDF post-process (#18178)
Adds a characterization / regression test
(`pdf_postprocess_measure_test.go`) that pins the **figure-aware reading
order** produced by the PDF adapter layer
(`internal/parser/parser/pdf_postprocess.go`).
2026-08-12 20:28:23 +08:00
iridescentWen
a0cc2be2dc docs: document the tenant_id parameter in resume parsing (#18169)
Second ragflow PR (#17639 merged 2026-07-31). Docstrings only, no
behavior change.

---

🤖 Written with [Claude Code](https://claude.com/claude-code). Each site
was opened and read, and
each description was checked against the line that consumes the value.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-12 20:21:26 +08:00
jay77721
207e2eaf3b fix(ingestion): strip mid-text think blocks in extractor metadata path (#18175) 2026-08-12 19:39:49 +08:00
balibabu
e2cf2fdedb Fix: Clicking the agent's code tool node is prohibited. (#18165) 2026-08-12 19:39:25 +08:00
YanZhang
df60798b86 docs: remove unnecessary docs & adjust page layout (#18146)
remove unnecessary docs 
adjust page layout 
fix some images layout 
add chat channel docs
2026-08-12 19:39:15 +08:00
jay77721
91fd114783 fix(dao): honor tenant-configured context window override (D22/D23) (#18171)
Make `ResolveModelContentLength` honor the per-model custom **context window length** (`content_length`) — stored in the Python-legacy `tenant_model.extra["max_tokens"]` field, whose semantic meaning is the context window, NOT the generation cap — **before** any provider-catalog read, and remove the parallel service-layer implementation so every consumer shares one resolution path.
2026-08-12 19:32:37 +08:00
balibabu
0a825fde89 Feat: Adjust the agent list style. (#18163) 2026-08-12 19:14:59 +08:00
buua436
649b631cac fix: improve incremental wiki compilation (#18164) 2026-08-12 19:12:39 +08:00
euvre
3d64f8d044 fix(ingestion): remove broken built-in Resume pipeline (#18173) 2026-08-12 19:11:49 +08:00
balibabu
5b701f23e5 Fix: Preserve the text format returned by the API. (#18167) 2026-08-12 19:08:48 +08:00
chanx
544b7c1bca fix: keep loading indicator on streaming assistant message in agent chat (#18172) 2026-08-12 19:08:20 +08:00
Jack
8c5c870470 fix(parser): emit a single structured table item in document order (#18168) 2026-08-12 18:36:21 +08:00
Jack
7646afab1b fix(pdf/layout): recover title-bridged & gutter-less double columns (2D rescue + L3) (#18150)
Incremental follow-up to #18023 (gap + balance-gate hybrid). Adds two
complementary column detectors to `AssignColumn` that run **only after**
the gap detector and the balance gate both fail, so already-correct
pages are never touched.
2026-08-12 17:59:50 +08:00
Jack
a4dbd898bb docs(ingestion): correct stale parser-component scope comment (#18147) 2026-08-12 17:58:05 +08:00
Zhichang Yu
c677e9af36 Port dataset-level knowledge compile to Go with variant dispatch (#18161)
Ports dataset-level knowledge compilation (tree/structure/wiki) to Go:
add compile-type variants to backlog events, route per-variant
dataset-level paths, move dataset-nav to the consumer, add structure
merge and per-variant clean, plus rebuild variant recovery.
2026-08-12 17:24:12 +08:00
jay77721
d7682b5b92 fix(agent): fit LLM prompts to model content_length (#18093)
Use the chat model's context window (`content_length`) as the message-fitting budget instead of the canvas `max_tokens` parameter.
2026-08-12 17:23:43 +08:00
euvre
eada2f6b6c test: release test_documents_metadata_update_path for Go proxy (#17646) 2026-08-12 16:13:47 +08:00
euvre
bc89010232 fix: persist page size across main page navigation (#17439) 2026-08-12 16:10:53 +08:00
chanx
9cece9ca01 fix: reorder user setting sidebar menu items and update default redirect path (#18155) 2026-08-12 15:56:12 +08:00
balibabu
6152f7e6bf Fix: Hide the reset button on the embedded page that is in conversation (#18153) 2026-08-12 15:45:16 +08:00
jay77721
86b6f64abb fix(ingestion): fit extractor and tagger prompts to model context (#18095)
Trim Extractor call prompts and the automatic tagger prompt to the chat model's context window (`content_length`) before sending, so oversized chunks or tag files are trimmed instead of rejected by the provider with a context-length error.
2026-08-12 15:45:01 +08:00
jay77721
341e913b7f refactor(agent): use shared message-fit in LLM component (#18092)
Switch the agent LLM component's `fitMessages` from the local map-based `messageFitInRaw`/`countAllTokens`/`stringContent`/`setContent` helpers to the new shared `internal/component/messagefit` package (#18091).
2026-08-12 15:43:46 +08:00
euvre
247c56fb4d fix: enable preview for legacy .doc documents in Go server (#17767) 2026-08-12 15:43:10 +08:00
chanx
efa1c6c48a fix: skip built-in parser validation when pipeline mode is selected (#18158) 2026-08-12 15:41:15 +08:00
balibabu
051b296e7f Fix: Deleting a record from the knowledge base table should remove the corresponding selected record. (#18142) 2026-08-12 15:35:09 +08:00
balibabu
0a7ba32e77 Feat: The dataset-level tree view supports search. (#18138) 2026-08-12 15:34:11 +08:00
chanx
4a6bed802b fix: prevent stale conversation messages during session switch (#18140) 2026-08-12 14:57:20 +08:00
euvre
da8cbca024 Go: clear stale task cancel flag so first re-parse after cancel runs (#17708) 2026-08-12 14:55:46 +08:00
euvre
27edad8a76 Go: implement ?type=filter branch for GET /agents (#18111) 2026-08-12 14:54:48 +08:00
euvre
49646da32d fix(web): align Go chunk method dropdown order with Python parser_ids (#18127) 2026-08-12 14:54:20 +08:00
euvre
70485d7ad0 Fix embed dialog language label mistranslation (#17827) 2026-08-12 14:52:44 +08:00
euvre
127ec4408b Fix(mcp): reset bulk selection after delete and mode switch (#18073) 2026-08-12 14:49:26 +08:00
euvre
6bf51925b3 feat(web): submit retrieval testing form on Enter, newline on Shift+Enter (#17741) 2026-08-12 14:47:46 +08:00
euvre
f8b2b1248c fix: drop static catalog check when resolving tenant default models (#17714) 2026-08-12 14:46:37 +08:00
euvre
6d44cd09eb fix(web): add missing 'general' chunk method description in locales (#17773) 2026-08-12 14:46:13 +08:00
euvre
fdb6b5fdd2 fix: search files recursively within current folder subtree (#17779) 2026-08-12 14:43:06 +08:00
euvre
a530a3a170 fix: clean up wiki blueprint default instruction text (#17893) 2026-08-12 14:39:36 +08:00
mkaaad
1b02abd487 Honor explicit model URL overrides for NVIDIA endpoints (#18152)
Some NVIDIA hosted models (e.g. meta/llama-3.2-11b-vision-instruct )
expose a full
endpoint URL per model that does not follow the normal base_url +
url_suffix
assembly. Previously the Go driver always called {base}/chat/completions
, so chat
requests for these vision models hit the wrong endpoint and failed.

This PR adds an optional per-model url field in conf/models/nvidia.json
. When
present, every NVIDIA driver request (chat, streaming chat, embedding,
rerank, model
listing) uses it directly; otherwise the standard assembly is unchanged.
2026-08-12 14:17:13 +08:00
Jack
7b2d052f8a refactor(parser): align TextParser with Python _code delimiter split (#18128) 2026-08-12 13:07:23 +08:00
jay77721
a9123368c5 feat(dao): add shared ResolveModelContentLength helper (#18106)
Add a shared `dao.ResolveModelContentLength` that resolves a chat model's context window (`content_length`) from a `tenant_model` UUID or a composite `model@provider` reference, with an optional `driver + modelName` catalog fallback for the no-database path.
2026-08-12 13:04:40 +08:00
jay77721
fb08a6c5ee feat(component): add shared message-fit package (#18091)
The agent LLM component and the ingestion Extractor component both need
to trim prompts to the model's context window before calling the
provider. Each previously did (or would do) this with its own copy of
the logic. This PR adds the shared primitive; follow-up PRs wire it into
the agent LLM component (#18092) and the ingestion Extractor/tagger
(#18095).
2026-08-12 13:03:45 +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
qinling0210
b73aac38f4 Update infinity json_extract_string usage (#18139)
### Summary

Update infinity json_extract_string usage. 

Example: json_extract_string(chunk_data, '$.name') LIKE '%Alice%'
2026-08-12 10:59:22 +08:00
euvre
c0274fff19 fix: make txt file preview scrollable with mouse wheel (#17911) 2026-08-12 10:31:18 +08:00
Wang Qi
3e4a1fa887 Add doc_name for compilation generated chunk (#18126) dev-20260812 2026-08-12 09:37:25 +08:00
chanx
e195a25972 fix: prevent stale loading state on previous agent chat reply (#18124) 2026-08-12 09:36:45 +08:00
Aari
a0e091e750 fix(data_source): scope table and link state to ancestors in format_document_soup (#17045)
### Summary

`format_document_soup` tracks "am I inside a table" and "am I inside a
link" with sticky flags that are meant to be reset by `elif e.name ==
"/table"` and `elif e.name == "/a"`. BeautifulSoup's `.descendants` only
yields opening tags — a `Tag` named `/table` or `/a` never exists — so
both branches are dead code and neither flag is ever cleared.

Everything after the first `<table>` on a page is therefore formatted as
if it were still table content: paragraphs lose their newline, list
items lose their `- ` marker, headings lose their break, and the text is
glued onto the last table cell. Under
`HTML_BASED_CONNECTOR_TRANSFORM_LINKS_STRATEGY=markdown` the same bug
leaks a link's `href` into everything that follows it, including whole
subsequent paragraphs. The Confluence connector
(`confluence_connector.py:948`) goes through this path.

Real output for a Confluence-shaped page (heading, intro, spec table,
then the body) via the public `parse_html_page_basic`:

**Before**

```
	prod	us-east-1 Rollback procedure If the canary fails, run the rollback script immediately. Drain the load balancer Revert the deployment Escalate to the on-call rota if the rollback stalls. Do not skip the post-mortem.
```

**After**

```
	prod	us-east-1
Rollback procedure
If the canary fails, run the rollback script immediately.
- Drain the load balancer
- Revert the deployment
Escalate to [the on-call rota](http://oncall.example.com) if the rollback stalls.
Do not skip the post-mortem.
```

Every heading, paragraph and list marker after the table is lost, and
the whole body is indexed as one run-on line hanging off a table cell.

### Fix

Derive both scopes from each element's **ancestors** instead of from
flags that nothing can clear, and drop the two dead branches plus the
two that become redundant.

The scopes are resolved in one up-front pass into `id`-keyed maps
(`table_scope`, `href_scope`) and looked up in O(1) per element. Probing
per element with `find_parent` instead is O(depth) each, which measured
12–13× slower on table-heavy pages and up to 103× on deeply nested
markup; the map version costs a depth-independent 1.13–1.35× over
`main`. Numbers and method are in the round-2 comment below.

This also changes one adjacent behaviour worth calling out explicitly: a
link **inside** a table cell now renders as markdown, where before it
rendered as plain text. That previous behaviour was not by design — it
only held when no link preceded the table. With a link before the table,
`main` stamps the stale href onto every cell:

```
main:   '[pre](http://STALE.com)\n\t[cellA](http://STALE.com)\t[cellB](http://STALE.com)'
branch: '[pre](http://STALE.com)\n\tcellA\tcellB'
```

Those cells are not links. Both symptoms are the same sticky-state bug,
so they are fixed together rather than left half-done.

### Testing

`test/unit_test/data_source/test_html_utils.py` is new —
`format_document_soup` had no test coverage. 11 tests: 8 fail on `main`
and pass on this branch, 3 are controls that pass on both (the table
itself still separates rows and cells, anchor text is still linkified,
the default `strip` strategy still strips).

Representative failures on `main`:

```
assert '\nAfter' in 'Before\n\tA\tB After'
assert '\n- item1' in 'Before\n\tA\tB item1 item2'
assert 'see [link](http://x.com) [ after](http://x.com)' == 'see [link](http://x.com) after'
assert '[next paragraph]' not in '[link](http://x.com)\n[next paragraph](http://x.com)'
```

Reverting each clause of the fix independently keeps the anchors honest:
reverting only the table clause fails exactly the 4 table tests and
leaves the link tests green; reverting only the link clause fails
exactly the 3 link tests and leaves the table tests green.
(`test_link_inside_a_table_cell_is_linkified` needs both clauses broken
to fail, so it appears in neither single-clause revert — it is covered
by the 8-fail run against `main`.)

Full `test/unit_test/data_source/` suite: **3 failed, 199 passed**, and
the failure set is byte-identical to clean `main` (**3 failed, 188
passed**) — the 3 are `TestSSRFValidation::*`, which resolve
`api.example.com` against real DNS and are unrelated to this change.
`ruff check` and `ruff format --check` are clean on both touched files.

---

This PR was drafted with AI assistance (Claude). I reviewed the change,
independently reproduced both symptoms against `main`, and take
responsibility for it.
2026-08-11 22:28:40 +08:00
taek105
492d6d81a9 fix: honor dataset language in Go vision dispatch (#17892)
### Summary

- Propagate the dataset language through Go DOCX, Markdown, PDF
figure-enhancement, and standalone-image vision paths.
- Explicitly render the shared figure prompt's `{{ language }}`
placeholder in Go.
- Use English when the dataset language is empty.
- Make the default standalone-image prompt request the dataset language
while preserving visible text in its original language.
- Add focused tests for caller propagation, language fallback, prompt
rendering, and prompt-cache isolation.
2026-08-11 22:18:04 +08:00