Glossary term
What is RAG (retrieval-augmented generation)?
Fetching relevant documents first and giving them to the model with the question.
Definition
Retrieval-augmented generation (RAG) answers a question in two steps: first it retrieves the passages most relevant to the question from your own documents, usually with embeddings, then it sends those passages to a language model together with the question, so the answer is based on your data.
Why it matters
RAG lets a model answer from documents it was never trained on, such as your help center or contracts, and cite them. It is usually cheaper and easier to keep current than fine-tuning.
How it works on OceanToken
You can build every step of RAG on OceanToken with one key: /v1/embeddings to index and search, /v1/rerank to sort the matches, and any chat model to write the answer. Pick models on the model list.