ragflow
AGENTS.md92k starsChanged 9 months agoApache-2.0View on GitHub
Use this file as the local operating guide for the current codebase. Prefer the code and the current AGENTS.md over any older convention or remembered project shape.
- Installs packages
Adopted by
Steady: 0 new projects took it in the last 4 weeks, none the 4 weeks before.thin data
Who's talking about infiniflow/ragflow
- A Hacker News story“RAGFlow is an open-source RAG engine based on OCR and document parsing”Hacker News · Apr 1, 2024 · 230 points
- oceanbase/seekdb“Developer Activities: Call for Participation!”GitHub · Jan 21, 2026 · 7 reactions
- @github-trending-js.bsky.social“🚀 Skyrocketing! 🚀 (200+ new stars) 📦 infiniflow / ragflow ⭐ 38,526 (+438) 🗒 TypeScript RAGFlow is an …”Bluesky · Feb 21, 2025 · 7 likes
- A Hacker News story“DeepSeek-V2 integrated, RAGFlow v0.5.0 is released”Hacker News · May 8, 2024 · 7 points
- @github-trending.bsky.social“🔥 Hot Repo! 🔥 (100+ new stars) 📦 infiniflow / ragflow ⭐ 47,701 (+175) 🗒 TypeScript RAGFlow is an …”Bluesky · Apr 3, 2025 · 6 likes
The biggest 5 of 101 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 101
Talked about on GitHub, Bluesky and Hacker News (101 times).
On GitHub · 50
- Jan 21, 2026Developer Activities: Call for Participation! — oceanbase/seekdb7 reactions · 57 comments
- Aug 15, 2025Add and use the knowledge graph parameter use_kg to the RAGlow external API — langgenius/dify4 reactions · 1 comment
- Feb 10, 2025可否增加支持ragflow? — QuantumNous/new-api4 reactions · 4 comments
- Mar 3, 2025Suggestion: RAGflow — av/harbor2 reactions · 3 comments
- Sep 21, 2026【知识库】AI 知识库演进:从经典检索到 Agentic RAG — QingyaFan/blog1 reaction
45 more on GitHub
- Aug 12, 2026fix(api): point SSRF-blocked error message at the correct dify issue — langgenius/dify1 reaction · 1 comment
- Nov 28, 2025General Feedback re: self-hosting devops, image support, paper writing workflow — khoj-ai/openpaper1 reaction · 4 comments
- Aug 29, 2024What is the difference between kotaemon and other RAG apps? — Cinnamon/kotaemon1 reaction · 2 comments
- Nov 27, 2026RAG-CITE-01: Sentence-level citation grounding (T5) — jian-hong/AirGPT0 reactions
- Nov 27, 2026RAG-RR-01: Measure rerank, then add a RAGFlow-style blended score (T4) — jian-hong/AirGPT0 reactions
- Nov 27, 2026RAG-BENCH-17: CI-regenerate RAG benches and add a harder real-document pack (T1) — jian-hong/AirGPT0 reactions
- Nov 25, 2026Document handoff lookup from RAGFlow — ClickHouse/loom0 reactions · 1 comment
- Nov 12, 2026docs: adversarial falsification pass on PR #790/#791 (memory/KG/CC content) — qte77/ai-agents-research0 reactions
- Nov 10, 2026[Candidate]: ragflow (CLI) - RAGFlow is an agent-native database: a Retrieval-Augmented G — ns0m/scoop-bucket0 reactions · 1 comment
- Nov 7, 2026工具选择指南、三个可做完的作品、可合并的这一周 — superjackman/SI0 reactions
- Oct 29, 2026Add RAGFlow to RAG frameworks list — Danielskry/Awesome-RAG0 reactions
- Oct 29, 2026Add RAGFlow to Developer tools — steven2358/awesome-generative-ai0 reactions
- Oct 24, 2026test(real): 收官修正轮 —— M26 抗替身断言 + M27 口径改 PARTIAL — zzy1661/aip0 reactions
- Oct 24, 2026test(real): 重取 M26 真实证据并补齐 M27 两条真实失败模式 — zzy1661/aip0 reactions
- Oct 12, 2026Supported filetypes for bot service — crownshy/comhairle0 reactions · 2 comments
- Oct 1, 2026maxe no_ocr and pypdfium2 parameters available — docling-project/docling-serve0 reactions · 3 comments
- Sep 23, 2026AACR infiniflow__ragflow@f189316 — razorpaytest/ragflow0 reactions
- Sep 23, 2026AACR infiniflow__ragflow@a63caa1 — razorpaytest/ragflow0 reactions
- Sep 23, 2026AACR infiniflow__ragflow@7051234 — razorpaytest/ragflow0 reactions
- Sep 23, 2026AACR infiniflow__ragflow@2d06022 — razorpaytest/ragflow0 reactions
- Sep 20, 2026Unescape function does not handle escaped hyphen — infiniflow/infinity0 reactions · 1 comment
- Sep 2, 2026feat: integrate relationship-aware memory and specify Continuity — karolswdev/HoldSpeak0 reactions · 2 comments
- Aug 28, 2026Upstream bug: helm chart renders unquoted passwords — Secret rejected by API server, or silently corrupted — whg517/ragflow-helm-chart0 reactions
- Aug 15, 2026Developer Race — RAGFlow — Retrieval & Context Engine — 8x8org/.github0 reactions
- Aug 13, 2026docs: update CLAUDE.md — RJHuey73/ragflow0 reactions
- Jul 13, 2026fix(stt): close Fun-ASR stream responses — 77zane/ragflow0 reactions
- Jun 18, 2026Partner confirmation: infiniflow/ragflow — EvoLinkAI/EvoLinkAI.github.io0 reactions
- Jun 9, 2026[codex] feat: add MiMo LLM runtime and product diagnostics — cetshow/cn-graphrag-eval-opt0 reactions
- May 23, 2026feat: add ragflow template — Phala-Network/phala-cloud0 reactions · 2 comments
- May 7, 2026Update repo table — arran4/arran40 reactions
- Apr 26, 2026Update repo table — arran4/arran40 reactions
- Apr 4, 2026Update repo table — arran4/arran40 reactions
- Mar 27, 2026Fix match_text in fulltext — infiniflow/infinity0 reactions · 1 comment
- Mar 18, 2026ragflow 연계나 활용할 수 있을지 검토 — growthtime-pos/curator-desktop0 reactions
- Mar 11, 2026[Upstream #76] 知识图谱构建提供接入 ragflow api 的功能 — ivanzud/MiroFish0 reactions
- Feb 18, 2026Add API token management architecture and implementation plan — ferryhe/AI_actuarial_inforsearch0 reactions
- Jan 31, 2026feat: add Peewee ORM support for OceanBase as primary database (#12769) — NTLx/ragflow0 reactions · 2 comments
- Nov 5, 2025Would you please rebuild the latest version v0.21.1? — 0xgkd/ragflow-arm640 reactions
- Oct 14, 2025[feat] Add instrumentation for RAGFlow — alibaba/loongsuite-python0 reactions · 1 comment
- Sep 22, 2025Better integration with vector database / RAG? — Alibaba-NLP/DeepResearch0 reactions
- Aug 7, 2025List of possible future integrations (open-source projects) — CollegeNotesOrg/noteparser0 reactions
- Feb 10, 2025可否增加支持ragflow? — songquanpeng/one-api0 reactions
- Dec 16, 2024Fixed fst_len in DictionaryReader — infiniflow/infinity0 reactions
- Oct 26, 2024parse attachments — rsalmond/escribe-transparency0 reactions
- Sep 26, 2024Ability to upload documents manually when Silo Ingestor Loader Type == NONE — dRAGon-Okinawa/dRAGon0 reactions
On Bluesky · 46
- Feb 21, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 infiniflow / ragflow ⭐ 38,526 (+438) 🗒 TypeScript RAGFlow is an open-source RAG… — @github-trending-js.bsky.social7 likes and reposts
- Apr 3, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 infiniflow / ragflow ⭐ 47,701 (+175) 🗒 TypeScript RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending.bsky.social6 likes and reposts
- Feb 25, 2025🎉 Celebrating! 🎉 (500+ new stars) 📦 infiniflow / ragflow ⭐ 40,343 (+591) 🗒 TypeScript RAGFlow is an open-source RAG… — @github-trending-js.bsky.social5 likes and reposts · 1 reply
- Aug 29, 2026ragflow by @infiniflowai (⭐️ 89554) RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge… — @golangoss.bsky.social3 likes and reposts
- Mar 18, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 infiniflow / ragflow ⭐ 45,413 (+272) 🗒 TypeScript RAGFlow is an open-source RAG… — @github-trending-js.bsky.social3 likes and reposts
41 more on Bluesky
- Dec 23, 2024🚀 Exploring Retrieval-Augmented Generation? 🧠✨ Check out #RAGFlow for deep document understanding & powerful chunking, or give #PaperQA2… — @shihcheng.bsky.social3 likes and reposts
- Oct 8, 2026ragflow by @infiniflowai (⭐️ 91845) RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge… — @golangoss.bsky.social2 likes and reposts
- Aug 28, 2026ragflow by @infiniflowai (⭐️ 89492) RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge… — @golangoss.bsky.social2 likes and reposts
- Jul 29, 2026RAGFlow added checkpoint/resume to community extraction and entity resolution, the most expensive parts of GraphRAG indexing. When your… — @jeremymorgan.com2 likes and reposts
- Jul 6, 2026ragflow by @infiniflowai (⭐️ 84351) RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge… — @golangoss.bsky.social2 likes and reposts
- Sep 16, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 infiniflow / ragflow ⭐ 64,392 (+116) 🗒 TypeScript RAGFlow is a leading open-source Retrieval-Augmented… — @github-trending-js.bsky.social2 likes and reposts
- Apr 2, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 infiniflow / ragflow ⭐ 47,553 (+176) 🗒 TypeScript RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending-js.bsky.social2 likes and reposts
- Jan 22, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 infiniflow / ragflow ⭐ 29,108 (+199) 🗒 Python RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending.bsky.social2 likes and reposts
- Apr 3, 2024🚀 Skyrocketing! 🚀 (200+ new stars) 📦 infiniflow / ragflow ⭐ 1,220 (+306) 🗒 Python RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending.bsky.social2 likes and reposts · 1 reply
- Nov 22, 2026ragflow by @infiniflowai (⭐️ 94514) RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into… — @golangoss.bsky.social1 likes and repost
- Nov 6, 2026ragflow by @infiniflowai (⭐️ 93687) RAGFlow is an agent-native database: a Retrieval-Augmented Generation (RAG) engine that grew into… — @golangoss.bsky.social1 likes and repost
- Nov 2, 2026Context as Infrastructure: Knowledge Compilation for Retrieval in Agentic Systems with Harnesses Proposes knowledge compilation for agentic… — @reachsumit.com1 likes and repost
- Nov 1, 2026ragflow by @infiniflowai (⭐️ 93299) RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge… — @golangoss.bsky.social1 likes and repost
- Oct 8, 2026ragflow by @infiniflowai (⭐️ 91785) RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge… — @golangoss.bsky.social1 likes and repost
- Sep 27, 2026ragflow by @infiniflowai (⭐️ 91363) RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge… — @golangoss.bsky.social1 likes and repost
- Sep 21, 2026ragflow by @infiniflowai (⭐️ 91093) RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge… — @golangoss.bsky.social1 likes and repost
- Sep 6, 2026🚀 GitHub Intelligence Drop ragflow (Go • 🟢) ⭐ 90.1K → https://github.com/infiniflow/ragflow mermaid (TypeScript • 🟢) ⭐ 90.1K →… — @githubfeed.bsky.social1 likes and repost
- Sep 1, 2026ragflow by @infiniflowai (⭐️ 89819) RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge… — @golangoss.bsky.social1 likes and repost
- Aug 22, 2026ragflow by @infiniflowai (⭐️ 89002) RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge… — @golangoss.bsky.social1 likes and repost
- Aug 13, 2026📦 infiniflow / ragflow ⭐ 87,371 (+85) 🗒 Go RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses… — @github-trending.bsky.social1 likes and repost
- Aug 9, 2026ragflow by @infiniflowai (⭐️ 87122) RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge… — @golangoss.bsky.social1 likes and repost
- Jul 4, 2026ragflow by @infiniflowai (⭐️ 84256) RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses cutting-edge… — @golangoss.bsky.social1 likes and repost
- Nov 5, 2025📦 infiniflow / ragflow ⭐ 67,121 (+75) 🗒 Python RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that fuses… — @github-trending-js.bsky.social1 likes and repost
- Oct 23, 2025📦 infiniflow / ragflow ⭐ 66,393 (+59) 🗒 TypeScript RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that… — @github-trending-js.bsky.social1 likes and repost
- Oct 18, 2025📦 infiniflow / ragflow ⭐ 66,169 (+62) 🗒 TypeScript RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that… — @github-trending-js.bsky.social1 likes and repost
- Oct 12, 2025For the RAG I’m using RAGFlow. github.com/infiniflow/r... — @radicalkjax.com1 likes and repost · 1 reply
- Oct 10, 2025📦 infiniflow / ragflow ⭐ 65,697 (+55) 🗒 TypeScript RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that… — @github-trending-js.bsky.social1 likes and repost
- Sep 11, 2025📦 infiniflow / ragflow ⭐ 64,071 (+94) 🗒 TypeScript RAGFlow is a leading open-source Retrieval-Augmented Generation (RAG) engine that… — @github-trending-js.bsky.social1 likes and repost
- May 27, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 infiniflow / ragflow ⭐ 53,677 (+140) 🗒 TypeScript RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending-js.bsky.social1 likes and repost
- May 13, 2025🔥 Hot Repo! 🔥 (100+ new stars) 📦 infiniflow / ragflow ⭐ 52,149 (+150) 🗒 TypeScript RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending-js.bsky.social1 likes and repost
- Feb 22, 2025https://github.com/infiniflow/ragflow — @tom-doerr.bsky.social1 likes and repost
- Feb 12, 2025🎉 Celebrating! 🎉 (500+ new stars) 📦 infiniflow / ragflow ⭐ 34,930 (+619) 🗒 Python RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending.bsky.social1 likes and repost · 1 reply
- Feb 7, 2025🚀 Skyrocketing! 🚀 (200+ new stars) 📦 infiniflow / ragflow ⭐ 32,031 (+428) 🗒 Python RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending.bsky.social1 likes and repost
- Apr 9, 2024RAGFlow is an #opensource #RAG (Retrieval-Augmented Generation) engine based on deep document understanding. It offers a streamlined RAG… — @michabbb.bsky.social1 likes and repost · 1 reply
- Apr 1, 2024RAGFlow is an open-source RAG engine based on OCR and document parsing (@github.com) Main Link | Discussion — @newsycombinator.bsky.social1 likes and repost
- Sep 15, 2025Github Repo → github.com/infiniflow/... — @arindam-1729.bsky.social0 likes and reposts · 1 reply
- Jun 17, 2025🎉 Celebrating! 🎉 (500+ new stars) 📦 infiniflow / ragflow ⭐ 56,103 (+770) 🗒 Python RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending.bsky.social0 likes and reposts · 1 reply
- Oct 24, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 infiniflow / ragflow ⭐ 20,436 (+130) 🗒 Python RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending.bsky.social0 likes and reposts · 1 reply
- Aug 17, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 infiniflow / ragflow ⭐ 14,329 (+163) 🗒 Python RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending.bsky.social0 likes and reposts · 1 reply
- Jul 12, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 infiniflow / ragflow ⭐ 11,826 (+144) 🗒 Python RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending.bsky.social0 likes and reposts · 1 reply
- May 9, 2024🔥 Hot Repo! 🔥 (100+ new stars) 📦 infiniflow / ragflow ⭐ 6,882 (+172) 🗒 Python RAGFlow is an open-source RAG (Retrieval-Augmented… — @github-trending.bsky.social0 likes and reposts · 1 reply
On Hacker News · 5
- Apr 1, 2024RAGFlow is an open-source RAG engine based on OCR and document parsing230 points · 53 comments
- May 8, 2024DeepSeek-V2 integrated, RAGFlow v0.5.0 is released7 points
- Aug 6, 2024RAGFlow 0.9 is released to support GraphRAG end-to-end3 points
- Mar 9, 2026Ragflow: fuses RAG with Agent capabilities to create context layer for LLMs2 points
- May 30, 2024Integrated Rerankers, implemented RAPTOR, RAGFlow 0.7 released2 points
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
In this repository3 other files it gives its agents.
- web/AGENTS.mdAGENTS.md
- .github/copilot-instructions.mdCopilot instructions
- go-namingSkill
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
30 rules. About 0 are common, 20 are distinctive, and 10 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈20
Distinctive · estimate
This author's own choices. Worth a look.
10
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 3
Use this file as the local operating guide for the current codebase.
- Distinctive: line 6
Treat legacy code as liability, not as a compatibility target.
- Distinctive: line 7
Prefer deletion over shims, deprecated branches, wrapper APIs, and dual-track migration notes.
- Distinctive: line 8
If old and new implementations coexist, converge to one path unless an external contract forces compatibility.
- Distinctive: line 9
Remove dead tests, commented-out code, stale docs, and "move later" notes instead of preserving them.
- Distinctive: line 11
Keep refactors centered on the owning abstraction, not on adjacent compatibility layers.
- Very specific: line 21
Before deleting rag/, move the Go DeepDoc .ort models and ocr.res out of internal/rag/res/deepdoc/, then update model discovery, dependency …
- Very specific: line 22
Remove the frontend's Go/Python backend variants and update web/CLAUDE.md when the frontend no longer needs them.
- Very specific: line 23
Update Docker's default entrypoint, dependency image, and CI workflows when removing their Python paths.
- Distinctive: line 24
Keep this guide aligned with the checked-in tree.
- Very specific: line 60
Treat internal/ingestion, internal/parser, and internal/deepdoc as actively refactored code.
- Distinctive: line 61
Do not add or preserve deprecated Go APIs just to ease migration inside the repo.
- Distinctive: line 62
Remove commented-out Go code instead of leaving recovery notes in place.
- Distinctive: line 63
Keep package comments and doc comments aligned with the current runtime path, not with migration history.
- Very specific: line 67
When you change a query form across many files, verify the generated SQL with a Session(&gorm.Session{DryRun: true}) probe before relying …
- Very specific: line 79
Add a shared unique index to both sides (Go tag + Peewee Meta.indexes or unique=True), so each runtime recreates it when absent.
- Very specific: line 94
Run tiers locally via build.sh:
- Distinctive: line 108
When reviewing documentation or code, inspect the full affected path and report all verifiable findings in one review.
- Distinctive: line 109
When handling review comments, independently verify each substantive claim against the current code or tests before accepting, rejecting, …
- Distinctive: line 110
Before editing, inspect the nearest code path that actually owns the behavior.
- Distinctive: line 112
Keep changes small and local unless the task is explicitly a broader refactor.
- Distinctive: line 113
Prefer one implementation path instead of preserving old and new versions side by side.
- Distinctive: line 115
If a surface is only there for compatibility, remove it unless the user asks to keep it.
- Distinctive: line 116
Do not add new compatibility wording in comments or docs.
- Distinctive: line 117
When a maintainer takes over a community PR, a new commit generated by rewriting history (e.g.
- Distinctive: line 146
Run the narrowest relevant test, lint, or build command after a change.
- Very specific: line 149
Do not default to raw go test, go build, or IDE Run/Debug for Go in this repo.
- Very specific: line 151
If Go native builds fail, inspect build.sh and internal/development.md before changing code.
- Very specific: line 154
Remove instead of retaining deprecated, legacy, or compatibility-only code.
- Distinctive: line 157
Keep exported APIs only when the current code actually needs them.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
RAGFlow Instructions
Use this file as the local operating guide for the current codebase. Prefer the code and the current AGENTS.md over any older convention or remembered project shape.
Core Stance
- Treat legacy code as liability, not as a compatibility target.
- Prefer deletion over shims, deprecated branches, wrapper APIs, and dual-track migration notes.
- If old and new implementations coexist, converge to one path unless an external contract forces compatibility.
- Remove dead tests, commented-out code, stale docs, and "move later" notes instead of preserving them.
- Reduce public surface area when a helper can be made private or internal.
- Keep refactors centered on the owning abstraction, not on adjacent compatibility layers.
Current stack
- Backend: Go implements the API, admin, ingestor, and syncer modes in
cmd/ragflow_server.go; the CLI runs fromcmd/ragflow-cli.go. The Python API, admin, and workers are still present anddocker/entrypoint.shstill defaults to Python whenAPI_PROXY_SCHEMEis unset. Go-only operation is the migration target, not the current repository state. - Frontend: React + TypeScript + Vite in
web/. When working underweb/, read and followweb/AGENTS.mdfor frontend conventions. - The Go module contains the server, ingestion, parsing, agent runtime, CLI, and supporting services.
- Runtime services commonly include MySQL/PostgreSQL, Kvrocks, NATS JetStream, MinIO, ClickHouse, and Elasticsearch/Infinity/OpenSearch depending on configuration.
Go-only target
- Remove all Python code and Python-specific dependencies, scripts, containers, CI jobs, documentation, SDKs, and tests from the repository. Do not add new Python code while this removal is in progress. Replace Python-based preparation of Go native libraries, DeepDoc models, and the BPE table before removing the existing download scripts.
- Move any still-required behavior and test coverage into the Go backend or the frontend before deleting the old implementation. Do not preserve a Python server, compatibility layer, fallback, or dual-backend path.
- Before deleting
rag/, move the Go DeepDoc.ortmodels andocr.resout ofinternal/rag/res/deepdoc/, then update model discovery, dependency preparation, Docker packaging, and tests together. - Remove the frontend's Go/Python backend variants and update
web/CLAUDE.mdwhen the frontend no longer needs them. Until then, treat its dual-backend instructions as migration-only guidance; new frontend work should target the Go API. - Update Docker's default entrypoint, dependency image, and CI workflows when removing their Python paths. Until then, select Go explicitly with
API_PROXY_SCHEME=gowhere that variable controls startup. - Keep this guide aligned with the checked-in tree. Once the Python directories are deleted, remove their migration inventory below.
Code Layout to Expect
cmd/ragflow_server.go: Go entrypoint for the API, admin, ingestor, and syncer modes (--api,--admin,--ingestor,--syncer).cmd/ragflow-cli.go: Go CLI entrypoint.api/,rag/,deepdoc/, andagent/: legacy Python implementation pending deletion. Do not add features or extend dependencies there.internal/: main Go application code. Important subtrees:internal/agent/: Go agent runtime, canvas execution, components, tool bindings, workflow helpers.internal/admin/: Go admin routes, handlers, and services.internal/binding/cpp/: C++ tokenizer binding built bybuild.shfor the Go server.internal/cli/: CLI parsing, HTTP transport, command execution, response formatting.internal/dao/: Go data-access layer and persistence-facing helpers.internal/deepdoc/: Go DeepDOC integrations, especially native-backed PDF/DOCX parsing.internal/engine/: search/index backends such as Elasticsearch and Infinity.internal/entity/: shared Go entities and model definitions.internal/handler/: HTTP handlers and route-facing request logic.internal/ingestion/: Go ingestion pipeline, canvas adapter, components, wiring, service orchestration.internal/ingestion/component/: stage implementations such as file/parser/chunker/tokenizer/extractor.internal/ingestion/pipeline/: DSL translation, canvas-driven execution, checkpoints, resume/run logic.internal/parser/: parser and chunk libraries used by ingestion and other Go paths.internal/parser/parser/: typed parse-result parsers for markdown/html/pdf/docx/xlsx/text and related families.internal/parser/chunk/: chunk operator library and DSL/typed execution helpers.internal/service/: higher-level business services used by handlers and server flows.internal/storage/: storage backends and in-memory test doubles.internal/router/: HTTP route registration.internal/server/: server bootstrap/config wiring.internal/syncer/: Go file synchronization service and connectors.internal/rag/: Go retrieval and RAG logic.internal/harness/: Go runtime harness and supporting execution code.web/: frontend application.docker/: local and production compose files.sdk/python/: legacy Python client SDK pending deletion.ragflow_deps/download_deps.py: Python helper for Go native libraries, DeepDoc models, and tokenizer assets. Replace it with non-Python preparation before removing Python dependencies.test/: contains Python tests, including tests that import the legacy Python implementation directly. Migrate needed coverage to Go tests or frontend tests, then remove the Python tests; keep only tests for supported code.
Go-Specific Rules
- Treat
internal/ingestion,internal/parser, andinternal/deepdocas actively refactored code. Prefer collapsing duplicate paths over preserving transitional wrappers. - Do not add or preserve deprecated Go APIs just to ease migration inside the repo.
- Remove commented-out Go code instead of leaving recovery notes in place.
- Keep package comments and doc comments aligned with the current runtime path, not with migration history.
GORM query traps
- Never pass a bare string ID as the second argument to
Take/First(e.g.Take(&x, id)). Under GORM v1.25.7 a non-numeric string is treated as a raw SQL condition and concatenated into theWHEREclause:Take(&x, "88b17c7a...")emitsWHERE 88b17c7a... LIMIT 1, which MySQL rejects withError 1054 (42S22): Unknown column '...' in 'where clause'. Only strings that parse viastrconv.Atoiare treated as primary-key values, so this bug is invisible for integer IDs and catastrophic for UUID primary keys. Always bind explicitly:Take(&x, "id = ?", id)orWhere("id = ?", id).Take(&x). - When you change a query form across many files, verify the generated SQL with a
Session(&gorm.Session{DryRun: true})probe before relying on it. A passing unit test with no rows and a brokenWHEREclause look identical unless the SQL is inspected.
Shared database schema (Go + Python)
The Go services and the Python API write to the same MySQL/PostgreSQL schema, and both own parts of it. Neither is authoritative over the whole.
Each ORM derives index names differently:
- Go (
internal/entity/): GORM derivesidx_<table>_<column>for indexes anduni_<table>_<column>for unique constraints. Tags in this repo name unique indexes explicitly, e.g.uniqueIndex:idx_commit_file. - Python (
api/db/db_models.py): Peewee derives<db_table>_<col1>_<col2>(truncated with an md5 suffix past 64 chars, seeplayhouse.migrate.make_index_name). There is noidx_prefix.
Both sides reconcile by column set, not by name: Go's hasUniqueIndex (internal/dao/migration.go) accepts an existing index only when its full column set equals the requested one, and Python's ensure_model_indexes (api/db/db_models.py) keys DB.get_indexes() on the column tuple. Consequences:
- Divergent names covering the same columns are expected, not a defect. Whichever runtime reaches the database first decides the name. Do not "fix" this by renaming inside a migration; it rewrites live databases for no functional gain.
- Add a shared unique index to both sides (Go tag + Peewee
Meta.indexesorunique=True), so each runtime recreates it when absent. Do not add a second index over a column set an existing one already covers. - In Go, declare single-column uniqueness with a named
uniqueIndex:, not a bareuniquetag. A bareuniquebecomes a table-level constraint in DDL, which SQLite materializes as an implicit index that cannot be dropped by name, and which GORM'sMigrateColumnUniquethen tries to drop under its ownuni_<table>_<column>name — MySQL answers 1091 every startup.namedIndexMigrator(internal/dao/database.go) suppresses exactly that phantom drop; seeTestNamedIndexMigratorSkipsPhantomUniqueDrop. - A Python model existing does not mean Python owns that table's constraints.
pipeline_operation_loghas norun_countcolumn and no unique index indb_models.py; both are added only byinternal/dao/migration.go.
Go Test Tiers
Go tests are classified by build tag. Tag a test file with //go:build <tier> placed before the package clause. Run them through build.sh so the required CGO configuration and native libraries are available.
| Tier | Build tag | Runs by default? | Needs |
| Unit | (none) | Yes (bash build.sh --test) | Native CGO static libs; no external services — uses in-memory SQLite, miniredis, or httptest stubs. |
| Integration | integration | No (-tags integration) | A real service: MySQL/MinIO/Elasticsearch/Infinity/LLM. Single component, reasonably fast. |
| E2E | e2e | No (-tags e2e) | Full cross-component pipeline (ingest → index → retrieve) against real services; heavy/slow. |
| Manual | manual | No (-tags manual) | Very slow/expensive (deepdoc render/parity/snapshot/bench). Local opt-in ONLY — never run in CI. |
| Native (orthogonal) | cgo / !cgo | cgo auto-satisfies under CGO_ENABLED=1 | Native static libs (office_oxide/pdfium/pdf_oxide). Combine with tiers, e.g. //go:build cgo && integration. |
Run tiers locally via build.sh:
bash build.sh --test # unit tier (no tags)
bash build.sh --test-integration ./... # integration tier
bash build.sh --test-e2e # e2e tier
bash build.sh --test-manual # manual tier (very slow)
bash build.sh --test-all # integration + e2e (never includes manual)Rules:
- New tests that touch a real external service MUST carry
integration/e2e/manual— do not rely ont.Skip+ env vars to soft-isolate them in the default unit run. Keep an env guard as a harmless secondary safety net if desired. manualis never wired into CI or any automated pipeline.unit(no tag) must stay free of external-service dependencies sobash build.sh --testruns without MySQL/MinIO/ES/Infinity/LLM. The native CGO static libraries (office_oxide/pdfium/pdf_oxide) are still required at build time and are wired bybuild.sh --test; that is expected, not an external service.
Working Rules
- When reviewing documentation or code, inspect the full affected path and report all verifiable findings in one review; do not return after only a few findings and expose further issues in later rounds.
- When handling review comments, independently verify each substantive claim against the current code or tests before accepting, rejecting, or acting on it.
- Before editing, inspect the nearest code path that actually owns the behavior.
- For server changes, work in the Go implementation. If a Python behavior is still needed, port it to Go and test the Go path before removing the Python code.
- Keep changes small and local unless the task is explicitly a broader refactor.
- Prefer one implementation path instead of preserving old and new versions side by side.
- Preserve behavior with focused tests when the behavior is still valid; do not keep tests that protect obsolete behavior.
- If a surface is only there for compatibility, remove it unless the user asks to keep it.
- Do not add new compatibility wording in comments or docs.
- When a maintainer takes over a community PR, a new commit generated by rewriting history (e.g.
merge,rebase -i) must preserve the original author and add the maintainer as co-author (via aCo-authored-by:trailer) instead of overwriting the author with the maintainer alone.
Commands
Go backend
bash build.sh --all # build native code and Go server
bash build.sh --go # build Go server with native library already built
bash build.sh --test ./internal/handler/... # targeted unit tests
bash build.sh --test # all unit tests
bash build.sh --test-integration ./... # integration tests; requires real services
bash build.sh --test-e2e # full-pipeline tests; requires real services
bash build.sh --test-manual # local opt-in only
bash build.sh --test-all # integration + e2e; excludes manualNative libraries, Go DeepDoc models, tokenizer assets, and ragflow_deps/cl100k_base.tiktoken come from ragflow_deps/download_deps.py; see README_zh.md for its isolated setup. The downloader installs stagehand into the SDK cache using the version in go.mod. Build the Go resource image with cd ragflow_deps && docker build -f Dockerfile -t infiniflow/ragflow_deps:latest . after downloading the resources.
Frontend
cd web
npm install
npm run dev
npm run build
npm run lint
npm run test
npm run type-checkValidation Preference
- Run the narrowest relevant test, lint, or build command after a change.
- For backend changes, first run package-scoped
bash build.sh --test ./path/to/package/.... Run the integration or e2e tier when the changed behavior needs real services or a full pipeline. - For frontend changes, prefer the touched-package lint, type-check, or test command.
- Do not default to raw
go test,go build, or IDE Run/Debug for Go in this repo. They often miss the required CGO flags and native static libraries (office_oxide,pdfium-static,pdf_oxide) thatbuild.shwires correctly. - After a Go build, execute the resulting binary's help command for each changed server mode; a successful link alone does not prove the binary starts. On this host, the original
build.shselected default LLD 18 and produced binaries that crashed before Gomain; linking with LLD 20 started successfully. Verify the linker actually selected on Linux before trusting a new binary. - If Go native builds fail, inspect
build.shandinternal/development.mdbefore changing code. Common environment issues are missing downloaded native dependencies or an incompatibleld.lldon Linux.
Default review checklist
- Remove instead of retaining
deprecated,legacy, or compatibility-only code. - Collapse duplicate implementations to one path.
- Drop stale comments and documentation that describe a superseded design.
- Keep exported APIs only when the current code actually needs them.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

