RAGFlow Tutorial 2026: Complete Beginner Guide
RAGFlow Tutorial 2026: Complete Beginner Guide。RAGFlow's differentiator is document understanding. Most RAG failures start at parsing: tables collapse into n
📜 Table of Contents
📖 Keep reading
RAGFlow Tutorial 2026: Deploy It and Build Your First Knowledge Base
RAGFlow's differentiator is document understanding. Most RAG failures start at parsing: tables collapse into number soup, two-column papers read across lines, scans come out blank. DeepDoc analyzes layout first, identifies headings, body text, tables and figures, then chunks along semantic boundaries with structure and position preserved.
When it fits
Table-heavy contracts and reports, scanned PDFs, Q&A that must cite an exact location, and Chinese-first corpora.
Deploy
git clone https://github.com/infiniflow/ragflow.git
cd ragflow/docker
docker compose -f docker-compose.yml up -d
Two prerequisites: raise vm.max_map_count to 262144 (persist it in /etc/sysctl.conf, or the bundled search engine will not start), and review .env for image tag and ports. The web UI defaults to port 80, the API to 9380. Parsing is CPU-bound, so four cores or more keeps large PDFs from stalling.
Configure models
| Purpose | Choice |
|---|---|
| Chat | Any OpenAI-compatible endpoint or local Ollama |
| Embedding | A multilingual embedding model |
| Rerank | Optional but clearly improves precision |
For Ollama, enter http://host:11434 as the provider address and add model names manually. Inside a container, localhost refers to the container, not the host. The embedding model must be configured before creating a knowledge base, because switching it later forces a reindex.
First knowledge base
Create, choose an embedding model, upload documents, pick a chunk template, parse, then inspect the chunk preview before building the assistant. Template choice matters:
| Template | Documents |
|---|---|
| General | Default, general text |
| Q&A | Existing question-answer pairs |
| Manual | Product manuals |
| Table | Table-centric data |
| Paper | Academic papers by section |
| Book | Long-form books |
| Laws | Clauses and articles |
| Presentation | Slide decks |
| One | Whole document as one chunk |
Wrong templates produce odd chunks, such as a paper split as plain text with abstract and method merged. Inspect a few screens of chunks right after parsing; redoing it then is cheap.
Tuning retrieval
Similarity threshold filters weak matches; keyword weight helps when proper nouns dominate; returning 3-6 chunks suits most Q&A; reranking improves precision at the cost of latency. Citations link back to the exact source location, which matters for internal trust.
FAQ
Parsing stuck? Check logs for memory limits and vm.max_map_count. OCR on scanned files is slow by nature.
Chinese tables misaligned? Use the Table template or upload spreadsheets separately. Merged cells defeat every parser; a manual pass is faster.
Fully offline? Yes, with Ollama for chat, embedding and rerank after the initial image and weight pull.
RAGFlow or Dify? RAGFlow for document-heavy retrieval with precise citations; Dify for business process orchestration. They call each other over APIs.
Document updates? Re-upload the same filename and it re-parses. Batch by directory for large sets.
Related
Written by our editorial team; tools listed here are tested or verified against public sources. Links point to official sites or GitHub repos for reference only — no paid placements.