Skip to main content

Core Concepts

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

StagePurpose
ParsingIdentifies headings, paragraphs, tables, images, and formulas in content and stores them in structured format
ChunkingSplits content into small, searchable units—typically 256–4096 tokens
EmbeddingConverts text into vector representations for semantic matching
IndexingStores chunks and their embeddings to enable fast search
RetrievalReturns the top-K most relevant chunks given a query
RerankingReorders initial retrieval results to improve relevance
GenerationThe LLM generates the final natural-language answer using retrieved chunks as context

Knowledge Base Types

TypeSuitable DataRetrieval MethodTypical Use Cases
Document Knowledge BasePDF / Word / Markdown / HTMLHybrid vector + keyword searchProduct manuals, contract templates, internal wikis
Data Knowledge BaseCSV / Excel / RDS tablesNatural language → SQL translationOrder data, inventory reports
Image Knowledge BaseProduct photos / design mockups / postersReverse image search, multimodal Q&AVisual search, image-based question answering
Audio/Video Knowledge BaseMeeting recordings / training coursesSpeech-to-text followed by text retrievalVideo content search
If you're unsure which type to choose, start with a Document Knowledge Base.

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.
Wiki does not replace the existing chunk and vector indexes. For questions that require strict verification against original text, such as contract clauses, error codes, and exact values, use chunk retrieval together with source documents.
For Wiki enablement, configuration, billing, page management, and retrieval/Q&A, see Wiki and Ontology Knowledge Graph.

Key Terminology

TermDescription
Knowledge BaseA logical collection of documents sharing the same chunking, embedding, and indexing configurations
DocumentOriginal content uploaded or synced into the knowledge base—e.g., files, web pages, or database records
ChunkThe smallest retrievable unit after document splitting
Wiki PageA 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 retrievalA retrieval service based on the independent Wiki Page index, alongside chunk retrieval. Returns topic-oriented knowledge pages and source information
Ontology knowledge graphA relationship view generated from Wiki Page associations, used for knowledge browsing and relationship display. The graph data itself does not participate in retrieval
Top-KNumber of chunks returned by retrieval; common values are 3–10
Relevance ScoreSemantic similarity between a retrieved chunk and the query, ranging from 0 to 1
DatasetIntegration channel for external data sources (e.g., OSS, MySQL, Yuque)
Retrieval ServiceConfiguration unit enabling federated search across multiple knowledge bases, with independent parameter tuning
Q&A ServiceAdds LLM-powered generation on top of retrieval, returning natural-language answers with citations
Business SpaceResource isolation unit—multiple spaces can be created under one account

Retrieval Modes

ModeHow It WorksUse Cases
Ultra-Fast ModeSingle-round direct retrieval; lowest latencySimple factual questions
Multi-Turn Intelligent ModeLLM-driven iterative search planning with automatic query rewritingComplex questions, multi-step reasoning
Next, create your first knowledge base in the Quick Start.