Glossary

Retrieval-augmented generation (RAG)

Why an AI assistant can quote your contract when the model has never seen it.

In short

Retrieval-augmented generation (RAG) is a technique in which an AI system first retrieves relevant information from an external source, such as a search index, a document store, or an email account, and then passes that information to a large language model to generate its response. RAG lets a model answer from specific, current data it was never trained on.

How retrieval-augmented generation works

  1. 1
    Retrieve

    The system turns the question into a search and pulls the most relevant passages, messages, or files.

  2. 2
    Augment

    Those results are placed in the prompt alongside the original question.

  3. 3
    Generate

    The language model writes the answer, drawing on the retrieved text rather than only what it learned in training.

The term comes from a 2020 research paper by Patrick Lewis and colleagues, "Retrieval-Augmented Generation for Knowledge-Intensive NLP Tasks." Today it describes almost any system that searches before it writes.

A retrieval-augmented generation example in email

A client asks, "What did we agree the payment terms were?" A model on its own has no idea. A RAG system searches your email and files, finds the signed agreement and the thread where terms were discussed, and drafts a reply quoting net 30 from the actual document.

RAG vs. fine-tuning

Fine-tuning changes the model itself by training it on more data. RAG leaves the model unchanged and supplies information at the moment of the request. For personal data like email, RAG is the usual choice: the data changes every hour, and it shouldn't be baked into a model others use.

Synced works this way when it handles a message: it searches connected sources like Gmail, Google Drive, and OneDrive for context before drafting the reply.

Get started

Get early access to Synced.

Join the private beta. Synced drafts the replies, finds the files, and proposes the meeting times. You approve.

Get Early AccessFree plan. No credit card.