Skip to content

Feat: more templates - #14075

Merged
yingfeng merged 8 commits into
infiniflow:mainfrom
Magicbook1108:template
Apr 14, 2026
Merged

yingfeng merged 8 commits into
infiniflow:mainfrom
Magicbook1108:template

Conversation

@Magicbook1108

@Magicbook1108 Magicbook1108 commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

What problem does this PR solve?

Feat: more templates
image

TODO:

  1. Logo

Type of change

  • New Feature (non-breaking change which adds functionality)

@dosubot dosubot Bot added the size:XS This PR changes 0-9 lines, ignoring generated files. label Apr 13, 2026
@coderabbitai

coderabbitai Bot commented Apr 13, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a34a4559-ed5c-44c3-a25c-e768552aa304

📥 Commits

Reviewing files that changed from the base of the PR and between 54ec91e and bee9cf4.

📒 Files selected for processing (6)
  • agent/templates/ingestion_pipeline_Book.json
  • agent/templates/ingestion_pipeline_General.json
  • agent/templates/ingestion_pipeline_Laws.json
  • agent/templates/ingestion_pipeline_Manual.json
  • agent/templates/ingestion_pipeline_One.json
  • agent/templates/ingestion_pipeline_Paper.json
✅ Files skipped from review due to trivial changes (4)
  • agent/templates/ingestion_pipeline_General.json
  • agent/templates/ingestion_pipeline_One.json
  • agent/templates/ingestion_pipeline_Laws.json
  • agent/templates/ingestion_pipeline_Paper.json
🚧 Files skipped from review as they are similar to previous changes (2)
  • agent/templates/ingestion_pipeline_Manual.json
  • agent/templates/ingestion_pipeline_Book.json

📝 Walkthrough

Walkthrough

Six new ingestion pipeline template files added to agent/templates/. Each defines a linear dataflow: File → Parser:HipSignsRhyme → Chunker (TitleChunker or TokenChunker) → Tokenizer, tailored for books, general docs, laws, manuals, single-file, and papers.

Changes

Cohort / File(s) Summary
Ingestion Pipeline Templates
agent/templates/ingestion_pipeline_Book.json, agent/templates/ingestion_pipeline_General.json, agent/templates/ingestion_pipeline_Laws.json, agent/templates/ingestion_pipeline_Manual.json, agent/templates/ingestion_pipeline_One.json, agent/templates/ingestion_pipeline_Paper.json
Added six new JSON templates. Each declares canvas metadata, File→Parser:HipSignsRhyme→Chunker→Tokenizer graph wiring, parser per-format setups/outputs (pdf, image/OCR, email, markdown, html, doc/docx, text&code, etc.), chunking strategies (hierarchy/group/token-based) with domain-specific regex rules, and tokenizer indexing settings (fields: "text", search_method: ["embedding","full_text"], filename_embd_weight: 0.1). Graph node positions and avatars included.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant File as File
  participant Parser as Parser:HipSignsRhyme
  participant Chunker as Title/Token Chunker
  participant Tokenizer as Tokenizer
  participant Index as Index/Search

  File->>Parser: upload file / forward main_content
  Parser->>Parser: format-specific preprocess & parse (pdf/html/ocr/markdown/...)
  Parser->>Chunker: parsed output (main_content / structured parts)
  Chunker->>Chunker: apply hierarchy/group/token rules → produce chunks
  Chunker->>Tokenizer: emit chunks (fields: text)
  Tokenizer->>Index: index (embedding + full_text, filename weight)
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested labels

size:XXL

Poem

🐰 Six templates sprout in JSON rows,

Pages parsed where moonlight glows,
Chapters chopped with regex cheer,
Tokens leapt and indexed near,
A rabbit hums — ingestion grows. 🥕

🚥 Pre-merge checks | ✅ 1 | ❌ 2

