Retrieval-augmented generation (RAG)
Also called RAG
Retrieval-augmented generation (RAG) is a technique in which an AI system first retrieves relevant passages from a chosen set of documents, then gives them to a language model to write its answer. It lets the model answer from current, specific information it was never trained on, and makes answers easier to check.
Example
Asked "what's your return window?", a RAG system searches the store's pages, finds the returns-policy paragraph and passes it to the model, which answers "30 days from delivery".
Why it matters for a website chatbot
RAG is how a website chatbot can know your business without training a model from scratch. The quality of retrieval decides the quality of answers. ChatBento uses RAG: it splits your content into passages, finds the most relevant ones for each question, and answers from them with source links.
See it in practice: Docs and help-center search
Related terms
- EmbeddingsEmbeddings are lists of numbers that represent the meaning of a piece of text, image or other data, produced by a machine-learning model. Texts with similar meanings get similar numbers, even when they share no words, which lets software compare meaning mathematically for search, recommendations and grouping.
- Vector searchVector search finds items whose embeddings are closest to the embedding of a query, so results match by meaning rather than by exact words. The embeddings are stored in a vector index or vector database built to find the nearest matches quickly, even across millions of items.
- ChunkingChunking is splitting long documents into smaller passages, or chunks, before creating embeddings for retrieval. Chunks need to be small enough to match specific questions and fit in a model's context window, but large enough to keep their meaning. Many systems overlap neighboring chunks slightly so sentences aren't cut off.
- GroundingGrounding means tying an AI model's answer to a specific, trusted source of information, such as retrieved documents, a database or search results, so its claims can be traced and checked. A grounded answer says only what its sources support, and ideally shows which source each part came from.