Understand how RAG, chunking, embedding, indexing, retrieval, and Wiki knowledge organization work
What Is RAG?
RAG (Retrieval-Augmented Generation) is a technique that integrates a retrieval system with a large language model (LLM). When a user submits a query, the system first retrieves relevant text snippets from a knowledge base, then feeds both the retrieved snippets and the original query into the LLM to generate a grounded, evidence-based response.
Processing Pipeline
| Stage | Purpose |
|---|---|
| Parsing | Identifies headings, paragraphs, tables, images, and formulas in content and stores them in structured format |
| Chunking | Splits content into small, searchable units—typically 256–4096 tokens |
| Embedding | Converts text into vector representations for semantic matching |
| Indexing | Stores chunks and their embeddings to enable fast search |
| Retrieval | Returns the top-K most relevant chunks given a query |
| Reranking | Reorders initial retrieval results to improve relevance |
| Generation | The LLM generates the final natural-language answer using retrieved chunks as context |
Knowledge Base Types
| Type | Suitable Data | Retrieval Method | Typical Use Cases |
|---|---|---|---|
| Document Knowledge Base | PDF / Word / Markdown / HTML | Hybrid vector + keyword search | Product manuals, contract templates, internal wikis |
| Data Knowledge Base | CSV / Excel / RDS tables | Natural language → SQL translation | Order data, inventory reports |
| Image Knowledge Base | Product photos / design mockups / posters | Reverse image search, multimodal Q&A | Visual search, image-based question answering |
| Audio/Video Knowledge Base | Meeting recordings / training courses | Speech-to-text followed by text retrieval | Video content search |
Wiki and Ontology Knowledge Graph
Flagship document knowledge bases can enable Wiki to organize documents into readable, retrievable topic knowledge pages (Wiki Pages). After you enable it, the system uses a large language model to extract summaries, entities, and concepts from documents, generates structured Wiki Pages, and builds an independent index that participates in knowledge retrieval and Q&A.
- Wiki Page: A topic-organized knowledge page that can be read, revised, and used in retrieval recall. Automatically generated Pages can be traced back to their source documents.
- Wiki retrieval: A retrieval service based on the independent Wiki Page index, alongside chunk retrieval. It is suitable for topic understanding, entity lookup, concept explanation, and related knowledge recall.
- Ontology knowledge graph: A relationship view generated from associations between Wiki Pages, used for knowledge browsing and relationship display. The graph data itself does not participate in retrieval.
Key Terminology
| Term | Description |
|---|---|
| Knowledge Base | A logical collection of documents sharing the same chunking, embedding, and indexing configurations |
| Document | Original content uploaded or synced into the knowledge base—e.g., files, web pages, or database records |
| Chunk | The smallest retrievable unit after document splitting |
| Wiki Page | A topic knowledge page generated after enabling Wiki in a Flagship document knowledge base. Includes types such as summaries, entities, and concepts, and builds an independent index for retrieval recall |
| Wiki retrieval | A retrieval service based on the independent Wiki Page index, alongside chunk retrieval. Returns topic-oriented knowledge pages and source information |
| Ontology knowledge graph | A relationship view generated from Wiki Page associations, used for knowledge browsing and relationship display. The graph data itself does not participate in retrieval |
| Top-K | Number of chunks returned by retrieval; common values are 3–10 |
| Relevance Score | Semantic similarity between a retrieved chunk and the query, ranging from 0 to 1 |
| Dataset | Integration channel for external data sources (e.g., OSS, MySQL, Yuque) |
| Retrieval Service | Configuration unit enabling federated search across multiple knowledge bases, with independent parameter tuning |
| Q&A Service | Adds LLM-powered generation on top of retrieval, returning natural-language answers with citations |
| Business Space | Resource isolation unit—multiple spaces can be created under one account |
Retrieval Modes
| Mode | How It Works | Use Cases |
|---|---|---|
| Ultra-Fast Mode | Single-round direct retrieval; lowest latency | Simple factual questions |
| Multi-Turn Intelligent Mode | LLM-driven iterative search planning with automatic query rewriting | Complex questions, multi-step reasoning |