❌ Failed checks (1 warning, 1 inconclusive)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is incomplete. It includes only a vague statement and an image reference, but omits the required section explaining what problem the PR solves, and the Type of change section lacks substantive detail. Expand the 'What problem does this PR solve?' section with a clear explanation of why these templates are needed, and provide detailed context about the ingestion pipeline templates being added.
Title check ❓ Inconclusive The title is vague and generic—'more templates' does not specify which templates or their purpose, making it difficult for reviewers scanning history to understand the primary change. Replace with a more specific title such as 'Add ingestion pipeline templates: Laws, Book, Paper, Manual, General, and One' to clearly identify what templates are being added.
✅ Passed checks (1 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@agent/templates/Book.json`:
- Around line 62-70: The template's executable parser config for formats (e.g.,
the "docx" object under Book.json) lacks "remove_toc" whereas the canvas/form
config (graph.nodes[*].data.form.setups) enables remove_toc for docx, html, and
markdown; update the executable parser entries for "docx", "html", and
"markdown" (and mirror the change where "pdf" already has it) to include the
same "remove_toc" setting so saved template behavior matches the editor/canvas
configuration.
- Line 203: The regex "[\\(\uff08][0-9]{,2}[\\)\uff09]" contains an invalid
quantifier `{,2}`; update it to use a valid quantifier `{0,2}` (i.e.
"[\\(\uff08][0-9]{0,2}[\\)\uff09]") and make the identical change to the
mirrored rule in the graph form later in the file so both occurrences match and
compile correctly.

In `@agent/templates/Laws.json`:
- Line 226: The regex in the TitleChunker levels uses an invalid Python
quantifier `{,2}`; update the pattern string "[\\(\uff08][0-9]{,2}[\\)\uff09]"
to use the valid interval `{0,2}` and also update the mirrored JavaScript/node
form of the same pattern later in the file so both places inside the component
"TitleChunker" (look for levels in component obj.params.levels) use
"[\\(\uff08][0-9]{0,2}[\\)\uff09]".

In `@agent/templates/Manual.json`:
- Line 207: The regex pattern string "[\\(\uff08][0-9]{,2}[\\)\uff09]" uses an
invalid quantifier `{,2}`; update the pattern(s) in Manual.json (the occurrences
that match the shown string at lines ~207 and ~477) to use the explicit lower
bound `{0,2}` (i.e., replace `{,2}` with `{0,2}`) so the expression becomes
valid in standard regex engines; ensure both occurrences of the same pattern are
updated.

In `@agent/templates/Paper.json`:
- Line 207: The regex pattern string "[\\(\uff08][0-9]{,2}[\\)\uff09]" uses an
invalid quantifier `{,2}`; update this pattern (and its duplicate in the
graph/expression-section) to use the portable quantifier `{0,2}` so it becomes
"[\\(\uff08][0-9]{0,2}[\\)\uff09]"; locate the pattern occurrences in the
rules-section and the graph/expression-section and replace `{,2}` with `{0,2}`
in both places (search for the exact token "[\\(\uff08][0-9]{,2}[\\)\uff09]" to
find each instance).
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 87d4b809-5f49-4e8f-8925-0af48f07019f

📥 Commits

Reviewing files that changed from the base of the PR and between a023305 and 373a074.

📒 Files selected for processing (6)
  • agent/templates/Book.json
  • agent/templates/General.json
  • agent/templates/Laws.json
  • agent/templates/Manual.json
  • agent/templates/One.json
  • agent/templates/Paper.json

Comment on lines +62 to +70
"docx": {
"output_format": "json",
"preprocess": [
"main_content"
],
"suffix": [
"docx"
],
"vlm": {}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Sync remove_toc with the editor copy.

The executable parser config only enables remove_toc for pdf, but the later graph.nodes[*].data.form.setups block enables it for docx, html, and markdown too. That means the saved template runs one configuration while the canvas shows another.

Proposed fix
                             "docx": {
                                 "output_format": "json",
                                 "preprocess": [
                                     "main_content"
                                 ],
+                                "remove_toc": true,
                                 "suffix": [
                                     "docx"
                                 ],
                                 "vlm": {}
                             },
@@
                             "html": {
                                 "output_format": "json",
                                 "preprocess": [
                                     "main_content"
                                 ],
+                                "remove_toc": true,
                                 "suffix": [
                                     "htm",
                                     "html"
                                 ]
                             },
@@
                             "markdown": {
                                 "output_format": "json",
                                 "preprocess": [
                                     "main_content"
                                 ],
+                                "remove_toc": true,
                                 "suffix": [
                                     "md",
                                     "markdown",
                                     "mdx"
                                 ],

Also applies to: 92-100, 115-125

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agent/templates/Book.json` around lines 62 - 70, The template's executable
parser config for formats (e.g., the "docx" object under Book.json) lacks
"remove_toc" whereas the canvas/form config (graph.nodes[*].data.form.setups)
enables remove_toc for docx, html, and markdown; update the executable parser
entries for "docx", "html", and "markdown" (and mirror the change where "pdf"
already has it) to include the same "remove_toc" setting so saved template
behavior matches the editor/canvas configuration.

"\u7b2c[\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e0-9]+\u8282",
"[\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e]+[ \u3001]",
"[\\(\uff08][\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e]+[\\)\uff09]",
"[\\(\uff08][0-9]{,2}[\\)\uff09]"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

This heading regex uses an invalid quantifier.

{,2} should be {0,2} here as well; otherwise the backend regex compilation will fail. Please update the mirrored rule in the graph form later in this file too.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agent/templates/Book.json` at line 203, The regex
"[\\(\uff08][0-9]{,2}[\\)\uff09]" contains an invalid quantifier `{,2}`; update
it to use a valid quantifier `{0,2}` (i.e. "[\\(\uff08][0-9]{0,2}[\\)\uff09]")
and make the identical change to the mirrored rule in the graph form later in
the file so both occurrences match and compile correctly.

"\u7b2c[\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e0-9]+\u8282",
"[\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e]+[ \u3001]",
"[\\(\uff08][\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e]+[\\)\uff09]",
"[\\(\uff08][0-9]{,2}[\\)\uff09]"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Replace this quantifier with {0,2}.

{,2} is not a valid interval quantifier in Python re, so this rule will fail when the chunker compiles it. Please update the mirrored copy in the node form later in this file too.

#!/bin/bash
python - <<'PY'
import json, re

for path in [
    "agent/templates/Laws.json",
    "agent/templates/Book.json",
    "agent/templates/Manual.json",
    "agent/templates/Paper.json",
]:
    with open(path, encoding="utf-8") as f:
        data = json.load(f)

    for name, component in data["dsl"]["components"].items():
        if component["obj"]["component_name"] != "TitleChunker":
            continue

        for i, level_group in enumerate(component["obj"]["params"]["levels"]):
            for j, expr in enumerate(level_group):
                try:
                    re.compile(expr)
                except re.error as e:
                    print(f"{path} levels[{i}][{j}] -> {expr!r}: {e}")
PY
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agent/templates/Laws.json` at line 226, The regex in the TitleChunker levels
uses an invalid Python quantifier `{,2}`; update the pattern string
"[\\(\uff08][0-9]{,2}[\\)\uff09]" to use the valid interval `{0,2}` and also
update the mirrored JavaScript/node form of the same pattern later in the file
so both places inside the component "TitleChunker" (look for levels in component
obj.params.levels) use "[\\(\uff08][0-9]{0,2}[\\)\uff09]".

"\u7b2c[\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e0-9]+\u8282",
"[\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e]+[ \u3001]",
"[\\(\uff08][\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e]+[\\)\uff09]",
"[\\(\uff08][0-9]{,2}[\\)\uff09]"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

find . -name "Manual.json" -type f

Repository: infiniflow/ragflow

Length of output: 91


🏁 Script executed:

grep -n "\[\\\\(\\\uff08\]\[0-9\]" . -r --include="*.json"

Repository: infiniflow/ragflow

Length of output: 44


🏁 Script executed:

head -n 220 agent/templates/Manual.json | tail -n 30

Repository: infiniflow/ragflow

Length of output: 2098


🏁 Script executed:

cat -n agent/templates/Manual.json | grep -E '\[0-9\]\{,2\}'

Repository: infiniflow/ragflow

Length of output: 241


🏁 Script executed:

rg '\[0-9\]\{,2\}' agent/templates/Manual.json -n

Repository: infiniflow/ragflow

Length of output: 235


🏁 Script executed:

rg '\{,2\}' agent/templates/Manual.json -n

Repository: infiniflow/ragflow

Length of output: 235


Use {0,2} instead of {,2} in this rule.

The regex has an invalid quantifier at lines 207 and 477. The shorthand {,2} is not supported in standard regex engines—the lower bound must be explicitly specified as {0,2}.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agent/templates/Manual.json` at line 207, The regex pattern string
"[\\(\uff08][0-9]{,2}[\\)\uff09]" uses an invalid quantifier `{,2}`; update the
pattern(s) in Manual.json (the occurrences that match the shown string at lines
~207 and ~477) to use the explicit lower bound `{0,2}` (i.e., replace `{,2}`
with `{0,2}`) so the expression becomes valid in standard regex engines; ensure
both occurrences of the same pattern are updated.

"\u7b2c[\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e0-9]+\u8282",
"[\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e]+[ \u3001]",
"[\\(\uff08][\u96f6\u4e00\u4e8c\u4e09\u56db\u4e94\u516d\u4e03\u516b\u4e5d\u5341\u767e]+[\\)\uff09]",
"[\\(\uff08][0-9]{,2}[\\)\uff09]"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

cat -n agent/templates/Paper.json | sed -n '200,215p'

Repository: infiniflow/ragflow

Length of output: 1246


🏁 Script executed:

rg '\[\\\\\\(\\uff08\]\[0-9\]\{,2\}\[\\\\\\)\\uff09\]' agent/templates/Paper.json -n

Repository: infiniflow/ragflow

Length of output: 44


🌐 Web query:

Python re module quantifier syntax {,2} invalid

💡 Result:

Yes, the Python re module considers {,2} invalid quantifier syntax. The correct syntax for the {m,n} quantifier requires m and n to be decimal integers with no spaces or missing values inside the braces. {,2} lacks a valid m (minimum repetitions), making it invalid. Official Python documentation specifies: "{m,n} Causes the resulting RE to match from m to n repetitions... Omitting m specifies a lower bound of zero" as in {0,2} or {,2} is not accepted; it must be explicitly {0,2}. Spaces inside like {1, 2} also cause the pattern to match literally rather than as a quantifier. When compiling a pattern with {,2}, Python raises re.error: bad repetition argument, confirming it's invalid syntax. To match 0-2 repetitions, use {0,2}. For example: import re re.compile(r'a{0,2}') # Valid, matches 0, 1, or 2 'a's re.compile(r'a{,2}') # Raises re.error: bad repetition argument

Citations:


🏁 Script executed:

rg '\{,2\}' agent/templates/ -n

Repository: infiniflow/ragflow

Length of output: 955


🏁 Script executed:

grep -n "graph\|Graph" agent/templates/Paper.json

Repository: infiniflow/ragflow

Length of output: 84


🏁 Script executed:

rg '\[0-9\]\{,2\}' agent/templates/ -n

Repository: infiniflow/ragflow

Length of output: 955


Fix invalid regex quantifier syntax from {,2} to {0,2} on lines 207 and 480.

The quantifier {,2} is invalid in Python's re module and will raise re.error: bad repetition argument at runtime. Both the rules-section pattern (line 207) and the graph/expression-section copy (line 480) need to use the portable {0,2} form instead.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agent/templates/Paper.json` at line 207, The regex pattern string
"[\\(\uff08][0-9]{,2}[\\)\uff09]" uses an invalid quantifier `{,2}`; update this
pattern (and its duplicate in the graph/expression-section) to use the portable
quantifier `{0,2}` so it becomes "[\\(\uff08][0-9]{0,2}[\\)\uff09]"; locate the
pattern occurrences in the rules-section and the graph/expression-section and
replace `{,2}` with `{0,2}` in both places (search for the exact token
"[\\(\uff08][0-9]{,2}[\\)\uff09]" to find each instance).

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (5)
agent/templates/ingestion_pipeline_Book.json (2)

62-70: ⚠️ Potential issue | 🟠 Major

Sync remove_toc between executable config and canvas form.

The graph.nodes form setups enable remove_toc: true for docx, html, and markdown (lines 361, 377, 392), but the executable components.Parser.params.setups lacks this setting for these formats. Only pdf (line 133) has it in both places. This causes a mismatch between what the canvas displays and what actually executes.

🔧 Proposed fix for components section
                             "docx": {
                                 "output_format": "json",
                                 "preprocess": [
                                     "main_content"
                                 ],
+                                "remove_toc": true,
                                 "suffix": [
                                     "docx"
                                 ],
                                 "vlm": {}
                             },

Apply similar changes to html (around line 92) and markdown (around line 115).

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agent/templates/ingestion_pipeline_Book.json` around lines 62 - 70, The
executable parser setups are missing the remove_toc flag for docx/html/markdown
causing a mismatch with the graph.nodes form; update
components.Parser.params.setups to include "remove_toc": true for the "docx",
"html", and "markdown" format entries (pdf already has it) so the parser setups
mirror the graph.nodes form configuration.

203-203: ⚠️ Potential issue | 🟠 Major

Fix invalid regex quantifier {,2} → {0,2}.

The quantifier {,2} is invalid in Python's re module. Update this pattern and its duplicate at line 497.

🐛 Proposed fix

Line 203:

-                                "[\\(\uff08][0-9]{,2}[\\)\uff09]"
+                                "[\\(\uff08][0-9]{0,2}[\\)\uff09]"

Line 497:

-                                            "expression": "[\\(\uff08][0-9]{,2}[\\)\uff09]"
+                                            "expression": "[\\(\uff08][0-9]{0,2}[\\)\uff09]"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agent/templates/ingestion_pipeline_Book.json` at line 203, The regex pattern
"[\\(\uff08][0-9]{,2}[\\)\uff09]" uses an invalid quantifier "{,2}"; update both
occurrences of this pattern (the one shown and its duplicate elsewhere in the
template) to use a valid quantifier by replacing "{,2}" with "{0,2}" so the
pattern becomes "[\\(\uff08][0-9]{0,2}[\\)\uff09]".
agent/templates/ingestion_pipeline_Manual.json (1)

207-207: ⚠️ Potential issue | 🟠 Major

Fix invalid regex quantifier {,2} → {0,2}.

The quantifier {,2} is invalid in Python's re module. Update this pattern and its duplicate at line 477.

🐛 Proposed fix

Line 207:

-                                    "[\\(\uff08][0-9]{,2}[\\)\uff09]"
+                                    "[\\(\uff08][0-9]{0,2}[\\)\uff09]"

Line 477:

-                                            "expression": "[\\(\uff08][0-9]{,2}[\\)\uff09]"
+                                            "expression": "[\\(\uff08][0-9]{0,2}[\\)\uff09]"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agent/templates/ingestion_pipeline_Manual.json` at line 207, Replace the
invalid regex quantifier `{,2}` with `{0,2}` in the pattern string
"[\\(\uff08][0-9]{,2}[\\)\uff09]" (and its duplicate occurrence) so the Python
re module accepts it; update both instances of that pattern in
agent/templates/ingestion_pipeline_Manual.json to use
"[\\(\uff08][0-9]{0,2}[\\)\uff09]".
agent/templates/ingestion_pipeline_Laws.json (1)

226-226: ⚠️ Potential issue | 🟠 Major

Fix invalid regex quantifier {,2} → {0,2}.

The quantifier {,2} is invalid in Python's re module. Update this pattern and its duplicate at line 525.

🐛 Proposed fix

Line 226:

-                                    "[\\(\uff08][0-9]{,2}[\\)\uff09]"
+                                    "[\\(\uff08][0-9]{0,2}[\\)\uff09]"

Line 525:

-                                            "expression": "[\\(\uff08][0-9]{,2}[\\)\uff09]"
+                                            "expression": "[\\(\uff08][0-9]{0,2}[\\)\uff09]"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agent/templates/ingestion_pipeline_Laws.json` at line 226, The JSON contains
an invalid regex quantifier in the pattern string
"[\\(\uff08][0-9]{,2}[\\)\uff09]" (and its duplicate) used in the ingestion
pipeline; update both occurrences to use the valid quantifier "{0,2}" (i.e.
"[\\(\uff08][0-9]{0,2}[\\)\uff09]") so Python's re accepts the pattern while
preserving the surrounding escape sequences and unicode parentheses tokens.
agent/templates/ingestion_pipeline_Paper.json (1)

207-207: ⚠️ Potential issue | 🟠 Major

Fix invalid regex quantifier {,2} → {0,2}.

The quantifier {,2} is invalid in Python's re module and will raise re.error: bad repetition argument at runtime. The same invalid pattern also appears at line 480 in the graph rules section.

🐛 Proposed fix

Line 207:

-                                "[\\(\uff08][0-9]{,2}[\\)\uff09]"
+                                "[\\(\uff08][0-9]{0,2}[\\)\uff09]"

Line 480:

-                                            "expression": "[\\(\uff08][0-9]{,2}[\\)\uff09]"
+                                            "expression": "[\\(\uff08][0-9]{0,2}[\\)\uff09]"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@agent/templates/ingestion_pipeline_Paper.json` at line 207, The regex pattern
string "[\\(\uff08][0-9]{,2}[\\)\uff09]" uses an invalid quantifier `{,2}`;
update this pattern to use `{0,2}` wherever it appears (the occurrence in the
main rules and the duplicate in the graph rules) so it becomes
"[\\(\uff08][0-9]{0,2}[\\)\uff09]"; search for the exact pattern in the
ingestion_pipeline_Paper.json template and replace both instances to avoid
Python re.error at runtime.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@agent/templates/ingestion_pipeline_Book.json`:
- Around line 62-70: The executable parser setups are missing the remove_toc
flag for docx/html/markdown causing a mismatch with the graph.nodes form; update
components.Parser.params.setups to include "remove_toc": true for the "docx",
"html", and "markdown" format entries (pdf already has it) so the parser setups
mirror the graph.nodes form configuration.
- Line 203: The regex pattern "[\\(\uff08][0-9]{,2}[\\)\uff09]" uses an invalid
quantifier "{,2}"; update both occurrences of this pattern (the one shown and
its duplicate elsewhere in the template) to use a valid quantifier by replacing
"{,2}" with "{0,2}" so the pattern becomes "[\\(\uff08][0-9]{0,2}[\\)\uff09]".

In `@agent/templates/ingestion_pipeline_Laws.json`:
- Line 226: The JSON contains an invalid regex quantifier in the pattern string
"[\\(\uff08][0-9]{,2}[\\)\uff09]" (and its duplicate) used in the ingestion
pipeline; update both occurrences to use the valid quantifier "{0,2}" (i.e.
"[\\(\uff08][0-9]{0,2}[\\)\uff09]") so Python's re accepts the pattern while
preserving the surrounding escape sequences and unicode parentheses tokens.

In `@agent/templates/ingestion_pipeline_Manual.json`:
- Line 207: Replace the invalid regex quantifier `{,2}` with `{0,2}` in the
pattern string "[\\(\uff08][0-9]{,2}[\\)\uff09]" (and its duplicate occurrence)
so the Python re module accepts it; update both instances of that pattern in
agent/templates/ingestion_pipeline_Manual.json to use
"[\\(\uff08][0-9]{0,2}[\\)\uff09]".

In `@agent/templates/ingestion_pipeline_Paper.json`:
- Line 207: The regex pattern string "[\\(\uff08][0-9]{,2}[\\)\uff09]" uses an
invalid quantifier `{,2}`; update this pattern to use `{0,2}` wherever it
appears (the occurrence in the main rules and the duplicate in the graph rules)
so it becomes "[\\(\uff08][0-9]{0,2}[\\)\uff09]"; search for the exact pattern
in the ingestion_pipeline_Paper.json template and replace both instances to
avoid Python re.error at runtime.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 3674adce-abcd-4e11-b191-9f54fbcb09c3

📥 Commits

Reviewing files that changed from the base of the PR and between 373a074 and 54ec91e.

📒 Files selected for processing (6)
  • agent/templates/ingestion_pipeline_Book.json
  • agent/templates/ingestion_pipeline_General.json
  • agent/templates/ingestion_pipeline_Laws.json
  • agent/templates/ingestion_pipeline_Manual.json
  • agent/templates/ingestion_pipeline_One.json
  • agent/templates/ingestion_pipeline_Paper.json
✅ Files skipped from review due to trivial changes (2)
  • agent/templates/ingestion_pipeline_One.json
  • agent/templates/ingestion_pipeline_General.json

@writinwaters

Copy link
Copy Markdown
Contributor

I would suggest adding the ingestion_pipeline_ prefix to the filenames to clearly differentiate between agentic workflow and ingestion pipeline workflow templates.

@writinwaters writinwaters left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@yingfeng
yingfeng merged commit 8723c3a into infiniflow:main Apr 14, 2026
1 check passed
@Magicbook1108
Magicbook1108 deleted the template branch April 15, 2026 09:00
JasleenKaurSethi pushed a commit to stackhpc/ragflow that referenced this pull request Apr 28, 2026
### What problem does this PR solve?

Feat: more templates
<img width="700" alt="image"
src="https://github.com/user-attachments/assets/533e88f1-fc56-4337-a026-6623fc978893"
/>


### Type of change

- [x] New Feature (non-breaking change which adds functionality)

---------

Co-authored-by: writinwaters <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XS This PR changes 0-9 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants