ragflow AGENTS.md

Repository-specific instructions for working on RAGFlow, a software project that combines a web interface, APIs, background workers, and search-related services. They describe the codebase, technology choices, and preferred approach to old code.

In plain words
What is it for?
Planning and implementing changes across RAGFlow's Python, Go, React, and TypeScript code, while following its project conventions.
Why use it?
They give an agent enough local context to make changes that fit the current project. They also discourage keeping unnecessary compatibility code or outdated material.

Instructions file for CodexOpenCode

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add instructions/infiniflow/ragflow/agents-md
Clone the repo
git clone --depth 1 https://github.com/infiniflow/ragflow

Made for: Codex, OpenCode.

Per session 2,027 This file is loaded in full into every session.
When invoked 2,027 The same file — it is already loaded in full.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.02027 $0.02027
Opus 5 $0.01014 $0.01014
Sonnet 5 $0.00405 $0.00405
Haiku 4.5 $0.00203 $0.00203

Measured 3d ago against content hash 16920b40d670, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

ragflow AGENTS.md scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

AGENTS.md · 136 lines

How it starts

The opening of the file, as written. The whole thing — 136 lines — stays where its author put it; the contents beside it link to each section on GitHub.

RAGFlow Instructions

Use this file as the local operating guide for the current codebase. Prefer the code and the current CLAUDE.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: Python 3.13+, Quart-based API server, Peewee ORM, async workers.
  • Frontend: React + TypeScript + Vite in web/ (dual-backend Go/Python variant conventions: see web/CLAUDE.md).
  • Go: the repository also has a substantial Go module for servers, ingestion, parser/runtime, CLI, and supporting services.
  • Runtime services commonly include MySQL/PostgreSQL, Redis, MinIO, and Elasticsearch/Infinity/OpenSearch depending on configuration.

Code Layout to Expect

  • api/: Python API server entrypoints, blueprints, services, and database code.
  • rag/: ingestion, retrieval, LLM integration, and graph RAG logic.
  • deepdoc/: parsing and OCR.
  • agent/: workflow canvas, components, tools, and templates.
  • cmd/: Go entrypoints. ragflow_main is the main server/admin/ingestor binary surface; ragflow-cli is the CLI entrypoint.
  • internal/: main Go application code. Important subtrees:
  • internal/agent/: Go agent runtime, canvas execution, components, tool bindings, workflow helpers.
  • 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/cpp/: C++ sources used by native-backed Go features.
  • web/: frontend application.
  • docker/: local and production compose files.
  • sdk/ and test/: SDK and automated tests.

Read the full file on GitHub · 136 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 136 lines · 2,027 tokens per session scan A 16920b40d670

Subscribe to this mod's changes

ragflow AGENTS.md is an instructions file published in the GitHub repository infiniflow/ragflow (89,841 stars, last pushed today), licensed Apache-2.0. It adds 2,027 tokens to every session, about $0.0101 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.