Skip to main content

Core Concepts

How RAG, chunking, embeddings, indexing, and retrieval fit together.

What is RAG

Retrieval-Augmented Generation (RAG) combines a retrieval system with a large language model. When a user asks a question, the platform first retrieves relevant passages from a Knowledge Base, then sends those passages alongside the question to the LLM to generate a grounded answer.
DimensionLLM aloneRAG
Knowledge freshnessFrozen at training timeReal time — follows your data
Private dataNot availableConnects to internal data
Source attributionNoneReturns the citations and sources
Hallucination controlWeakStrong — answers cite real passages

Processing pipeline

Document → Parsing → Chunking → Embedding → Index → Retrieval → Rerank → Generation
StageWhat it does
ParsingIdentifies headings, paragraphs, tables, images, and formulas and stores them as structured content.
ChunkingSplits documents into retrievable pieces, typically 256–4096 tokens.
EmbeddingConverts text into vector representations for semantic matching.
IndexStores Chunks and vectors for fast search.
RetrievalReturns the top-K most relevant Chunks for a query.
RerankRe-orders the initial results to improve relevance.
GenerationThe LLM produces the final answer based on the retrieved Chunks.

Knowledge Base types

TypeDataRetrieval methodTypical use cases
Unstructured DocumentsPDF, Word, Markdown, HTMLHybrid vector + keywordProduct manuals, contract templates, internal wikis
Structured dataCSV, Excel, RDS tablesNatural-language-to-SQLOrder data, inventory reports
Image libraryProduct photos, design files, postersImage-to-image search, visual Q&AImage search, visual Q&A
Audio / video libraryMeeting recordings, training coursesSpeech-to-text retrievalVideo content search
If you're not sure which type to pick, start with an Unstructured Documents Knowledge Base.

Glossary

TermDefinition
Knowledge BaseA logical collection of documents that share a chunking, embedding, and index configuration.
DocumentThe raw content uploaded or synced into a Knowledge Base — a file, web page, or database record.
ChunkThe smallest unit of retrieval; a document is split into Chunks.
Top-KThe number of Chunks returned by retrieval — typically 3 to 10.
Relevance scoreThe semantic similarity between a Chunk and the query, on a 0–1 scale.
Data ConnectorAn ingestion channel for an external source — OSS, MySQL, Yuque, and so on.
Knowledge Search serviceA configuration unit for Multi-index Retrieval, with its own tunable parameters.
Knowledge Q&A serviceAdds LLM generation on top of retrieval and returns a natural-language answer with citations.
WorkspaceA resource isolation boundary — one account can have multiple workspaces.

Retrieval modes

ModeHow it worksBest for
Fast modeSingle-shot retrieval with the lowest latency.Simple factual questions.
Agentic modeModel-driven multi-turn planning that rewrites the query as it goes.Complex or multi-step questions.
Ready to try? Build your first Knowledge Base in the Quickstart.