Skip to main content
Getting Started

Core Concepts

Understand how RAG, chunking, embedding, indexing, and retrieval 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.

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
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
Data ConnectorIntegration 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.